Apache虚拟主机目录域映射冲突

时间:2015-11-14 01:26:01

标签: apache

通过冲突我的意思是一个域有效,它会导致/var/www/html并读取主index.php文件,但是导致/var/www/html/website的第二个域会给我一个拒绝根目录的权限" /"所以我想知道它是否将/var/www/html解释为/

还是别的什么?

感谢您的帮助

仅虚拟主机设置端口80

# works

<VirtualHost *:80>
ServerName www.site.us
ServerAlias site.us http://www.site.us
DocumentRoot /var/www/html
# CustomLog /directory log file location not enabled
# ErrorLog /directory log not enabled
</VirtualHost>

# both site2.com and www.site2.com have 404 problem
# The requested URL / was not found on this server.

<VirtualHost *:80>
ServerName www.site2.com
ServerAlias site2.com http://www.site2.com
DocumentRoot /var/www/html/site2
# CustomLog /directory log file location not enabled
# ErrorLog /directory log not enabled
</VirtualHost>

# works fine

<VirtualHost *:80>
ServerName www.site3.com
ServerAlias site3.com http://www.site3.com
DocumentRoot /var/www/html/site3
# CustomLog /directory log file location not enabled
# ErrorLog /directory log not enabled
</VirtualHost>

0 个答案:

没有答案