redmine安装部署文档

############################################################################## 
官网:http://www.redmine.org/ 
Redmine是一个开源的,基于Web的项目管理和缺陷跟踪工具.它用日历和甘特图辅助项目及进度可视化显示.同时它又支持多项目管理.Redmine是一个自由开放源码软件解决方案,它提供集成的项目管理功能,问题跟踪,并为多个版本控制选项的支持.虽说像IBM Rational Team Concert的商业项目调查工具已经很强大了,但想坚持一个自由和开放源码的解决方案,可能会发现Redmine是一个有用的Scrum和敏捷的选择.由于Redmine的设计受到Rrac的较大影响,所以它们的软件包有很多相似的特征。Redmine建立在Ruby on Rails的框架之上,他可以夸平台和数据库。 
############################################################################## 
redmine 用户手册: 
http://www.ossxp.com/doc/redmine/user_guide/user_guide.html

1、ruby安装 
查找并删除系统默认的ruby软件 
rpm -qa ruby 
rpm -e --nodeps ruby

mkdir /tools/ruby -p 
cd /tools/ruby 
wget http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p353.tar.gz 
tar -zxvf ruby-2.0.0-p353.tar.gz 
cd ruby-2.0.0-p353 
./configure -prefix=/usr/local/ruby 
make && make install 
cd ..

#添加系统环境变量 
echo ‘export PATH=$PATH:/usr/local/ruby/bin‘ >>/etc/profile 
source /etc/profile

#检验 
ruby -v

2、更换gem源 (RubyGems的官方网站是http://www.rubygems.org/,是个包管理工具,相当于RPM、yum等工具。) 
a) gem sources -a http://ruby.taobao.org/ 
新增GEM源 
b) gem sources –remove https://rubygems.org/ 
删除自带官方源 
c) gem sources -l 
查看gem源。确保只剩下ruby.taobao.org

3、安装bundle等依赖 
Rake的官方网站是http://rake.rubyforge.org/,可以让gem联网下载安装,也可以在官方网站下载后进行安装。 
Ruby on Rails的官方网站是http://rubyonrails.org/

gem install bundler

gem install rails

gem install rake

gem install mysql2 
如果mysql是编译安装的,可使用 -with-mysql-config=mysql_config 的位置

gem install mysql2 -with-mysql-config=/usr/local/mysql-5.1.68/bin/mysql_config

4、下载redmine 
mkdir /tools/redmine -p 
cd /tools/redmine 
wget http://www.redmine.org/releases/redmine-2.4.2.tar.gz 
tar -zxvf redmine-2.4.2.tar.gz 
mv redmine-2.4.2 /usr/local/redmine

5、#数据库上执行如下操作: 
create database redmine; 
grant all privileges on redmine.* to [email protected] identified by ‘redmine‘; 
flush privileges;

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

vi database.yml(前几行修改成如下内容,注意冒号后要有空格) 
######################################################## 
production: 
adapter: mysql 
database: redmine #数据库 
host: localhost #服务器IP 
username: redmine #数据库用户 
password: redmine #数据库密码 
encoding: utf8 
socket: /usr/local/mysql-5.0.92/tmp/mysql.sock 
########################################################

6、生成会话密钥 
cd /usr/local/redmine 
rake generate_secret_token

若出现以下错误提示: 
------------------------------------------------------------------------------------------------------------- 
[[email protected] config]# rake generate_secret_token 
(in /usr/local/redmine) 
Could not find gem ‘rails (= 3.2.16) ruby‘ in the gems available on this machine. 
Run `bundle install` to install missing gems.

[[email protected] config]# bundle update

[[email protected] config]# rake generate_secret_token 
(in /usr/local/redmine) 
-------------------------------------------------------------------------------------------------------------

7、rails数据库生成和数据初始化 
RAILS_ENV=production rake db:migrate 
//生成表结构 
RAILS_ENV=production REDMINE_LANG=zh rake redmine:load_default_data 
////语言环境这里配置成zh,显示在web上的

8、启动redmine 
启动须redmine根目录下 
cd /usr/local/redmine 
nohup ruby script/rails server webrick -e production -p 8000 > /usr/local/redmine/log/webrick.log &//默认是3000

附注:redmine默认端口的修改路径: 
/www/redmine/vendor/rails/railties/lib/commands/server.rb

9、http://IP:8000 访问测试 
admin/admin 
修改密码 管理–用户

10、备份还原 
Redmine的用户和问题等信息存储于Mysql数据库,表名为redmine而附件等资源存储于Redmine安装目录的files目录下.因此需要迁移的话只需要备份Mysql数据库的对应的表和files目录即可。 
备份配置文件config\*.yml

但这样只是以独立的方式启动redmine的服务器,在后台执行,有些不足,因为客户端的访问日志会在终端上直接显示。 
并且你退出终端时,服务器进程也会跟着关闭,后面再介绍启动和关闭脚本的编写,以及如何用nginx做反向代理,或是用Apache也可以, 
这个网上可以搜索到很多资料。

#### svn 中文乱码问题 
管理 -- 配置 -- 附件和版本库编码 --GBK 保存就可以了 
http://www.cnblogs.com/compulsive/archive/2011/08/23/2151380.html

——————————————————————————————————————————————

参考:http://www.redmine.org/projects/redmine/wiki/RedmineInstall 
cd /usr/local/redmine/config 
cp configuration.yml.example configuration.yml //配置邮件

—————————————————————————————————————————————— 
安装主题

#到http://www.redmine.org/projects/redmine/wiki/Theme_List下载自己喜欢的主题

ModulaMartini, ModuleMojito和pixel-cooker,推荐使用 piexl-cooker,感觉很cool

#将zip包解压到 redmine/public/themes/

cd /usr/local/redmine/public/themes/ 
unzip 主题.zip //解压、 重启redmine

#检查application.css是否在: 
#redmine/public/themes/<themename>/stylesheets/application.css

在Web界面下设置新主题 
管理–配置–显示– 从下拉列表中选择要使用的主题,保存即可生效

——————————————————————————————————————————————

安装插件

http://www.redmine.org/plugins //插件列表

redmine_ckeditor //编辑器

redmine_wiki_extensions-0.6.4.zip //wiki 扩展

redmine_agile-1_3_0-light.zip //问题列表的功能

redmine_wiki_books-master.zip //wiki 书籍

redmine_lightbox-master.zip // 支持 wiki 缩略图缩放

1、下载插件,解压后,放到redmine根目录的plugins下面 
2、 Migrate plugin: 
rake redmine:plugins:migrate RAILS_ENV=production 
3、重启redmine 就可以使用了

—————————————————————————————————————————————— 
redmine和nginx/apache整合 
默认情况下,访问redmine需要通过http://ip:port的形式来打开,为方便用户,需要用域名的方法直接打开redmine,此时就需要nginx与redmine的整合了。

nginx与redmine的整合

通过nginx的一个passenger模块来实现

使用gem安装passenger 
gem install passenger

获取passenger路径 
passenger-config about nginx-addon-dir

重新编译nginx,添加passenger模块

--add-module=/usr/local/ruby/lib/ruby/gems/2.0.0/gems/passenger-4.0.41/ext/nginx

./configure --prefix=/usr/local/nginx-1.4.3 \
--add-module=/usr/local/ruby/lib/ruby/gems/2.0.0/gems/passenger-4.0.41/ext/nginx

nginx 配置如下: 
passenger_root一定要配置 
具体可以参考这个网址:http://www.modrails.com/documentation/Users%20guide%20Nginx.html#_installing_as_a_normal_nginx_module_without_using_the_installer

passenger_root /usr/local/ruby/lib/ruby/gems/2.0.0/gems/passenger-4.0.41; 
upstream redmine_sa { 
server 127.0.0.1:8000; 
}

server 

listen 80; 
server_name redmine_sa.com; 
root /usr/local/redmine/public;

location / { 
proxy_pass http://redmine_sa; 
proxy_set_header Host $host; 
proxy_set_header X-Real_IP $remote_addr; 
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
passenger_enabled on; 

}

Apache反向代理

gem install passenger 
passenger-install-apache2-module

如果报passenger-install-apache2-module这条命令找不到的话,那么通过下面的命令查看执行路径: 
gem environment 
RubyGems Environment: 
– RUBYGEMS VERSION: 1.3.7 
– RUBY VERSION: 1.8.7 (2009-04-08 patchlevel 160) [i686-linux] 
– INSTALLATION DIRECTORY: /usr/local/ruby/lib/ruby/gems/1.8 
– RUBY EXECUTABLE: /usr/local/ruby/bin/ruby 
– EXECUTABLE DIRECTORY: /usr/local/ruby/bin 
– RUBYGEMS PLATFORMS: 
– ruby 
– x86-linux 
– GEM PATHS: 
– /usr/local/ruby/lib/ruby/gems/1.8 
– /root/.gem/ruby/1.8 
– GEM CONFIGURATION: 
– :update_sources => true 
– :verbose => true 
– :benchmark => false 
– :backtrace => false 
– :bulk_threshold => 1000 
– REMOTE SOURCES: 
– http://rubygems.org/ 
其中,EXECUTABLE DIRECTORY就是命令的全路径,所以对于我例子里的情况执行/usr/local/ruby/bin/passenger-install-apache2-module 
根据提示安装和部署。passenger会在本机编译并成为apache的一个模块。安装过程中会遇到下面的提示信息(根据版本的不同,信息也会稍有变化): 
Welcome to the Phusion Passenger Apache 2 module installer, v2.2.15. 
This installer will guide you through the entire installation process. It 
shouldn’t take more than 3 minutes in total. 
Here’s what you can expect from the installation process: 
1. The Apache 2 module will be installed for you. 
2. You’ll learn how to configure Apache. 
3. You’ll learn how to deploy a Ruby on Rails application. 
Don’t worry if anything goes wrong. This installer will advise you on how to 
solve any problems. 
The Apache 2 module was successfully installed. 
Please edit your Apache configuration file, and add these lines: 
LoadModule passenger_module /usr/local/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.15/ext/apache2/mod_passenger.so 
PassengerRoot /usr/local/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.15 
PassengerRuby /usr/local/ruby/bin/ruby 
After you restart Apache, you are ready to deploy any number of Ruby on Rails 
applications on Apache, without any further Ruby on Rails-specific 
configuration! 
Deploying a Ruby on Rails application: an example 
Suppose you have a Rails application in /somewhere. Add a virtual host to your 
Apache configuration file and set its DocumentRoot to /somewhere/public:

ServerName www.yourhost.com 
DocumentRoot /somewhere/public # <– be sure to point to ‘public’!

AllowOverride all # <– relax Apache security settings 
Options -MultiViews # <– MultiViews must be turned off

And that’s it! You may also want to check the Users Guide for security and 
optimization tips, troubleshooting and other useful information: 
/usr/local/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.15/doc/Users guide Apache.html 
Enjoy Phusion Passenger, a product of Phusion (www.phusion.nl
http://www.modrails.com/ 
Phusion Passenger is a trademark of Hongli Lai & Ninh Bui. 
根据提示信息部署: 
首先,编辑apache的配置文件(/etc/httpd/conf/httpd.conf)并添加下面的信息: 
LoadModule passenger_module /usr/local/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.15/ext/apache2/mod_passenger.so 
PassengerRoot /usr/local/ruby/lib/ruby/gems/1.8/gems/passenger-2.2.15 
PassengerRuby /usr/local/ruby/bin/ruby

然后启用Apache的虚拟主机支持: 
1、注释掉原有的ServerName,ServerAdmin,DocumentRoot的信息; 
2、启用虚拟主机的支持,去掉NameVirtualHost *:80前面的#; 
3、在配置文件的末尾加上: 
<VirtualHost *:80> 
ServerName redmine.loosky.net 
ServerAdmin [email protected] 
DocumentRoot /var/www/redmine/public 
ErrorLog logs/redmine_error_log 
<Directory “/var/www/redmine/public”> 
Allow from all 
AllowOverride all 
</Directory> 
</VirtualHost> 
4、重启Apache服务器:service httpd restart

——————————————————————————————————————————————————————

参考博客:

http://blog.sina.com.cn/s/blog_55a7d3ea0101ebt9.html

http://blog.csdn.net/benkaoya/article/details/8762935

http://jartai.i234.me/wordpress/?p=116

http://blog.csdn.net/wangzh1013/article/details/8558390

http://dl528888.blog.51cto.com/2382721/1217139

http://blog.csdn.net/renkai611919/article/details/7879877

http://ruby-china.org/wiki/mac-nginx-passenger-rails

时间: 2024-12-05 20:17:53

redmine安装部署文档的相关文章

Sqlserver2008安装部署文档

Sqlserver2008部署文档 注意事项: 如果你要安装的是64位的服务器,并且是新机器.那么请注意,你需要首先需要给64系统安装一个.net framework,如果已经安装此功能,请略过这一步.   具体安装.net framework的方法是:在图标<我的电脑>上右击选择<管理>,打开以后选择<功能>选项卡,如下图所示,然后点击添加功能,勾选..net framework,然后一直点击下一步安装即可. 安装的过程中,需要注意如果你要安装的服务器有外挂或者附加的

LVS+Heartbeat安装部署文档

LVS+Heartbeat安装部署文档 发表回复 所需软件: ipvsadm-1.24-10.x86_64.rpmheartbeat-2.1.3-3.el5.centos.x86_64.rpmheartbeat-pils-2.1.3-3.el5.centos.x86_64.rpmheartbeat-stonith-2.1.3-3.el5.centos.x86_64.rpmPyXML-0.8.4-4.x86_64.rpm 系统环境:CentOS 5.4 64-bit HA1            

zabbix3.0安装部署文档

zabbix v3.0安装部署 摘要: 本文的安装过程摘自http://www.ttlsa.com/以及http://b.lifec-inc.com ,和站长凉白开的<ZABBIX从入门到精通v3.0.1 - 运维生存时间(2016)>一书. 关于zabbix及相关服务软件版本: Linux:centos 6.6 nginx:1.9.15 MySQL:5.5.49 PHP:5.5.35 一.安装nginx: 安装依赖包: yum -y install gcc gcc-c++ autoconf

mysql5.6.20二进制安装部署文档

一.业务需求: 单台服务器线上运行着mysql5.5.48 现在是不影响线上的业务,不停止线上的mysql5.5数据库来部署另外一个mysql5.6.20的实例 二.安装部署过程: 2.1安装部署过程注意事项: 在初始化mysql数据库时,是会寻找my.cnf配置文件的,是有顺序的,默认的顺序是: [[email protected] ~]# mysql --help | grep 'Default options' -A 1 Default options are read from the

haproxy 安装部署文档

HAProxy提供高可用性.负载均衡以及基于TCP和HTTP应用的代理,支持虚拟主机,它是免费.快速并且可靠的一种解决方案.HAProxy特别适用于那些负载特大的web站点,这些站点通常又需要会话保持或七层处理.HAProxy运行在当前的硬件上,完全可以支持数以万计的并发连接.并且它的运行模式使得它可以很简单安全的整合进您当前的架构中,同时可以保护你的web服务器不被暴露到网络上. haproxy 配置中分成五部分内容,分别如下:1.global:参数是进程级的,通常是和操作系统相关.这些参数一

Oracle RAC安装部署文档

1.    部署环境步骤 1.1 软件环境 操作系统:CentOS release 6.5(推荐使用5.*的系统)192.168.1.151    racnode1 192.168.1.152    racnode2 oracle安装包:p10404530_112030_Linux-x86-64_1of7.zipp10404530_112030_Linux-x86-64_2of7.zipp10404530_112030_Linux-x86-64_3of7.zipkmod-oracleasm-2.

OpenVPN2.4.3 安装部署文档(实战)

VPN概述: VPN(Virtual Private NetWork,虚拟专用网络)架设在公共共享的基础设施互联网上,在非信任的网络上建立私有的安全的连接,把分布在不同地域的办公场所.用户或者商业伙伴互联起来. 在目前的实践中,常见的VPN构建技术: PPTP(Point-to-Point Tunneling Protocol,点到点的隧道协议)VPN IPSec(Internet Protocol Security,互联网协议安全)VPN SSL/TLS(Secure Sockets Laye

测试环境安装部署文档

一.服务器1.测试环境信息测试环境地址:192.168.1.143 项目部署登陆linux系统用户信息 登陆用户名:higtspeed密 码:安装REDIS,MYSQL,JDK需要使用root用户,密码此处不公布.2.查看部署服务器版本登陆服务器,通过命令cat /etc/redhat-release 查看服务器版本信息.本次以测试环境服务器版本为例:[[email protected] ~]$ cat /etc/redhat-release Red Hat Enterprise Linux S

citus安装部署文档

首先安装citus和postgresql的yum源. ## 安装citus源 curl https://install.citusdata.com/community/rpm.sh | sudo bash ## 配置postgresql源 vim /etc/yum.repos.d/pgdg-95-centos.repo [pgdg95] name=PostgreSQL 9.5 $releasever - $basearch baseurl=https://download.postgresql.