我在Server中有一个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:38:03
经过一些google-ing和试错方法之后,答案是:当在OS10.8中使用Server时,您需要在/Library/Server/Web/Config/apache2/httpd_server_app.conf 而不是/private/etc/apache2/httpd.conf中放置包含指令
https://stackoverflow.com/questions/18930409
复制相似问题