图片 1

5下Redmine的设置配备

centos 6.7下安装redmine+svn+apache

系统环境

cat/etc/redhat-release

CentOSrelease6.7(Final)

uname-r

2.6.32-573.el6.x86_64

1.替换yum源为163。大家都是高手,这里不做详细的交代了。

把这个文件放到/etc/yum.reop下。

yuminstall-yupdate

关闭和清理防火墙和selinux

2.

mkdir/tools

cd/tools

wget

wget

Wget

wget

3.安装环境

yum-yinstalllibyaml-develzlib-develcurl-developenssl-develhttpd-develapr-develapr-util-develgccruby-develgcc-c++makepostgresql-develImageMagick-develsqlite-develperl-LDAPmod_perlperl-Digest-SHA

4.安装apache和mysql

yuminstallmysql-community-servermysqlmysql-develhttpdhttpd-develmysql-server-y

rpm-ivhepel-release-latest-6.noarch.rpm

rpm-Uvh

5.启动mysql

servicemysqldstart

[email protected]

mysql-uroot-p

mysql>createdatabaseredmine;

mysql>useredmine;

mysql>source/data/redmine.sql

6.安装ruby

cd/tools

tarxzvfruby-2.1.6.tar.gz

cdruby-2.1.6

./configure–prefix=/usr/local/ruby

make&&makeinstall

cd..

vim/etc/profile

exportPATH=/usr/local/ruby/bin:$PATH再这行加到文档中export那行后面

source/etc/profile

ruby-v

#ruby2.1.6p336(2015-04-13revision50298)[x86_64-linux]

7.安装rails

cd/tools

tarxzvfrubygems-2.4.5.tgz

cdrubygems-2.4.5

rubysetup.rb

gem-v

#2.4.5

whichgem

#/usr/local/ruby/bin/gem

更换gem源为淘宝的源。默认的官方源因为网络问题速度慢

gemsources–remove

gemsources-a

gemsources-l最后只能看到一个淘宝的源

geminstallrails-v=4.2

8.安装redmine3.1

cd/tools

mkdir/home/www

tarxzvfredmine-3.1.0.tar.gz-C/home/www/

cd/home/www

mvredmine-3.1.0/redmine

cdredmine/

geminstallmysql2

配置redmine文件

cdconfig

cpdatabase.yml.exampledatabase.yml

vimdatabase.yml

production:

adapter:mysql2

database:redmine

host:localhost

username:root

password:”[email protected]”(这里是你登陆redmien数据库的用户名和密码)

encoding:utf8

development:

adapter:mysql2

database:redmine_development

host:localhost

username:root

password:””

encoding:utf8

9.安装依赖

cd/home/www/redmine

geminstallbundler

bundleinstall–withoutdevelopmenttestrmagick这个命令执行后会报错,是说你有依赖没有安装。按他的提示把需要的依赖全部安装就行了。基本是geminstall开头的那那段。大概有20-30个依赖。耐心装吧。如果你SHELL玩的好,可以写个脚本装。

geminstalljson-v’1.8.3′

geminstallrake-v’10.4.2′

geminstallactivesupport-v’4.2.3′

geminstallactionview-v’4.2.3′

geminstallactionpack-v’4.2.3′

geminstallactionmailer-v’4.2.3′

geminstallactionpack-action_caching-v’1.1.1′

geminstallactionpack-xml_parser-v’1.0.2′

geminstallactivemodel-v’4.2.3′

geminstallactiverecord-v’4.2.3′

geminstallcoderay-v’1.1.0′

geminstallrailties-v’4.2.3′

geminstalljquery-rails-v’3.1.3′

geminstallnet-ldap-v’0.3.1′

geminstallprotected_attributes-v’1.1.3′

geminstallruby-openid-v’2.3.0′

geminstallrack-openid-v’1.4.2′

geminstallrails-v’4.2.3′

geminstallrbpdf-v’1.18.6′

geminstallredcarpet-v’3.1.2′

geminstallrequest_store-v’1.0.5′

geminstallmysql2-v’0.3.19′

为Rails生成cookies秘钥

rakegenerate_secret_token

调整文件系统权限

cd/home/www/redmine/

mkdir-ptmptmp/pdfpublic/plugin_assets

chown-Rapache.apache/home/www/

chmod-R755/home/www/

初始化数据库

rakedb:migrateRAILS_ENV=production

rakeredmine:plugins:migrateRAILS_ENV=production

raketmp:cache:clear

raketmp:sessions:clear

测试redmine是否安装成功

ruby/usr/local/ruby/bin/railsserverwebrick-eproduction-d

lsof-itcp:3000检查端口是否开启

10.配置Redmine在Apache上运行

cd/home/www/redmine/public

cpdispatch.fcgi.exampledispatch.fcgi

cphtaccess.fcgi.example.htaccess

chown-Rapache.apache/home/www/redmine/

安装Passenger(用于整合Apache)

geminstallpassenger

passenger-install-apache2-module

11.安装SVN和其他模块。

yuminstall-ysubversion

yum-yinstallelinks

yuminstall-ymod_ssl

yuminstall-ymod_fcgid

yuminstall-ymod_dav_svn

yuminstall-ymod_auth_mysql

mkdir-p/usr/lib64/perl5/vendor_perl/Apache/

cd/home/www/redmine/extra/svn

cpRedmine.pm/usr/lib64/perl5/vendor_perl/Apache\

修改配置文件,安装完成后。你需要对配置进行修改。由于篇幅问题。这里不多说了。只说几个重要的配置文件。

vim ruby.conf

LoadModule passenger_module
/usr/local/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.15/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot
/usr/local/ruby/lib/ruby/gems/2.1.0/gems/passenger-5.0.15
PassengerDefaultRuby /usr/local/ruby/bin/ruby
</IfModule>

vim redmine.conf

<Location /pm>
RailsEnv production
RailsBaseURI /pm
Options -MultiViews
</Location>

vim subversion.conf

PerlLoadModule Apache::Redmine
<Location /svn>
DAV svn
SVNParentPath “/home/svn”
SVNListParentPath on

Order deny,allow
Deny from all
Allow from (你的服务器IP)这行也可以不要。
Satisfy any
LimitXMLRequestBody 0
SVNPathAuthz off

PerlAccessHandler Apache::Authn::Redmine::access_handler
PerlAuthenHandler Apache::Authn::Redmine::authen_handler
AuthType Basic
AuthName “Redmine SVN Repository”

Require valid-user
RedmineDSN “DBI:mysql:database=redmine;host=localhost:3306”
RedmineDbUser “redmine”
RedmineDbPass “redmine”
# cache max. 50 passwords
RedmineCacheCredsMax 50
</Location>

其他配置文件基本可以默认不改

需要在httpd.conf和ssl.conf里面把网站根目录给改下。

cd/home/www/

ln-sredmine/public/pm

chown-Rapache.apache*

chmod755-R*

12.建立SVN版本库

cd/home

mkdirsvn

把要迁移的SVN项目库的文件放到/home/svn目录下。

chown-Rapache.apachesvn

chmod-R755svn

授权数据库远程连接grantallprivilegesonredmine.*[email protected]’redmine’;

flushprivileges;

grantallprivilegesonredmine.*[email protected]’%’identifiedby’redmine’;

mysql-uroot-p-h172.16.1.10

13.修改svn和redmien结合文件

svnls–config-dir/tmp/subversion_config–config-optionconfig:auth:store-auth-creds=yes

cd/home/www/redmine/lib/redmine/scm/adapters

cpsubversion_adapter.rbsubversion_adapter.rb_yy20150820

vimsubversion_adapter.rb

str<<“–no-auth-cache–non-interactive–config-dir/tmp/subversion_config”把一替换文件中的

str<<“–no-auth-cache–non-interactive”这一行

注意修改你的主机名和ip地址对应。否则可能会出错。

6.7下安装redmine+svn+apache 系统环境
cat/etc/redhat-release CentOSrelease6.7(Final) uname-r
2.6.32-573.el6.x86_64
1.替换yum源为163。大家都是高手,这里不做…

首先引用百度介绍下redmine:

CentOS 6.5下Redmine的安装配置

首先引用百度介绍下redmine:

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

在安装redmine前,我们需要先来看下各个组件的版本要求:

Redmine version Supported Ruby versions Rails version used
current trunk ruby 1.9.3, 2.0.01, 2.1, 2.2 Rails 4.2
trunk < r13482 ruby 1.8.72, 1.9.2, 1.9.3, 2.0.01, 2.1, jruby-1.7.6 Rails 3.2
3.0 ruby 1.9.3, 2.0.01, 2.1, 2.2 Rails 4.2
2.6 ruby 1.8.72, 1.9.2, 1.9.3, 2.0.01, 2.1, jruby-1.7.6 Rails 3.2

目前官网2.0以上版本最新为2.6.3,由上图可以看到我们需要选择哪个版本的组件。

1.CentOS 6.5下安装基本的软件环境

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.安装apache和mysql,并配置redmine数据库

rpm -Uvh

yum install mysql-community-server httpd -y

安装完成后,service mysqld start,并进行相关数据库配置

mysql> create database redmine_db 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)

3.iptables设置

如果服务器开了防火墙,我们需要进行相关设置

/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

4.安装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

5.安装ruby环境

\curl -L | bash
source /etc/profile.d/rvm.sh

[[email protected]
~]# source /etc/profile.d/rvm.sh
[[email protected]
~]# rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p643]
[ruby-]2.1.4
[ruby-]2.1[.5]
[ruby-]2.2[.1]
[ruby-]2.2-head

2.6版本需要ruby 支持的版本,在这我们选择1.9.3 稳定版 

rvm install 1.9.3

[[email protected]
~]# ruby -v
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-linux]

6.安装rubygems 

yum -y install rubygems

7.安装redmine的apache支持,这样可以通过apache访问

gem install passenger
passenger-install-apache2-module

命令执行完后按照提示进行配置http:

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/http/conf.d/redmine.conf
  <VirtualHost *:80>
      ServerName www.yourhost.com
      # !!! Be sure to point DocumentRoot to ‘public’!
      DocumentRoot /somewhere/public   
      <Directory /somewhere/public>
        # This relaxes Apache security settings.
        AllowOverride all
        # MultiViews must be turned off.
        Options -MultiViews
        # Uncomment this if you’re on Apache >= 2.4:
        #Require all granted
      </Directory>
  </VirtualHost>

由于我们的redmine还没有安装,因此路径暂时还不配置,等按完redmine后在来配置具体路径,注意root目录必须是redmine下的public目录。 

8.安装redmine

wget
tar -zxvf redmine-2.6.3.tar.gz
mv redmine-2.6.3 /data

安装完毕后,我们需要在httpd的redmine.conf中进行修改:

  <VirtualHost *:80>
      ServerName 192.168.3.126
      # !!! Be sure to point DocumentRoot to ‘public’!
      DocumentRoot /data/redmine-2.6.3/public
  ErrorLog logs/redmine_error_log
      <Directory /data/redmine-2.6.3/public>
<span style=”white-space:pre”> </span> Options Indexes
ExecCGI FollowSymLinks
        Order allow,deny
        Allow from all
        # This relaxes Apache security settings.
        AllowOverride all
        # MultiViews must be turned off.
        Options -MultiViews
        # Uncomment this if you’re on Apache >= 2.4:
        #Require all granted
      </Directory>
  </VirtualHost>

不要忘了service httpd restart

9.redmine相关配置

cd /data/redmine-2.6.3/public

cp database.yml.example database.yml

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

vim database.yml
production:
  adapter: mysql2
  database: redmine
  host: localhost
  username: redmine
  password: “redmine”
  encoding: utf8

10.安装rails,安装过程中会出现很多问题,我们来一一解决吧。 

cd /data/redmine-2.6.3

gem install bundler

bundle install 

这里会报错:

An error occurred while installing rack-cache (1.2), and Bundler cannot
continue.
Make sure that `gem install rack-cache -v ‘1.2’` succeeds before
bundling.

我们按照提示安装所需组件 

gem install rack-cache -v ‘1.2’

然后再次bundle install,报错:

An error occurred while installing nokogiri (1.6.6.2), and Bundler
cannot continue.
Make sure that `gem install nokogiri -v ‘1.6.6.2’` succeeds before
bundling.

按照提示gem install nokogiri -v ‘1.6.6.2’,再运行bundle install,报错:

ERROR:  Error installing nokogiri:
 ERROR: Failed to build gem native extension.

按照提示: 

If you are using Bundler, tell it to use the option:
 
    bundle config build.nokogiri –use-system-libraries
    bundle install

我们来输入命令:

  bundle config build.nokogiri –use-system-libraries
  bundle install

再次报错:

An error occurred while installing json (1.8.2), and Bundler cannot
continue.
Make sure that `gem install json -v ‘1.8.2’` succeeds before bundling.

按照提示安装 gem install json -v ‘1.8.2’,然后再次bundle install

又报错:

An error occurred while installing railties (3.2.21), and Bundler cannot
continue.
Make sure that `gem install railties -v ‘3.2.21’` succeeds before
bundling.

按照提示安装 gem install railties -v ‘3.2.21’,然后再次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

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

checking for mysql/mysql.h… no

mysql.h is missing

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

报错:

An error occurred while installing redcarpet (2.3.0), and Bundler cannot
continue.
Make sure that `gem install redcarpet -v ‘2.3.0’` succeeds before
bundling.

按照提示安装 gem install redcarpet  -v ‘2.3.0’,然后再次bundle install

 

Please report any bugs. See
and

ok,终于安装成功。 

rake generate_secret_token

初始化redmine数据库表名

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

 

11.修改fastcgi‘

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

12.安装mod_fcgi

rpm –import
wget

rpm -ivh epel-release-6-8.noarch.rpm
yum -y install mod_fcgid

13.创建文件目录

mkdir -p /data/redmine-2.6.3/files
cd /data/redmine-2.6.3/config
cp configuration.yml.example configuration.yml

由于我们的files目录在redmine根目录下,因此configuration不用配置了,如果files目录在其他地方,我们需要 

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

14.最后启动redmine

cd /data/redmine-2
chown -R apache:apache redmine-2.6.3
chmod -R 755 redmine-2.6.3
service httpd restart

测试吧,让我们访问下看看

图片 1

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

另外若apache访问不了,我们可以先用redmine自己的启动方式启动,然后ip:3000端口进行访问,如果访问成功,则redmine配置没问题,可能是apache的配置问题或漏改配置了

下面是redmine的启动方式,

[[email protected]
redmine-2.6.3]# cd /data/redmine-2.6.3 
[[email protected]
redmine-2.6.3]# ruby script/rails server webrick -e production
=> Booting WEBrick
=> Rails 3.2.21 application starting in production on

=> Call with -d to detach
=> Ctrl-C to shutdown server
[2015-03-28 01:09:30] INFO  WEBrick 1.3.1
[2015-03-28 01:09:30] INFO  ruby 1.9.3 (2014-11-13)
[x86_64-linux]
[2015-03-28 01:09:30] INFO  WEBrick::HTTPServer#start: pid=14577
port=3000

好了,就介绍到这里吧,这是第二次配,相比第一次容易很多,根据错误提示来就可,希望能给大家带来帮助。

 

CentOS下安装Redmine并集成Git 

最简化的Ubuntu 10.04下Redmine部署方法

Ubuntu 10.04默认安装Redmine注意事项

CentOS 5 下Redmine的安装及配置

Ubuntu 9.10下搭建基于PostgreSQL的Redmine

Ubuntu中安装开源项目管理软件Redmine

如何将Turnkey Redmine 虚拟机从Redmine 1.0.5 升级到1.2

CentOS5下进行Redmine环境搭建,邮件服务配置,LDAP配置

Redmine 的详细介绍:请点这里
Redmine 的下载地址:请点这里

本文永久更新链接地址:

6.5下Redmine的安装配置
首先引用百度介绍下redmine:
Redmine是用Ruby开发的基于web的项目管理软件,是用ROR框架开发的一套跨平台项目管理…

在安装redmine前,我们需要先来看下各个组件的版本要求:

Redmine version Supported Ruby versions Rails version used
current trunk ruby 1.9.3, 2.0.01, 2.1, 2.2 Rails 4.2
trunk < r13482 ruby 1.8.72, 1.9.2, 1.9.3, 2.0.01, 2.1, jruby-1.7.6 Rails 3.2
3.0 ruby 1.9.3, 2.0.01, 2.1, 2.2 Rails 4.2
2.6 ruby 1.8.72, 1.9.2, 1.9.3, 2.0.01, 2.1, jruby-1.7.6 Rails 3.2

目前官网2.0以上版本最新为2.6.3,由上图可以看到我们需要选择哪个版本的组件。

1.CentOS
6.5下安装基本的软件环境

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.安装apache和mysql,并配置redmine数据库

rpm -Uvh

yum install mysql-community-server httpd -y

安装完成后,service mysqld start,并进行相关数据库配置

mysql> create database redmine_db 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)

3.iptables设置

如果服务器开了防火墙,我们需要进行相关设置

/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

4.安装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

5.安装ruby环境

\curl -L | bash
source /etc/profile.d/rvm.sh

[root@usvr-126 ~]# source /etc/profile.d/rvm.sh
[root@usvr-126 ~]# rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p643]
[ruby-]2.1.4
[ruby-]2.1[.5]
[ruby-]2.2[.1]
[ruby-]2.2-head

2.6版本需要ruby 支持的版本,在这我们选择1.9.3 稳定版 

rvm install 1.9.3

发表评论

电子邮件地址不会被公开。 必填项已用*标注