我有一个OSXServer10.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禁止,甚至认为.index.php存在。
这种精确的配置在较老的10.6服务器上工作起来就像一种魅力。
谢谢你抽出时间思考我的问题!
发布于 2013-09-21 21:37:20
经过一些google和试用和错误处理之后,答案是:当在OS10.8中使用Server时,您需要将包含指令放在/Library/Server/Web/Config/apache2/httpd_server_app.conf中,而不是在/private/etc/apache2/httpd.conf中
https://serverfault.com/questions/540610
复制相似问题