CentOS6.4安装redmine

分类栏目:服务器

194

一、前言介绍

     Redmine是用Ruby开发的基于web的项目管理软件,是用ROR框架开发的一套跨平台项目管理系统,据说是源于Basecamp的ror版而来,支持多种数据库,有不少自己独特的功能,例如提供wiki、新闻台等,还可以集成其他版本管理系统和BUG跟踪系统,例如Perforce、SVN、CVS、TD等等。这种 Web 形式的项目管理系统通过“项目(Project)”的形式把成员、任务(问题)、文档、讨论以及各种形式的资源组织在一起,大家参与更新任务、文档等内容来推动项目的进度,同时系统利用时间线索和各种动态的报表形式来自动给成员汇报项目进度.

二、实验环境

     系统:CentOS6.4_X64

     环境:LAMP环境

     ruby:rvm2.2.2

     redmine:2.6.3

     selinux : disabled

三、安装篇

1、安装基本软件环境    

yum -y install libyaml-devel zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel gcc ruby-devel gcc-c++ make postgresql-devel ImageMagick-devel sqlite-devel perl-LDAP mod_perl perl-Digest-SHA

2、安装LAMP环境

yum -y install httpd mysql mysql-server mysql-community-server php php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc php-pecl-apc php-soap 

3、配置数据库

复制代码
mysql> create database redmine character set utf8;Query OK, 1 row affected (0.00 sec)mysql> create user 'redmine'@'localhost' identified by 'redmine';Query OK, 0 rows affected (0.00 sec)mysql> grant all privileges on redmine.* to 'redmine'@'localhost';Query OK, 0 rows affected (0.00 sec)mysql> flush privileges;    Query OK, 0 rows affected (0.00 sec)
复制代码

4、配置防火墙

/sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT/sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT/etc/init.d/iptables save/etc/init.d/iptables restart

5、安装ruby环境

\curl -L https://get.rvm.io | bash
source /etc/profile.d/rvm.shrvm list knownrvm install2.2.2ruby -v

6、安装rubygems,并安装redmine对apache的支持

yum -y install rubygemsgem install passengerpassenger-install-apache2-module

7、安装默认最后根据提示配置httpd

复制代码
vim /etc/httpd/conf.d/passenger.conf  LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.5/buildout/apache2/mod_passenger.so  <IfModule mod_passenger.c>    PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.5    PassengerDefaultRuby /usr/local/rvm/gems/ruby-1.9.3-p551/wrappers/ruby  </IfModule>


//vim /etc/httpd/conf/httpd.conf
  LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.5/buildout/apache2/mod_passenger.so  <IfModule mod_passenger.c>    PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.5    PassengerDefaultRuby /usr/local/rvm/gems/ruby-1.9.3-p551/wrappers/ruby  </IfModule>vim /etc/httpd/conf.d/redmine.conf<VirtualHost *:80>    ServerName 172.17.17.17  #!!! Be sure to point DocumentRoot to 'public'!    DocumentRoot /var/www/html/redmine/public    ErrorLog /opt/redmine_error.log    <Directory /var/www/html/redmine/public>    #<span style="white-space:pre">    #</span>     Options Indexes ExecCGI FollowSymLinks    Order allow,deny    Allow from all    AllowOverride all    Options -MultiViews    </Directory>
</VirtualHost>
复制代码

8、安装redmine

wget http://www.redmine.org/releases/redmine-2.6.3.tar.gztar -zxvf redmine-2.6.3.tar.gzmv redmine-2.6.3 /var/www/html/redmine

9、配置redmine

复制代码
cp -rp /var/www/html/redmine/config/database.yml.example /var/www/html/redmine/config/database.yml[root@shinezone config]# more database.yml# Default setup is given for MySQL with ruby1.9. If you're running Redmine
# with MySQL and ruby1.8, replace the adapter name with `mysql`.# Examples for PostgreSQL, SQLite3 and SQL Server can be found at the end.# Line indentation must be 2 spaces (no tabs).production:  adapter: mysql2  database: redmine  host: localhost  username: redmine  password: "redmine"  encoding: utf8
复制代码

10.安装rails

cd /var/www/html/redminegem install bundlerbundle install

11、初始化redmine数据库表名

[root@shinezone redmine]# RAILS_ENV=production rake db:migrate[root@shinezone redmine]# RAILS_ENV=production rake redmine:load_default_data

12、修改fastcgi

[root@shinezone public]# cp  dispatch.fcgi.example  dispatch.fcgi[root@shinezone public]# cp htaccess.fcgi.example htaccess.fcgi

13、安装mod_fcgi

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpmyum -y install mod_fcgid

14、修改files文件

cd /var/www/html/redmine/confcp configuration.yml.example configuration.yml         attachments_storage_path: /var/www/html/redmine/files

15、启动redmine

[root@shinezone html]# chown -R apache.apache redmine/[root@shinezone html]# chmod -R 755 redmine/[root@shinezone html]# /etc/init.d/httpd restartStopping httpd:                                            [  OK  ]Starting httpd:                                            [  OK  ]

16、访问测试

17、如果访问不了,尝试redmine启动方式进行测试

cd /var/www/html/redmineruby script/rails server webrick -e production