redmine + apache + mod_fcgid

來源:互聯網
上載者:User

標籤:

 

redmine預設是用webrick啟動的,這種方法不適合生產環境,最好部署在apache下,本文介紹如何通過mod_fcgid啟動。

首先要有一個能夠啟動的redmine,可以通過我之前的博文查看: http://www.cnblogs.com/wzy5223/p/5335549.html

本例redmine的安裝位置:/opt/redmine-3.2.1

 

一. 下載資源

wget http://mirrors.hust.edu.cn/apache//httpd/httpd-2.2.31.tar.gzwget http://mirrors.hust.edu.cn/apache//httpd/mod_fcgid/mod_fcgid-2.3.9.tar.gz

二. 編譯apache

tar xzvf httpd-2.2.31.tar.gzcd httpd-2.2.31./configure --prefix=/opt/httpd-2.2.31 --enable-rewritemakemake install

三. 編譯mod_fcgid

tar xzvf mod_fcgid-2.3.9.tar.gzcd mod_fcgid-2.3.9APXS=/opt/httpd-2.2.31/bin/apxs ./configure.apxsmakemake install

四. 配置redmine到apache

cd /opt/redmine-3.2.1/publiccp dispatch.fcgi.example dispatch.fcgicp htaccess.fcgi.example .htaccesscd cd /opt/httpd-2.2.31/confvi httpd.conf

找到下面的內容

DocumentRoot "/opt/httpd-2.2.31/htdocs"## Each directory to which Apache has access can be configured with respect# to which services and features are allowed and/or disabled in that# directory (and its subdirectories).## First, we configure the "default" to be a very restrictive set of# features.#<Directory />  Options FollowSymLinks  AllowOverride None  Order deny,allow  Deny from all</Directory>

修改為

DocumentRoot "/opt/redmine-3.2.1/public"## Each directory to which Apache has access can be configured with respect# to which services and features are allowed and/or disabled in that# directory (and its subdirectories).## First, we configure the "default" to be a very restrictive set of# features.#<Directory />    Options FollowSymLinks    AllowOverride None    Order deny,allow    Allow from all</Directory>

並修改監聽連接埠為3000

Listen 3000

五. 安裝mod_passenger

gem install passenger
yum install libcurl-devel
passenger-install-apache2-module --apxs2-path /opt/httpd-2.2.31/bin/apxs --apr-config-path /opt/httpd-2.2.31/bin/apr-1-config --languages ruby

上面的命令最後會有一段字元需要添加到httpd.conf,例如下面

   LoadModule passenger_module /home/wzy/.rvm/gems/ruby-2.2.4/gems/passenger-5.0.26/buildout/apache2/mod_passenger.so   <IfModule mod_passenger.c>     PassengerRoot /home/wzy/.rvm/gems/ruby-2.2.4/gems/passenger-5.0.26     PassengerDefaultRuby /home/wzy/.rvm/gems/ruby-2.2.4/wrappers/ruby   </IfModule>

六. 啟動apache,測試是否能訪問 http://<IP>:3000

/opt/httpd-2.2.31/bin/apachectl start

如果能成功訪問就大功告成了,最後可以將apache添加到服務,就可以隨系統重啟了

redmine + apache + mod_fcgid

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.