【发布时间】:2013-09-26 15:31:34
【问题描述】:
我有一个 OS X Server 10.8 [带有服务器应用程序]。我已启用网站服务,并将/Volumes/dev1/http 的路径添加为我的服务器网站的根目录。
我在/private/etc/apache2/httpd.conf 中编辑了文件并添加了以下行:Include /Volumes/dev1/http/.virtual-hosts
/Volumes/dev1/http/.virtual-hosts 的文件类似于:
listen 80
listen 443
servername "site"
serveradmin "mail@myemail.com"
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 服务器上就像一个魅力。
感谢您花时间考虑我的问题!
【问题讨论】:
标签: macos apache apache2 webserver virtualhost