Apache2上的乘客 – 如何使站点显示在根目录上

我是新来的apache2和乘客设置rails应用程序,并遵循如何获得redmine(rails应用程序)设置的教程( http://xdissent.com/2010/05/04/github-clone-with- redmine / )。

这一切都很好,但访问您需要去/ redmine目录的应用程序。 我已经把它设置为redmine.local / redmine。 如果我可以只是redmine.local,那将是非常好的。

我浏览了一下我设置的apache / mongrel / passenger部分的文件,并拿出了目录的引用,但是从未如此简单。

我将不胜感激任何帮助,或链接到更多信息的初学者,我可以学习。

谢谢你的帮助! 亚当


– – 更新 – –

一些额外的细节,我有以下的文件,作为服务器的设置的一部分,我做了编辑:

/etc/apache2/conf.d/redmine

Include /opt/redmine/apps/redmine/conf/redmine.conf 

/opt/redmine/apps/redmine/conf/redmine.conf

  ProxyPass /redmine balancer://redminecluster ProxyPassReverse /redmine balancer://redminecluster <Proxy balancer://redminecluster> BalancerMember http://127.0.0.1:3001/redmine BalancerMember http://127.0.0.1:3002/redmine Order deny,allow Allow from all </Proxy> 

/opt/redmine/apps/redmine/config/mongrel_cluster.yml

  --- prefix: /redmine log_file: log/mongrel.log port: "3001" environment: production pid_file: tmp/pids/mongrel.pid servers: 2 

在/ etc / apache2的/网站可用/默认

  <VirtualHost *:80> ServerAdmin webmaster@localhost <Directory /var/www/> 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 /var/www/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 /var/www/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> DocumentRoot /var/www </VirtualHost> 

我无法find一个引用当前目录/ redmine作为路由的文件,因此不确定服务器是否首先find它 – 除非它是conf.d的东西。

UPDATE

  1. 编辑redmine.conf文件到下面的内容:

     <VirtualHost *:80> ServerName redmine.local ErrorLog logs/redmine_error_log RewriteEngine On RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f RewriteRule ^/(.*)$ balancer://redminecluster%{REQUEST_URI} [P,QSA,L] <Proxy balancer://redminecluster> BalancerMember http://127.0.0.1:3001 BalancerMember http://127.0.0.1:3002 </Proxy> </VirtualHost> 
  2. mongrel_cluster.yml删除prefix选项。

  3. 重新启动Apache并重试。