通过 http://ip:3000/ 这样访问 redmine 貌似很慢 , 要把 apache 与redmine 整合效果就好很多了。
不过 Apache 上面沒有 mod_rails ,我们需要安装后才能进行;方法也很简单,由于我们之前安装有 Ruby ,那麼安裝方式就是:
- #gem i passenger
- #passenger-install-apache2-module
下边就是从官方文档找到的方法。英文好的朋友就可以直接看下边的文章了。
官方文档 URL : http://www.redmine.org/wiki/1/HowTo_configure_Apache_to_run_Redmine
1 、 首先要让 Apache 支持 cgi
2 、 配置 redmine 源码目录下的 public/dispath.cgi 脚本
- #vi /etc/httpd/conf/httpd.conf
- Options Indexes FollowSymLinks ( 找到这一行,删除“ Indexes ”,并添加“ Includes ”、“ ExecCGI ” )
- Options Includes ExecCGI FollowSymLinks ( 允许服务器执行 CGI 及 SSI)
- #AddHandler cgi-script .cgi ( 找到这一行,去掉行首的“ # ”,并在行尾添加“ .pl ” )
- AddHandler cgi-script .cgi .pl ( 允许扩展名为 .pl 的 CGI 脚本运行 )
3 、 编辑 Apache 主配置文件
- cd /var/www/redmine
- cp public/dispatch.cgi.example public/dispatch.cgi
- #vi /etc/httpd/conf/httpd.conf ( 这里假定 redmine 源码的目录放在 /var/html/redmine 下 )
- <VirtualHost*:80>
- ServerName redmine.xxxxxx.com
- ServerAdmin webmaster@xxxxxx.com
- DocumentRoot /var/html/redmine/public/ 你安装的 redmine 下的 public 目录
- ErrorLog logs/redmine_error_log
- <Directory"/var/html/redmine/public/">
- Options Indexes ExecCGI FollowSymLinks
- Order allow,deny
- Allow from all
- AllowOverride all
- </Directory>
- </VirtualHost>