设为首页 收藏本站
查看: 671|回复: 0

[经验分享] redmine安装部署文档

[复制链接]
累计签到:2 天
连续签到:1 天
发表于 2014-11-19 09:47:07 | 显示全部楼层 |阅读模式
官网: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 redmine@localhost 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

若出现以下错误提示:
-------------------------------------------------------------------------------------------------------------
[root@test 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.

[root@test config]# bundle update

[root@test 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.iyunv.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/document ... 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 loosky@fjut.edu.cn
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


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-31442-1-1.html 上篇帖子: 运维自动化之使用Cobbler自动化安装系统 下篇帖子: Redmine接收邮件传入的问题
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表