我是 apache2 和 Passenger 的新手,需要设置 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>
我找不到引用当前目录 /redmine 作为路由的文件,因此不确定服务器是否首先找到它 - 除非它是 conf.d 的东西。
答案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>
prefix
从 中删除选项mongrel_cluster.yml
。重新启动 Apache 并重试。