Linux httpd conf 文件的多个文档根目录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4266257/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 00:06:05  来源:igfitidea点击:

multiple document root for httpd conf file

linuxapachedocument-root

提问by Rajeev

In the following http-conf file how to add on more entry to add bugzilla

在以下 http-conf 文件中如何添加更多条目以添加 bugzilla

i.e, 123.21.1.21 goes to my website and 123.21.1.21/bugzilla is pointed to /opt/bugzilla

即, 123.21.1.21 转到我的网站, 123.21.1.21/bugzilla 指向 /opt/bugzilla

     <VirtualHost *:80>
     DocumentRoot /var/www/html/web
     ServerName Domainspace
     </VirtualHost>
     <Location "/">
     </Location>

采纳答案by Doug Chamberlain

I just set bugzilla up the other day, similar scenario. Here is my httpd.conf

前几天我刚刚设置了 bugzilla,类似的场景。这是我的 httpd.conf

NameVirtualHost xxx.xxx.xxx.local

<VirtualHost  xxx.xxx.xxx.local>
  ServerName  xxx.xxx.xxx.local
  DocumentRoot "C:/Apache2.2/htdocs"
</VirtualHost>

<VirtualHost  xxx.xxx.xxx.local>
  ServerName  xxx.xxx.xxx.local
  DocumentRoot "C:/bugzilla"
</VirtualHost>

followed by

其次是

Alias /bugzilla "C:\bugzilla"
<Directory "C:\bugzilla">
AddHandler cgi-script .cgi
Options +Indexes +ExecCGI
DirectoryIndex index.cgi
AllowOverride Limit FileInfo Indexes
Order allow,deny
Allow from all
</Directory>

回答by Pekka

Use Alias.

使用Alias.

<VirtualHost *:80>
 DocumentRoot /var/www/html/web
 ServerName Domainspace
 Alias /bugzilla /opt/bugzilla
 </VirtualHost>

回答by visualex

I know this is answered but this worked for me on macosx

我知道这得到了回答,但这在 macosx 上对我有用

Alias /otherwork "/Volumes/anothervolume/otherwork"
<Directory "/Volumes/anothervolume/otherwork">
    Options Indexes FollowSymLinks ExecCGI Includes
    AllowOverride All
    Require all granted
    #more options here
</Directory>