[英]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. 嗨,我对apache和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.
我已经通过Homebrew设置了apache,据我所知,到目前为止,mac的apache在操作系统级别上运行,但是通过Homebrew的apache在用户级别运行。 I think that is why mac apache stays in /etc level directory while Homebrew apache stays in /user/local/etc level.
我认为这就是为什么mac apache保留在/ etc级目录中而Homebrew apache保持在/ user / local / etc级别的原因。
However, I found out that both httpd.conf files differ from each other. 但是,我发现两个httpd.conf文件彼此不同。 Especially I am experiencing a problem that php doesn't render in a virtual host.
特别是我遇到的问题是php无法在虚拟主机中呈现。 I tried to fix the problem, but it seems like every solutions in the internet talks about httpd.conf for mac apache.
我试图解决这个问题,但似乎互联网上的每个解决方案都谈论了关于mac apache的httpd.conf。
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.
如果你们中的任何人能够解释我这些apach的工作方式有何不同,那将会很棒。 Thanks!
谢谢!
Default apache path would be: 默认的apache路径是:
/etc/apache2/httpd.conf
homebrew apache path 自制的apache路径
/usr/local/etc/httpd/httpd.conf
You can check how many apaches are running in your system: 您可以检查系统中正在运行的apach数量:
which -a apachectl
Default apache: 默认apache:
/usr/sbin/apachectl
Homebrew: 家酿:
/usr/local/bin/apachectl
The command below for default apache 以下命令用于默认的apache
sudo apachectl restart
You may use this for the homebrew apache 你可以将它用于自制的apache
sudo /usr/local/bin/apachectl restart
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.