跳转到内容

Redmine

所需软件:

  • redmine-0.9.6.tar.gz
  • ruby-1.8.7-p302.tar.gz
  • rubygems-1.3.7.zip (ruby安装时需要openssl-devel rpm包)

所需其它插件等可通过rubygems来进行获取和配置,方便安装。 (其它所需如mysql数据库等部分不作介绍)

Terminal window
tar xzvf ruby-1.8.7-p302.tar.gz
cd ruby-1.8.7-p302
./configure --prefix=/usr/local/ruby
make
make install
Terminal window
unzip rubygems-1.3.7.zip
cd rubygems-1.3.7
ruby setup.rb
Terminal window
gem install rails -v=2.3.5
Terminal window
gem install rack -v=1.0.1

需要mysqlmysql-devel包:

Terminal window
gem install mysql

解决No definition for next_result等问题:

Terminal window
gem install ri rdoc
gem install mysql
Terminal window
tar xzvf redmine-0.9.6.tar.gz
cd redmine-0.9.6
mysql

在mysql中执行以下命令:

create database redmine character set utf8;
create user 'redmine'@'localhost' identified by 'my_password';
grant all privileges on redmine.* to 'redmine'@'localhost';
grant all privileges on redmine.* to 'redmine'@'localhost' identified by 'my_password';
exit

配置database.yml

Terminal window
cp config/database.yml.example config/database.yml
vi config/database.yml

database.yml中添加以下内容:

production:
adapter: mysql
database: redmine
host: localhost
username: redmine
password: my_password

生成会话存储和迁移数据库:

Terminal window
rake generate_session_store
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data

如果非root用户,执行以下命令:

Terminal window
mkdir tmp public/plugin_assets
sudo chown -R redmine:redmine files log tmp public/plugin_assets
sudo chmod -R 755 files log tmp public/plugin_assets

启动服务器:

Terminal window
ruby script/server -e production

访问本地3000端口,默认管理员:admin/admin

Redmine与Apache集成时,mod_cgi模式报错,需要使用mod_passenger模式。

Terminal window
gem install passenger
yum install httpd-devel
yum install apr-devel
passenger-install-apache2-module

httpd.conf中添加Passenger的配置:

LoadModule passenger_module modules/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.15
PassengerRuby /usr/local/bin/ruby

httpd.conf中添加虚拟主机:

<VirtualHost *:80>
ServerName 192.168.137.1
ServerAdmin [email protected]
DocumentRoot /usr/local/redmine/redmine-0.9.6/public
ErrorLog logs/redmine_error_log
<Directory "/usr/local/redmine/redmine-0.9.6/public">
Options Indexes ExecCGI FollowSymLinks
Order allow,deny
Allow from all
AllowOverride all
</Directory>
</VirtualHost>
Terminal window
/etc/init.d/httpd restart

插件安装一般过程:

Terminal window
将插件拷贝到vendor/plugins目录下
rake db:migrate_plugins RAILS_ENV=production