本文依据:http://www.linuxidc.com/Linux/2015-03/115545.htm,原文有一些坑,我做了一些调整。
- 说明:redmine是一个项目管理平台,适合部门内部问题的处理。多的不赘述了,因为既然你要组建redmine,肯定知道这个是干什么的。
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 mysql mysql-server mysql-devel httpd --setopt=protected_multilib=false
-
- 配置mysql数据库:
-
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)
-
- 安装php环境
-
yum -y install php php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc php-pecl-apc php-soap
-
- 安装ruby:
- \curl -L https://get.rvm.io | bash
- source /etc/profile.d/rvm.sh
- rvm install 2.2.5
- 安装rubygems
- yum -y install rubygems
- 安装redmine的apache支持
- gem install passenger
- passenger-install-apache2-module 在安装这个模块的时候,会提示你如何增加apahce的配置文件,还有最后语言的设置,大概效果如下
-
vim /etc/httpd/conf.d/passenger.conf LoadModule passenger_module /usr/local/rvm/gems/ruby-2.2.5/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /usr/local/rvm/gems/ruby-2.2.5/gems/passenger-5.0.30 PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.2.5/wrappers/ruby </IfModule> ps:将提示内容直接编写成一个新文件,也可以直接粘贴在:httpd.conf中
- 安装redmine
- 版本:redmine-3.3.0.tar.gz (地址:http://www.redmine.org/projects/redmine/wiki/Download)
-
tar xf redmine-3.3.0.tar.gz && mkdir /data && mv redmine-3.3.0 /data
- 修改apache配置文件:
-
vim /etc/httpd/conf.d/redmine.conf <VirtualHost *:80> DocumentRoot /data/redmine-3.3.0/public ErrorLog logs/redmine_error_log <Directory /data/redmine-3.3.0/public> Options Indexes ExecCGI FollowSymLinks Order allow,deny Allow from all AllowOverride all </Directory> </VirtualHost>
- redmine的配置:
-
cd /data/redmine-3.3.0/config cp database.yml.example database.yml && cp configuration.yml.example configuration.yml vim database.yml #数据库信息,之前设定的。 production: adapter: mysql2 #官网有说明,具体什么版本选择什么样的数据库(http://www.redmine.org/projects/redmine/wiki/RedmineInstall) database: redmine host: localhost username: redmine password: "redmine" encoding: utf8
- 安装rails:
-
cd /data/redmine-3.3.0 gem install bundler bundle install #过程比较长,慢慢等 ps:我的这两步操作都很顺。
- 初始化数据库:
- rake generate_secret_token
- RAILS_ENV=production rake db:migrate
- RAILS_ENV=production rake redmine:load_default_data
- 配置fastcgi
-
cd /data/redmine-3.3.0/public && cp htaccess.fcgi.example htaccess.fcgi && cp dispatch.fcgi.example dispatch.fcgi rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm yum -y install mod_fcgid
-
- 设置权限:
-
chown apache:apache /data/redmine-3.3.0 -R chmod 755 apache:apache /data/redmine-3.3.0 -R 虽然不合理,但是一般都是内网访问,也无需纠结。
-
- 重启apache服务,访问web
- /etc/init.d/httpd restart
- web访问: ip地址
- 登录: admin
- 密码: admin
- 最终效果:
ps: 具体的使用不再赘述,不是一个很复杂的平台。
时间: 2024-10-13 14:20:00