您好我在配置虚拟主机的地方有一个apache2:
<VirtualHost *:80>
ServerAdmin webmaster@mysite.com
DocumentRoot /storage/sites/mysite.com/www
DirectoryIndex index.php index.html index.htm
ServerName mysite.com
ServerAlias www.mysite.com
ErrorLog ${APACHE_LOG_DIR}/mysite_error.log
CustomLog ${APACHE_LOG_DIR}/mysite_access.log combined
<Directory /storage/sites/mysite.com/www>
DirectoryIndex index.php
AllowOverride All
# Apache 2.4
Require all granted
</Directory>
我希望如果有人使用ipaddress到达我的网站,他们将被重定向到该虚拟主机。 所以我试着以这种方式配置000-default.com:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /storage/sites/mysite.com/www
<Directory />
Options FollowSymLinks
AllowOverride all
</Directory>
<Directory /storage/sites/mysite.com/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
但如果我尝试通过IP加法器访问该网站,则会显示403 Forbidden。
这是error.log:
AH01630: client denied by server configuration: /storage/sites/mysite.com/www/
你能帮助我吗?