Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OSX 10 - Apache refusing to work - how to debug or start from scratch

Tags:

php

macos

apache

I've been using Apache to serve my dev sites on my local machine.

I've been using Apache with passenger for my rails work and setting up custom vhosts for my php work.

I did not do the initial set up on my machine. So I'm not exactly sure how it was configured. I was trying to tweak some settings on the weekend and seem to have broken it all.

I think I deleted a default.conf alias file from the root of my apache2 folder.

I'm completely at a loss at how to fix this, so I have a few questions.

How can I start to debug? Where should I look for errors?

How can I just reset to it's initial state? if I do this, could you point me to a tutorial on how to set up php/vhosts dev without having to use mamp.

Help is much appreciated - I've been pulling my hair out for 2 days with this one.

like image 456
Finnnn Avatar asked Dec 27 '22 06:12

Finnnn


1 Answers

Do you start apache via command line (/usr/sbin/apachectl start)? If so, does it print any errors? Can you look into /var/log/apache2/error_log for any errors? (I'm assuming you're using the apache installation that came with Mac OS X, not some custom build one) Apache's main config file resides at /etc/apache2/httpd.conf and references (via lines starting with "Include", at the end of the file) some additional configuration files in /etc/apache2/extra. Can you check if any of those are missing?

edit: Oh sure, thanks :-) I don't know why sudo apachectl -t gave you errors when the non-sudo version did not, though. apachectl start should also do what -t does. Maybe someone else can shed light on that.

like image 115
Simon Avatar answered Jan 11 '23 22:01

Simon