403 禁止 - 权限 - VHOSTS
403 Forbidden - Permission - VHOSTS
我无法再访问我的虚拟主机(只有默认的本地主机)。这让我:
Forbidden
You don't have permission to access / on this server.
我已经在我的 httpd.conf 中加载了模块,我在 apache 2.4 上,并且我已经检查了所有权限文件夹 (chmod 755)。
我的 httpd-vhosts.conf 文件:
# Virtual Hosts
#
# Required modules: mod_log_config
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
Listen 80
<VirtualHost *:80>
ServerName localhost
DocumentRoot "/Library/WebServer/Documents"
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/POlo/Sites/polohome"
ServerName polohome
# Set access permission
<Directory "/Users/POlo/Sites/polohome">
DirectoryIndex index.html index.php
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/POlo/Sites/aeglos"
ServerName aeglos
ErrorLog "/private/var/log/apache2/aeglos.local-error_log"
CustomLog "/private/var/log/apache2/aeglos.local-access_log" common
<Directory "/Users/POlo/Sites/aeglos/">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
我发现的唯一一件事是在 httpd.conf 文件中更改 DirectoryIndex 时,它会在不执行的情况下呈现 php 行。并在 httpd-vhosts.conf 文件什么也没做。
感谢您的帮助。
更新:不明白为什么..但是当切换到 PHP 5.6 时它工作正常,在 php 7.0.6 上仍然呈现 403 禁止页面。
(代表OP发表).
升级我的 mac 后,我的 php 切换器无法正常工作,原因是 php7_module 未在 httpd.conf 中调用。
我无法再访问我的虚拟主机(只有默认的本地主机)。这让我:
Forbidden
You don't have permission to access / on this server.
我已经在我的 httpd.conf 中加载了模块,我在 apache 2.4 上,并且我已经检查了所有权限文件夹 (chmod 755)。
我的 httpd-vhosts.conf 文件:
# Virtual Hosts
#
# Required modules: mod_log_config
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
Listen 80
<VirtualHost *:80>
ServerName localhost
DocumentRoot "/Library/WebServer/Documents"
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/POlo/Sites/polohome"
ServerName polohome
# Set access permission
<Directory "/Users/POlo/Sites/polohome">
DirectoryIndex index.html index.php
Require all granted
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/POlo/Sites/aeglos"
ServerName aeglos
ErrorLog "/private/var/log/apache2/aeglos.local-error_log"
CustomLog "/private/var/log/apache2/aeglos.local-access_log" common
<Directory "/Users/POlo/Sites/aeglos/">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
我发现的唯一一件事是在 httpd.conf 文件中更改 DirectoryIndex 时,它会在不执行的情况下呈现 php 行。并在 httpd-vhosts.conf 文件什么也没做。
感谢您的帮助。
更新:不明白为什么..但是当切换到 PHP 5.6 时它工作正常,在 php 7.0.6 上仍然呈现 403 禁止页面。
(代表OP发表).
升级我的 mac 后,我的 php 切换器无法正常工作,原因是 php7_module 未在 httpd.conf 中调用。