Forum Moderators: phranque

Message Too Old, No Replies

How to restore Apache on Mac and make it work again?

Apache on Mac not working.. Any help,please?

         

MayaBR

10:48 am on Dec 9, 2015 (gmt 0)

10+ Year Member



I had XAMMP installed  on Mac OSX 10.6.8, it didn’t work and I trashed it including the visible bits and pieces in the system/library,etc.which  remained after the trashing using various erasing programs.


Apparently now something went wrong with the built in
Apache server and the following problems occur:

When enter (just for test)
[localhost...] my browsers, 
- Firefox displays  blank page  and XAMPP  logo  the tab.
with message ‘Unable to connect”.
 - Chrome shows message:
'Not Found
error 404
The requested URL not found on this server.'


Also, in System Preferences I tried to turn Web Sharing on and off 
but can’t get it on - the button stays orange instead of going green.
   Managed to find a file .plist which looked like Apache preferences  and trashed it but no success

I never had such problems with Apache before installing and trashing  XAMMP
and don’t know  how to fix them.

I’m not a techie and any practical help about making Apache function again will be much appreciated!

Thanks in advance for any useful tips/guidance!

lucy24

7:58 pm on Dec 10, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hypothesis: When you removed XAMMP, your computer's own hosts file wasn't updated, so the browser still thinks "localhosts" lives in the XAMMP directory-- which it can't find.

Disclaimer: I know nothing about XAMMP-- in fact I had to do a hasty edit when I found I'd been spelling it XAMPP-- but have always got MAMP to work more-or-less as intended. It's even possible to run multiple sites on the free version if you're prepared to get your hands dirty; you only have to do it once.

Do you know how to open your /hosts file in Terminal? Please say yes, because I don't have it internalized, and have to copy-and-paste my written instructions including finding where I wrote them down every time

MayaBR

7:36 am on Dec 14, 2015 (gmt 0)

10+ Year Member



Thanks lucy24

Seems to me nobody knows what is to be done here with my problem,so,
I am ready to try your idea about Terminal and learn something new for me.

Yes, I know how to open Terminal. Have seen many warning that it can damage my system if not used properly...it sounds scary to me.

I'll be very thankful if you send your step - by-step instructions from opening Terminal to closing it when the job is done!

lucy24

10:07 pm on Dec 15, 2015 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I've just had a look at my own /hosts/ file and it doesn't say exactly what I thought it would.

But this will do no harm; you're just looking.

#1 find and open Terminal
At some point in what follows, you may be prompted for your computer's password. Generally it's triggered by the first occurrence of "sudo".

#2 at the prompt, type (with spaces as shown)
sudo cp /etc/hosts /etc/hosts.bak
(You are making a backup of the file "hosts" which lives in the invisible directory /etc/ which, on my system, is actually an alias of the similarly invisible /private/etc/. I use a quickie toggle called "Hidden Way"-- which I suppose I downloaded from somewhere-- to show and hide invisible files. They don't need to be visible; it's just educational to see everything that's there.)

#3 now type
sudo pico /etc/hosts
(You still haven't changed or edited anything. Now it is just showing you the content of the "hosts" file.)

See anything you don't expect? Mine says "localhost" twice: the first is the expected "127.0.0.1"; the second is "::1" which I would dearly like to have explained to me. Is it the IPv6 equivalent?

When done, just quit Terminal in the same way you'd quit any other application.

:: uneasily wondering how and why "mail.{my-www-host}.com" is listed in this file ::

Come to think of it, when did you last empty your browser cache? It would be embarrassing if it turned out your computer is blameless and it's the browser looking for something that isn't where it expected.