我有一个debian lenny服务器,安装了使用apache的trac(bug跟踪系统),我想添加另一个叫做rt(请求跟踪器)的工具。 得到了一切工作,除了我不能同时加载它们。 任何我在虚拟主机上尝试的东西都只会成为其中一项工作。
这个适用于我的rt虚拟主机:
<VirtualHost *:80> ServerName todasana.fondoavila.com DocumentRoot /opt/rt3/share/html PerlRequire "/opt/rt3/bin/webmux.pl" <Location /rt> AddDefaultCharset UTF-8 SetHandler perl-script PerlResponseHandler RT::Mason </Location> </VirtualHost>
这是我有Trac安装的默认虚拟主机
<VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /var/www/ <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory>
# Rewrite ./trac to ./trac/ RewriteEngine on RewriteRule ^(.*)\/trac$ $1/ [NC] <Location /trac/> SetHandler mod_python PythonHandler trac.web.modpython_frontend PythonInterpreter main PythonOption TracEnvParentDir /var/trac/env PythonOption TracUriRoot /trac SetEnv PYTHON_EGG_CACHE /tmp </Location> ### TRAC Login : http://server/trac/*/login <LocationMatch ^(/trac/[^/]+)?/login> AuthType Basic AuthName "TRAC Login" AuthUserFile /etc/apache2/passwd-trac Require valid-user </LocationMatch> ### SVN repository : http://server/svn <Location /svn> DAV svn SVNParentPath /var/svn-repos/catwizard3 SVNListParentPath on AuthType Basic AuthName "SVN Repository" AuthUserFile /etc/apache2/passwd-trac Require valid-user </Location>
任何解决scheme将不胜感激! 谢谢!
#order matters #DNS or your hosts file must be set correctly <VirtualHost *:80> ServerName trac.fondoavila.com #all trac config here </VirtualHost> <VirtualHost *:80> ServerName todasana.fondoavila.com #all rt config here </VirtualHost>
使用这个设置,如果你转到todasana.fondoavila.com
rt的东西将被返回。 如果你去trac.fondavila.com
(或另一个其他主机名或IP指向这个盒子),你会得到trac的东西。 ServerName
是决定请求如何被服务的东西。
另外, VirtualHost
以外的任何部分都将被应用,如果没有被覆盖,所以确保你没有任何重写规则或其他任何可能会搞砸的东西。