繁体   English   中英

如何从主文件夹中的多个目录运行apache网页?

[英]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/

/ private / etc / apache2 / users / <用户名> .httpd:

<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的
  • URL看起来像: http://localhost/~<username>/<directory in Sites or Remote>/index.html
  • httpd.conf中没有启用/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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM