Severniy
Severniy

Reputation: 81

Apache Configuration, Cannot Connect to Localhost

I'm running into an issue with Apache 2.4.18 (on OS X El Capitan 10.11.6), and I cannot pinpoint what the cause is. I've spent 4 days trying to resolve this (including searching here), but I'm throwing in the towel and just asking.

I have little experience here. Following a few guides last weekend, I attempted to set up my system to allow me to develop a site as I work on learning HTML/Javascript/PHP. Following a few guides, I installed dnsmasq and attempted to configure httpd.conf and httpd-vhosts.conf. Initially, localhost directed me to the "It Works" page, as did my virtual hosts home.dev and sites.dev. No matter what I did, I couldn't get any *.dev site to direct to my actual index.html file in my virtualdocumentroot.

I've tried

Now the issue has gotten worse. In working with config files trying to fix this, I've broken something, and I have no idea what. Accidentally overwrote the httpd.conf file in originals folder. Attempted to use httpd.conf file I found searching for the default, does not work. At this point, I'd be happy just to see 'It Works' again...

Not sure if I should post my .conf here, any suggestions?

Thanks!

Update 8/20:

Still haven't found a solution, but feel like I'm making progress:

Somewhere, it appears apache is running (right??), I just don't understand where or how to figure it out.

Is there a netstat/lsof command I can enter and figure out what port apache is listening on? Maybe that will get me started in the right direction here.

Upvotes: 3

Views: 7247

Answers (1)

Severniy
Severniy

Reputation: 81

Update:

For anyone else who encounters this, hopefully I can save you the week I spent trying to fix this.

Checked Console to find "ReportCrashes" for httpd (even though sudo apachectl start appeared to work,and when running the command again I would get a service already loaded message.) Searching for crumbs I came across https://discussions.apple.com/thread/6602475?tstart=0.

As simple as it sounds, commenting out the load PHP module in httpd.conf LoadModule php5_module libexec/apache2/libphp5.so fixed everything. I can now access localhost. In the confusion I created for myself making changes, I assumed it was in the .conf file, but didn't have the original to revert to or see the issue. Obvious advice - make a backup before you change .conf files.

Now, of course, I can't use PHP, so if anyone has any tips there, that would be awesome. Libphp5.so exists in /libexec/apache2, but I also found Libphp7.so in /usr/local/php5/ (version issue??)

Upvotes: 5

Related Questions