redmine部署筆記

相關的安裝手冊
http://www.redmine.org/projects/redmine/wiki/RedmineInstall
http://www.redmine.org/projects/redmine/wiki/HowTo_install_Redmine_on_CentOS_5#Create-the-Gemfile-and-register-these-gems-in-it
http://bitnami.org/stack/redmine  \\一鍵安裝包

install Redmine on CentOS 5

Assumptions

yum -y --enablerepo=remi install http httpd-devel.x86_64 mysql.x86_64 mysql-server.x86_64 mysql-devel.x86_64 mysql-libs mysqlclient15.x86_64
service mysqld restart
service httpd restart
<<<<<<創建相關數據庫>>>>>>>>
mysql> create database redmine character set utf8;
mysql> grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'my_password';
mysql> flush privileges;

Steps to take

Get Ruby

yum -y erase ruby
ftp ftp.ruby-lang.org
cd /pub/ruby
get ruby-1.8.7-p330.tar.bz2
<<<<<<<<<解壓後,進入目錄>>>>>>>>
./configure
make
make install

Get Gems 1.4 (does not work with Gems 1.5)

<<<<<下載地址>>>>>>>>>>>>
http://rubyforge.org/frs/?group_id=126
tar zxvf rubygems-1.x.tgz rubygems-1.x
cd rubygems-1.x
ruby setup.rb
gem -v
which gem
cd ..

Install Passenger

gem install passenger
passenger-install-apache2-module

執行"passenger-install-apache2-module" 後,記錄如下內容



Restart Apache

Download Redmine && Copy the folder to its HTTP document root folder

wget http://rubyforge.org/frs/download.php/73692/redmine-1.x.tar.gz  # GET LATEST VERSION ON RUBYFORGE
tar zxvf redmine-1.x.tar.gz redmine-1.x
cp -a redmine-1.1/ /var/www/redmine

 Configure Apache to host the documents

 添加文件,內容如下
 cat /etc/httpd/conf.d/redmine_vir.conf

  1. LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.2/ext/apache2/mod_passenger.so
     
  2. PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.2
     
  3. PassengerRuby /usr/local/bin/ruby
  4.  
  5. NameVirtualHost *:80  
  6.  
  7. <VirtualHost *:80>  
  8.       ServerName 192.168.1.2  
  9.       DocumentRoot /var/www/redmine/public     
  10.       <Directory /var/www/redmine/public>  
  11.          AllowOverride all                
  12.          Options -MultiViews             
  13.       </Directory>  
  14. </VirtualHost> 

 Install Bundler

gem install bundler

 http://gembundler.com/  \\參考研究

Create the Gemfile and register these gems in it

 bundle init

vim Gemfile

  1. # A sample Gemfile  
  2. source "http://rubygems.org" 
  3.  
  4. # gem "rails" 
  5. gem "rails","2.3.5" 
  6. gem "rake""0.8.3" 
  7. gem "rack""1.0.1" 
  8. gem "i18n""0.4.2" 
  9. gem "rubytree""0.5.2", :require => "tree" 
  10. gem "RedCloth""~>4.2.3", :require => "redcloth"   
  11. gem "mysql"   
  12. gem "coderay""~>0.9.7"  

 bundle install

Configure database.yml (rename database.yml.example)

Set the production environment (optional)

Uncomment the following line:

  1. #cd /var/www/redmine  
  2. #vim config/environment.rb   
  3. ENV['RAILS_ENV'] ||= 'production' 

Generate the session store

 RAILS_ENV=production bundle exec rake generate_session_store

Migrate the database models

 RAILS_ENV=production bundle exec rake db:migrate

Load default data (optional)

 RAILS_ENV=production bundle exec rake redmine:load_default_data

Rename dispatch CGI files

 mv dispatch.cgi.example dispatch.cgi
 mv dispatch.fcgi.example dispatch.fcgi
 mv dispatch.rb.example dispatch.rb

Edit .htaccess file for CGI dispatch configuration

 mv htaccess.fcgi.example .htaccess

Chown and Chmod files for read/write access for the Apache user

 chown -R apache:apache /var/www/redmine
 chmod -R 755  /var/www/redmine

Redmine should be fully installed now and fully usable

Enjoy!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章