2013-09-21 59 views
0

我有一个OS X Server 10.8 [与服务器应用程序]。我启用了网站服务,并且我添加了作为我的服务器网站根目录的路径/Volumes/dev1/httpOS X服务器忽略虚拟主机

我编辑的文件中/private/etc/apache2/httpd.conf,并添加以下行:Include /Volumes/dev1/http/.virtual-hosts

/Volumes/dev1/http/.virtual-hosts的文件是这样的:

listen 80 
listen 443 
servername "site" 
serveradmin "[email protected]" 
namevirtualhost *:80 
namevirtualhost *:443 

directoryindex .index.php index.html index.php 
options -indexes -multiviews +followsymlinks 

<directory /Volumes/dev1/http> 
    allowoverride all 
</directory> 

<virtualhost *:80 *:443> 
    servername site.com 
    serveralias www.site.com 
    documentroot "/Volumes/dev1/http/com-site" 
    rewriteengine on 
</virtualhost> 

服务器完全忽略了这个文件,即使如果我把在一些随机字符中运行并且运行apachectl -t它表示语法不正确。

我甚至试过在这个文件中只有directoryindex .index.php,它仍然没有效果 - 它返回403 Forbidden,即使认为.index.php存在。

这个确切的配置就像在旧的10.6服务器上的魅力一样。

感谢您花时间思考我的问题!

回答

3

一些谷歌-ING和试错法的答案后:在OS 10.8使用的服务器应用程序时,你需要把include指令在/Library/Server/Web/Config/apache2/httpd_server_app.conf/private/etc/apache2/httpd.conf