[英]How to run apache webpage from multiple directories in the home folder?
~/Sites/
./subdomain1.site.com/
./cgi-bin/
./subdomain2.site.com/
./cgi-bin/
~/Remote/
./subdomain1.remote.com/
./cgi-bin/
./subdomain2.remote.com/
./cgi-bin/
<Directory ~ "/Users/<username>/Remote/.*">
Options Indexes Includes SymLinksIfOwnerMatch MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory ~ "/Users/<username>/Remote/.*/cgi-bin">
AllowOverride None
Options +ExecCGI
Order allow,deny
Allow from all
</Directory>
## Same thing as above, but using "Sites" instead of "Remote"
<Directory ~ "/Users/<username>/Sites/.*">
Options Indexes Includes SymLinksIfOwnerMatch MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory ~ "/Users/<username>/Sites/.*/cgi-bin">
AllowOverride None
Options +ExecCGI
Order allow,deny
Allow from all
</Directory>
我将Sites复制到Remote并重新启动了apache( sudo apachectl restart
)-同样,尝试停止,然后开始尝试。
index.html
加载的是Sites目录,但不是Remote的 http://localhost/~<username>/<directory in Sites or Remote>/index.html
/apache2/users/<username>.httpd
配置的内容,它似乎仅适用于Sites/
,但不适用于Remote/
在OSX-Mavericks中,默认情况下,httpd.conf包含/extra/httpd-userdir.conf。 这是设置“站点”目录的位置。
在您的设置中,编辑https-userdir.conf并添加UserDir Remote
行。 这应该在您的主文件夹中启用两个目录。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.