1. 程式人生 > >Centos 7 使用Apache部署Redmine。

Centos 7 使用Apache部署Redmine。

1. Redmine部署到本機。

   (1)安裝ruby環境。

     source /etc/profile.d/rvm.sh

     rvm list known
     rvm install 2.2

     (2)安裝mariadb

       yum install mariadb mariadb* -y

      (3)安裝Redmine

            下載redmine-3.1.1,解壓,並放入/opt目錄

         cd /opt/redmine-3.1.1/config

         bundle install (可能會出現依賴缺失的錯誤,使用yum安裝依賴即可)

       (4)Apache配置(重點)

        yum -y install httpd

        /bin/systemctl restart  httpd.service

       瀏覽器位址列輸入localhost,應該能看到測試頁面。

       cd    /opt/redmine-3.1.1/public

       cp dispatch.fcgi.example dispatch.fcgi

       cp htaccess.fcgi.example  htaccess.fcgi

       chmod 755 dispatch.fcgi

       cd /etc/httpd/conf.d

        新建redmine.conf,內容如下:

         LoadModule passenger_module /home/richard/.rvm/gems/ruby-2.2.3/gems/passenger-5.0.20/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
  PassengerRoot /home/richard/.rvm/gems/ruby-2.2.3/gems/passenger-5.0.20
  PassengerDefaultRuby /home/richard/.rvm/gems/ruby-2.2.3/wrappers/ruby
</IfModule>

<VirtualHost *:3000>
     ServerName 192.168.3.200
     DocumentRoot /opt/redmine-3.1.1/public
     ErrorLog "/opt/redmine-3.1.1/wwwlogs/error.log"
     CustomLog "/opt/redmine-3.1.1/wwwlogs/access.log" common
<Directory /opt/redmine-3.1.1/public>
     Options FollowSymlinks
     AllowOverride none
     Require all granted
   </Directory>
</VirtualHost>

    vim /etc/httpd/conf/httpd.conf

    新增一行:Listen 192.168.3.200:3000

     /bin/systemctl restart  httpd.service