当前位置:文档之家› 安装配置redmine1.3.0

安装配置redmine1.3.0

[Windows平台下的安装]

1、下载ruby1.8.7的Installer安装程序进行安装;

2、下载Redmine1.3.0解压指定目录(如:d:\redmine1.3.0,下面步骤以此目录为例说明);

3、安装Mysql 5.1及以上版本(Mysql5.0版本,在后面执行rake db:migrate时会报错);

4、进入MySQL Command Line Client,执行以下命令进行建库、建用户、配置权限等操作:
create database redmine character set utf8;
create user 'redmine'@'localhost' identified by 'my_password';
grant all privileges on redmine.* to 'redmine'@'localhost';

5、将d:\redmine1.3.0\config目录下的database.yml.example文件拷贝更名为database.yml,并修改文件中的production节内容,如下:
production:
adapter: mysql
database: redmine
host: localhost
port: 3307
username: redmine
password: my_password
encoding: utf8

若Mysql的端口不是默认的3306,就指定如上的port参数;

6、进入cmd,安装相关Gem,注意版本号的兼容性
更新RubyGems为1.4.2版本:gem update --system 1.4.2
安装Rails:gem install rails -v=2.3.14
安装Rack:gem install rack -v=1.1.1
安装Rake:gem install rake -v=0.9.2
安装RDoc:gem install rdoc -v=2.4.2
安装i18n:gem install i18n -v=0.4.2
安装mysql库:gem install mysql
安装Mongrel:gem install mongrel -v=1.1.5

7、从https://www.doczj.com/doc/a617734080.html,/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll下载libmySQL.dll到ruby的bin目录下;

8、进入cmd,定到位redmine应用目录下,执行以下命令创建表结构、建立默认数据:
rake generate_session_store
set RAILS_ENV=production
rake db:migrate
rake redmine:load_default_data

9、进入cmd,定到位redmine应用目录下,执行ruby script/server webrick -e production启动应用,http://localhost:3000访问系统。


[Mongrel安装]
在windows平台上,mongrel_service的作用是把mongrel作为windows服务用的,即可以用它将mongrel注入到windows的服务里面,不过mongrel_service依赖win32-service-0.5.2,但win32-service-0.5.2已不存在于常规的 https://www.doczj.com/doc/a617734080.html,/projects/win32utils中,需从这里下载:
https://www.doczj.com/doc/a617734080.html,/frs/download.php/15355/win32-service-0.5.2-mswin32.gem
安装win32-service-0.5.2-mswin32:
gem install win32-service-0.5.2-mswin32.gem

接下来,安装mongrel有两种安装方式:
1、在线安装
gem install mongrel -y
gem install mongre_service -y

2、本地安装,注意各gem的版本兼容,否则启动应时会报错
从https://www.doczj.com/doc/a617734080.html,/projects/mongrel下载相应的gem,执行以下命令进行安装
gem install gem_plugin-0.2.3.gem
gem install cgi_multipart_eof_fix-2.5.0.gem
gem install mongrel-1.1.5-x86-mingw32.gem
gem install mongrel_service-0.4.0.gem

[应用Mongrel]
1、启动应用
mongrel_rails start -c [应用路径] -p [端口号] -e production
2、创建Windows服务
mongrel_rails

service::install -N [服务名] -c [应用路径] -p [端口号] -e production
3、卸载服务
mongrel_rails service::remove -N [服务名]
4、启动和停止服务
mongrel_rails service::start -N [服务名]
mongrel_rails service::stop -N [服务名]
5、启动成功后,打开redmine系统无法进行登录操作的问题(点击完登录操作,服务端自动断开连接)的解决方案
网上提供的解决方案(https://www.doczj.com/doc/a617734080.html,/questions/3152909/weird-problem-with-rails-app-and-mongrel),描述如下:
I believe this is a weird combination of bugs in Rack, Mongrel, and Rails.

1、Save this ruby code in your app to config/mongrel.rb: https://www.doczj.com/doc/a617734080.html,/471663

2、In your config/environment.rb, at the very end of the file add: require File.join(File.dirname(File.expand_path(FILE)), 'mongrel')

3、In that same file add this line in the Rails::initializer.run block: config.gem "mongrel"

Longer explanation of the problem here: https://https://www.doczj.com/doc/a617734080.html,/projects/8994/tickets/4690-mongrel-doesnt-work-with-rails-238
This h
as definitely worked for a Rails 2.3.8 app, though I patched it slightly differently than described above.


[与Apache整合部署]
1、通过mongrel创建几个服务实例,如创建2个服务实例:
mongrel_rails service::install -N redmine_1 -c d:\redmine-1.3.0 -p 3001 -e production
mongrel_rails service::install -N redmine_2 -c d:\redmine-1.3.0 -p 3002 -e production
2、配置Apache2.2
用编辑工具打开Apache2.2目录下面的conf/httpd.conf,需要取消如下模块的注释:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_http_module modules/mod_proxy_http.so
如果你希望对页面输出使用压缩,也需要取消如下模块的注释:
LoadModule deflate_module modules/mod_deflate.so

然后加入

#启用http压缩

AddOutputFilterByType DEFLATE text/html text/css text/javascript application/x-javascript

#创建虚拟目录,让apache来处理javascript和css以及图片文件,分担mongrel的压力
Alias /javascripts D:/redmine-1.3.0/public/javascripts
Alias /stylesheets D:/redmine-1.3.0/public/stylesheets
Alias /images D:/redmine-1.3.0/public/images
#设置目录访问权限

order allow,deny
Allow from all


order allow,deny
Allow from all


order allow,deny
Allow from all

#设置负载代理,即mongrel进程
ProxyRequests Off

BalancerMember http://localhost:3001
BalancerMember http://localhost:3002

#apache监听3702端口(这里假设apache有开启一个监听端口为3702),将请求转发给mongrel负载代理,脚本,css,图片除



ServerName https://www.doczj.com/doc/a617734080.html,
DocumentRoot D:/redmine-1.3.0/public/
ProxyPass /images !
ProxyPass /stylesheets !
ProxyPass /javascripts !
ProxyPass / balancer://PMS_Cluster/
ProxyPassReverse / balancer://PMS_Cluster/
ProxyPreserveHost on



重启Apache即可。

相关主题
文本预览
相关文档 最新文档