The difference between /usr/local/etc vs /etc/apache2 for apache running on Mac OS

Viewed 1399

Hi I am very new to both apache and mac. I had set up apache through Homebrew and as far as I understand so far, apache from mac runs on OS level, but apache through Homebrew runs on user level. I think that is why mac apache stays in /etc level directory while Homebrew apache stays in /user/local/etc level.

However, I found out that both httpd.conf files differ from each other. Especially I am experiencing a problem that php doesn't render in a virtual host. I tried to fix the problem, but it seems like every solutions in the internet talks about httpd.conf for mac apache.

I am quite confused of what I am doing right now. It will be great if anyone of you guys can explain me how these apaches work different. Thanks!

1 Answers

Default apache path would be:

/etc/apache2/httpd.conf

homebrew apache path

/usr/local/etc/httpd/httpd.conf

You can check how many apaches are running in your system:

which -a apachectl

Default apache:

/usr/sbin/apachectl

Homebrew:

/usr/local/bin/apachectl

The command below for default apache

sudo apachectl restart

You may use this for the homebrew apache

sudo /usr/local/bin/apachectl restart
Related