简体   繁体   中英

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

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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM