Redmine
安装软件准备
Section titled “安装软件准备”所需软件:
redmine-0.9.6.tar.gzruby-1.8.7-p302.tar.gzrubygems-1.3.7.zip(ruby安装时需要openssl-develrpm包)
所需其它插件等可通过rubygems来进行获取和配置,方便安装。
(其它所需如mysql数据库等部分不作介绍)
1. 安装ruby
Section titled “1. 安装ruby”tar xzvf ruby-1.8.7-p302.tar.gzcd ruby-1.8.7-p302./configure --prefix=/usr/local/rubymakemake install2. 安装rubygems
Section titled “2. 安装rubygems”unzip rubygems-1.3.7.zipcd rubygems-1.3.7ruby setup.rb3. 安装rails
Section titled “3. 安装rails”gem install rails -v=2.3.54. 安装rack
Section titled “4. 安装rack”gem install rack -v=1.0.15. 安装mysql
Section titled “5. 安装mysql”需要mysql和mysql-devel包:
gem install mysql解决No definition for next_result等问题:
gem install ri rdocgem install mysql6. 安装redmine
Section titled “6. 安装redmine”tar xzvf redmine-0.9.6.tar.gzcd redmine-0.9.6mysql在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:
cp config/database.yml.example config/database.ymlvi config/database.yml在database.yml中添加以下内容:
production: adapter: mysql database: redmine host: localhost username: redmine password: my_password生成会话存储和迁移数据库:
rake generate_session_storeRAILS_ENV=production rake db:migrateRAILS_ENV=production rake redmine:load_default_data如果非root用户,执行以下命令:
mkdir tmp public/plugin_assetssudo chown -R redmine:redmine files log tmp public/plugin_assetssudo chmod -R 755 files log tmp public/plugin_assets启动服务器:
ruby script/server -e production访问本地3000端口,默认管理员:admin/admin
Apache集成
Section titled “Apache集成”Redmine与Apache集成时,mod_cgi模式报错,需要使用mod_passenger模式。
安装Passenger
Section titled “安装Passenger”gem install passengeryum install httpd-develyum install apr-develpassenger-install-apache2-module配置httpd.conf
Section titled “配置httpd.conf”在httpd.conf中添加Passenger的配置:
LoadModule passenger_module modules/mod_passenger.soPassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-2.2.15PassengerRuby /usr/local/bin/ruby添加虚拟主机
Section titled “添加虚拟主机”在httpd.conf中添加虚拟主机:
<VirtualHost *:80> ServerName 192.168.137.1 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>重启Apache
Section titled “重启Apache”/etc/init.d/httpd restart插件安装一般过程:
将插件拷贝到vendor/plugins目录下rake db:migrate_plugins RAILS_ENV=production