Macos OSX服务器忽略虚拟主机
我有一个OSX服务器10.8[带有服务器应用程序]。我已经启用了网站服务,并且添加了Macos OSX服务器忽略虚拟主机,macos,apache,apache2,webserver,virtualhost,Macos,Apache,Apache2,Webserver,Virtualhost,我有一个OSX服务器10.8[带有服务器应用程序]。我已经启用了网站服务,并且添加了/Volumes/dev1/http的路径作为我的服务器网站的根目录 我在/private/etc/apache2/httpd.conf中编辑了该文件,并添加了以下行:Include/Volumes/dev1/http/.virtualhosts 位于/Volumes/dev1/http/.virtualhosts的文件类似于: listen 80 listen 443 servername "site" ser
/Volumes/dev1/http
的路径作为我的服务器网站的根目录
我在/private/etc/apache2/httpd.conf
中编辑了该文件,并添加了以下行:Include/Volumes/dev1/http/.virtualhosts
位于/Volumes/dev1/http/.virtualhosts
的文件类似于:
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>
听80
听我说
服务器名“站点”
服务器管理员“mail@myemail.com"
名称虚拟主机*:80
名称虚拟主机*:443
index.index.php index.html index.php
选项-索引-多视图+followsymlinks
允许超越所有
服务器名网站
serveralias www.site.com
documentroot“/卷/dev1/http/com站点”
重新启动发动机
服务器完全忽略这个文件,即使我输入一些随机字符并运行apachectl-t
它会说语法不正确
我甚至尝试在这个文件中只包含directoryindex.index.php
,但仍然没有效果-它返回403禁止,即使存在.index.php
这种精确的配置就像旧版10.6服务器上的符咒
谢谢你花时间考虑我的问题 经过一些谷歌搜索和试错方法后,答案是:当在OS 10.8中使用服务器应用程序时,在一些谷歌搜索和试错方法之后,您需要将include指令放入
/Library/Server/Web/Config/apache2/httpd_Server_App.conf
而不是/private/etc/apache2/httpd.conf中答案是:在OS 10.8中使用服务器应用程序时,需要将include指令放入/Library/Server/Web/Config/apache2/httpd_Server\u App.conf
而不是/private/etc/apache2/httpd.conf