How to install Redmine

来源:互联网 发布:宜昌mac 编辑:程序博客网 时间:2024/05/16 09:05

 Test system: CentOS 5.4

1. Download package

Please read http://www.redmine.org/wiki/redmine/RedmineInstall first

Download redmine http://rubyforge.org/frs/?group_id=1850

Download ruby http://www.ruby-lang.org/en/downloads/ http://rubyonrails.org/download

Download rake http://rake.rubyforge.org/

Download rail http://rubyonrails.org/download

Download rubygems http://rubyforge.org/projects/rubygems/

Below install is on CentOS 5.4, mysql version is 5.0.77 (mysql-5.0.77-3.el5)

 

2.   Install Ruby

#tar -xvf ruby-1.8.7-p174.tar.gz

#cd ruby-1.8.7-p174

#./configure

#make

#make install

Check version

#ruby -v

#cd ..

 

3.   Install rubygems

#tar -xvf rubygems-1.3.6.tar

#cd rubygems-1.3.6

#ruby setup.rb

#cd ..

 

4.   Install rake

#tar -xvf rake-0.8.7.tar

#cd rake-0.8.7

#ruby install.rb

Check version

#ruby -V

#cd ..

 

5.   Run redmine

#service mysqld start

If you can’t user above command to start mysql, you can find /etc/init.d/mysqld and use “/etc/init.d/mysqld start” to start mysql

#tar -xvf redmine-0.8.7.tar.tar

#cd redmine-0.8.7

#mysql

mysql>create database redmine;

mysql>create user 'redmine'@'localhost' identified by 'redmine';

mysql>grant all privileges on redmine.* to 'redmine'@'localhost';

#cp config/database.yml.example config/database.yml

#vim config/database.yml

production:

  adapter: mysql

  database: redmine

  host: 127.0.0.1

  username: redmine

  password: redmine

  encoding: utf8

#rake config/initializers/session_store.rb

#rake db:migrate RAILS_ENV=”production”

Error1: syntax error on line 14, col 2: encoding: utf8

Resolution: modify config/database.yml, after password: it must has a space between ":" and "redmine"

Error2: No such file or directory - /tmp/mysql.sock

Resolution: modify config/database.yml "host: Localhost" to "host: 127.0.0.1"

#ruby script/server -e production

Then you can see below information

==> Booting WEBrick

==> Rails 2.1.2 application started on http://0.0.0.0:3000

==> Ctrl-c to shutdown server; call with --help for options

...

Input http://127.0.0.1:3000 to see redmine page, create user and project. You can see out put information in terminal

 

6.   Add a script

Create a shell script for redmine useing

#vim redmine.sh

#!/bin/bash

cd /your_path/redmine

ruby script/server -e production

 

#chmod 755 redmine.sh

#vim /etc/init.d/redmine

#!/bin/sh

# redmine

 

case "$1" in

start)

/your_path/redmine.sh

;;

stop)

killall ruby

;;

*)

echo "Usage: $0 { start | stop }"

;;

esac

exit 0

 

If you want it run when system start, you can add “/etc/init.d/redmine &” in “/etc/rc.d/rc.local”. Also need run mysql when using redmine

 

7.   Useful link

http://www.javaeye.com/topic/611349

http://hi.baidu.com/demon119/blog/item/a73bd60ba4b1201394ca6b78.html

http://blog.csdn.net/helen_shw/archive/2010/01/26/5259188.aspx

原创粉丝点击