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

时间:2010-11-24 11:29:57

标签: linux apache document-root

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

即,123.21.1.21进入我的网站,123.21.1.21/bugzilla指向/ opt / bugzilla

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

3 个答案:

答案 0 :(得分:2)

我刚刚设置了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>

接着是

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>

答案 1 :(得分:1)

使用Alias

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

答案 2 :(得分:0)

我知道这已得到解答,但这对我来说适用于macosx

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