Centos6.5+Redmine

花了两天时间,基于centos6.5操作系统,搭建了redmine环境,在此地记录下过程中遭受的题材以及搭建流程。

centos6.5;

redmine2.5.0;

Ruby1.9.3;

 

step 1:安装相关软件条件倚重

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

step 2:安装apache和mysql

yum -y install httpd mysql mysql-server

step 3:将apache和mysql配置为开机自启动,并在当下起动apache和mysql,以便做多余的配置

chkconfig httpd on
chkconfig mysqld on

service httpd start
service mysqld start

step 4:配置mysql 账号密码音信,使用mysql_secure_installation来配置,也是一个大概的交互式配置工具

Because we not have a password for the root account so you press Enter to skip.
Enter current password for root (enter for none):      
#输入当前mysql的root密码,因为yum套件关系,root密码为空,直接回车即可
Select Yes to set the password for the MySQL root account.  
#是否设置新的mysql root密码,选是
Set root password? [Y/n] y
Enter and confirm your password, remove the anonymous user, select Yes
Remove anonymous users? [Y/n] y   
#是否移除匿名用户,安全起见,选是
Allow remote login to MySQL as root account, select No.
Disallow root login remotely? [Y/n] n 
#是否关闭root远程登录,看你如何选择了,官网说否,如果不是外网服务器的话,开放也无所谓。
Delete the test database, select Yes
Remove test database and access to it? [Y/n] y  
#移除测试数据库
Reload privilege tables, select Yes  
#刷新权限配置信息
Reload privilege tables now? [Y/n] y

  

step 5: 关闭selinux

vi /etc/selinux/config
SELINUX=disabled

编排保存退出后,输入以下命令,不重启系统关闭selinux

setenforce 0

注:

setenforce 1 设置SELinux 成为enforcing模式

setenforce 0 设置SELinux 成为permissive模式,即关闭selinux

step 6 :关闭iptables

service iptables stop

chkconfig iptables off

因为不是外网服务器用不到iptables做安全过滤。

step 7:安装php环境

因为redmine是ruby开发,安装php和phpmyadmin重倘使为了方便管理mysql数据库

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

step 8:安装ruby环境

\curl -L https://get.rvm.io | bash

运作成功会生成一个文本,然后运行以下命令

source /etc/profile.d/rvm.sh
rvm list known

2.6本子需要ruby 匡助的版本,在这我们挑选1.9.3 稳定版 

rvm install 1.9.3

注:那多少个ruby版本很考究的,近来安装官网文档,安装redmine
2.5X的都得以用1.9.3

安装完成后检查ruby版本

ruby -v

回去展现:ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]
,表达安装成功。

step 9:安装rubygems

yum -y install rubygems

注:rubygems是Ruby’s packages management program 包管理程序,相当于yum
或者apt-get,所有ruby的东西由它来保(an)护(zhuang)

step 10:安装Passenger

gem install passenger

passenger-install-apache2-module

注:

The full name of the Passenger is Phusion Passenger, known as mod_rails
or mod_rack, it is a web application intergrate with Apache and it can
operate as a standalone web server support for the Ruby On Rails
applications.总的来说就是ruby和apache结合的代谢物,redmine的apache帮忙,这样可以透过apache访问.

 

上述安装完成后会提醒:

LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.28/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-5.0.28
PassengerDefaultRuby /usr/local/rvm/gems/ruby-1.9.3-p551/wrappers/ruby
</IfModule>

只顾是设置到位的升迁,复制出来然后接纳,将复制的内容保留为一个新的apache配置文件

vi /etc/httpd/conf.d/passenger.conf

粘贴内容后保存退出,重启apache

service httpd restart

step 11: 创建redmine数据库

mysql -u root -p
create database redmine_db character set utf8 ;    #创建数据库
create user 'admin'@'localhost' identified by 'admin'; #创建用户
grant all privileges on redmine_db.* to 'admin'@'localhost';  #授权
quit ;

step 12:安装redmine

wget http://www.redmine.org/releases/redmine-2.5.0.tar.gz 
#下载最新版本,只要是2.5X范围即可
tar xvfz redmine-2.5.0.tar.gz
mv redmine-2.5.0 redmine
rm -rf redmine-2.5.0.tar.gz

注:

课程是新建了一个文件夹来作为存放目录,我在此地直接设置到主目录下,并更改文件名为redmine.难怪遵照教程的门径去安排后边的文本会找不到…  

step 13:redmine相关配置

设置收尾后,我们需要在httpd的redmine.conf中开展改动: 

cd /redmine/config
cp database.yml.example database.yml

vi database.yml  #输入mysql访问信息,账号,密码,数据库名字,使用第一个production配置,编辑完成后保存退出

production:
  adapter: mysql2
  database: redmine
  host: localhost
  username: redmine
  password: "redmine"
  encoding: utf8

注意:官网中说MySQL database using ruby
1.9 (adapter must be set to mysql2)

step 14:安装rails

cd /var/www/redmine
gem install bundler
bundle install

注:

这一步骤,很多科目都在说是因为防火墙的来由,不可能向来安装官网源。需要先做一步其他安排,可是我灵魂好啊,没有展开布置也成功了……

 

有关报错,我的装置过程只现出一个错:

An error occurred while installing mysql2 (0.3.18), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.18'` succeeds before bundling.

#执行gem install mysql2 -v '0.3.18'报错:

checking for mysql.h... no
checking for mysql/mysql.h... no
-----
mysql.h is missing

#我们执行yum install mysql-devel后成功安装,接着再次bundle install 

实际上仔细看提醒,都会告知您该实施怎么样命令来缓解问题。

设置成功的唤起:

Bundle complete! 21 Gemfile dependencies, 56 gems now installed.
------
Details here: http://www.elabs.se/blog/60-introducing-capybara-2-1

设置到位后初阶化数据库,默认选项即可。

rake generate_secret_token

#初始化redmine数据库表名

RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake redmine:load_default_data

step 15:激活fcgi

cd redmine/public
mkdir plugin_assets
cp dispatch.fcgi.example dispatch.fcgi
cp htaccess.fcgi.example .htaccess

step 16: 安装Apache and FastCGI模块

rpm --import https://fedoraproject.org/static/0608B895.txt
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
yum -y install mod_fcgid
rm -rf epel-release-6-8.noarch.rpm

step 17:创立redmine的公文存储目录

mkdir -p /data/redmine-2.6.3/files   #由于我自己把redmine安装在主目录下,执行这句命令时,提示我文件已存在...
cd redmine-2.6.3/config
cp configuration.yml.example configuration.yml

鉴于我们的files目录在redmine根目录下,由此configuration不用配置了,假诺files目录在此外地点,我们需要 

vim configuration.yml
attachments_storage_path: /var/redmine/files

step 18:创设redmine虚拟主机

<VirtualHost *:80>
        ServerName your_domain                #我填的是所在服务器的IP地址
        ServerAdmin your_domain@domain.com    #没有指定域名,所以我没写这句
        DocumentRoot /redmine/public/         # !!! Be sure to point DocumentRoot to 'public'!
        ErrorLog logs/redmine_error_log
        <Directory "/redmine/public/">
                Options Indexes ExecCGI FollowSymLinks
                Order allow,deny
                Allow from all       # This relaxes Apache security settings.
                AllowOverride all    # MultiViews must be turned off.
        </Directory>
</VirtualHost>

  

注:redmine目录要科学,指定好相应的域名(借使局部话…)。  

step 19:授权apache权限到redmine目录

以便apache可以访问redmine(先切到redmine安装的目录下,我的是根目录,所以…)

chown -R apache:apache redmine
chmod -R 755 redmine

service httpd restart

 

测试试试看

图片 1

binggo~

默认的用户名和密码都为admin  

装有配置到此截至(其实我一向不配置email…今后闲暇再说),重要参考文档:
http://www.redmine.org/projects/redmine/wiki/Install_Redmine_25x_on_Centos_65_complete

http://www.tuicool.com/articles/UviYJr

http://www.linuxidc.com/Linux/2015-03/115545.htm

 

网站地图xml地图