简体   繁体   English

对于在Mac OS上运行的apache,/ usr / local / etc vs / etc / apache2之间的区别

[英]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.

相关问题 在Mac OS X上运行没有管理员权限的本地apache实例 - Running a local instance of apache without admin rights on Mac OS X 忽略Docker apache2 / etc / hosts仅适用于localhost - Docker apache2 /etc/hosts ignored works only with localhost 在运行 docker 构建时,它无法读取 /etc/php/7.2/apache2/php.ini:没有这样的文件或目录 - While running docker build it can't read /etc/php/7.2/apache2/php.ini: No such file or directory 在Mac OS X Lion上重写为Apache2中的相对路径(10.7) - Rewrite to relative path in Apache2 on Mac OS X Lion (10.7) phpinfo()在Mac OS-X Capitan apache2服务器上不起作用 - phpinfo() not working on mac OS-X Capitan apache2 server 通过MAC OS X中的终端重新加载Apache2 - Reloading Apache2 via Terminal in MAC OS X 文件/usr/local/apache2/modules/libphp5.so中的PHP和Apache“ php5_module”出现乱码” - PHP and Apache “php5_module' in file /usr/local/apache2/modules/libphp5.so is garbled” docker apache 容器将 /usr/local/apache2/htdocs 作为 DocumentRoot 而不是 /var/www/html - docker apache container serves /usr/local/apache2/htdocs as DocumentRoot instead of /var/www/html Apache指令与Apache模块之间的区别 - Difference between Apache directive vs Apache modules 在Linux上安装PHP:无法将/etc/apache2/modules/libphp5.so加载到服务器中 - Installing PHP on Linux: Cannot load /etc/apache2/modules/libphp5.so into server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM