我有一个OS X Server 10.8 [与服务器应用程序]。我启用了网站服务,并且我添加了作为我的服务器网站根目录的路径/Volumes/dev1/http
。OS 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服务器上的魅力一样。
感谢您花时间思考我的问题!