取消注释“ include /private/etc/apache2/extra/httpd-vhosts.conf”后禁止403访问

时间:2018-11-24 16:58:36

标签: apache localhost

这个问题我已经被问过很多次了,但是我似乎无法将答案与我的特定问题联系起来。我正在使用以下设置在Mac上创建本地服务器:

Apache / 2.4.34(Unix) PHP 7.1.19 MySQL的8.0.13版 MacOS 10.14.1

httpd-vhosts.conf:

<VirtualHost 127.0.0.2:80>
    ServerAdmin webmaster@site-dev.de
    DocumentRoot "/Users/name/Sites/site"
    ServerName site-dev.de
    ErrorLog "/private/var/log/apache2/site-dev.de-error_log"
    CustomLog "/private/var/log/apache2/site-dev.de-access_log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "/usr/docs/dummy-host.example.com"
    ServerName dummy-host.example.com
    ServerAlias www.dummy-host.example.com
    ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log"
    CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "/usr/docs/dummy-host2.example.com"
    ServerName dummy-host2.example.com
    ErrorLog "/private/var/log/apache2/dummy-host2.example.com-error_log"
    CustomLog "/private/var/log/apache2/dummy-host2.example.com-access_log" common
</VirtualHost>

主机:

127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
127.0.0.2       site-dev.de

当我现在取消注释/ etc / apache2中的“ include /private/etc/apache2/extra/httpd-vhosts.conf”时,我得到以下信息:

  • 本地主机:禁止
  • site-dev.de:花了太长时间做出回应

我不知道我在想什么?

注释掉httpd-vhosts.conf使我可以再次访问localhost,但是我当然不能使用它。 背景是我想在本地运行WordPress网站。

0 个答案:

没有答案