centos6.x 安装redmine 3.x + apache
前言
Redmine 3.x 最低要求Ruby 1.9.3,CentOS 6.x 默认安装Ruby 1.8.x,这就尴尬了,无法用简单的 yum 一路到底。
解决Ruby
为了以后能支持 redmine 4,至少需要安装 Ruby 2.2.2。那么我们目标就安装 >2.2.2
yum install gcc-c++ patch readline readline-devel zlib zlib-devel yum install libyaml-devel libffi-devel openssl-devel make yum install bzip2 autoconf automake libtool bison iconv-devel sqlite-devel
在安装这个的过程中,如果遇到意外,可能需要用到
rpm -e 要删除的重复包 yum downgrade curl lib-curl libidn
安装 RVM
curl -sSL https://rvm.io/mpapis.asc | gpg --import - curl -L get.rvm.io | bash -s stable source /etc/profile.d/rvm.sh rvm reload rvm requirements run rvm install 2.2.4 rvm use 2.2.4 --default
最后,运行下列语句就能正确显示,我们已经成功用上 ruby2.2.4
# ruby --version ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux]
安装 Passenger
gem install passenger yum install curl-devel httpd-devel passenger-install-apache2-module
看到下面类似的 代码:
LoadModule passenger_module /usr/local/rvm/gems/ruby-2.2.4/gems/passenger-5.3.0/buildout/apache2/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /usr/local/rvm/gems/ruby-2.2.4/gems/passenger-5.3.0 PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.2.4/wrappers/ruby </IfModule>
将下列代码添加到 /etc/httpd/conf.d/passenger.conf
安装Redmine
下载 Redmine 压缩包,解压。修改 config/database.yml 设置数据库配置
gem install bundler bundle install --without development test rmagick bundle exec rake db:migrate RAILS_ENV=production
这个时候,可以运行
bundle exec rails server webrick -e production
开启测试服务器,看是否能正常运行 http://localhost:3000/。
如果你看到登录界面,恭喜您。
配置passenger
vi /etc/httpd/conf.d/passenger.confLoadModule passenger_module /usr/local/rvm/gems/ruby-2.2.4/gems/passenger-5.3.0/buildout/apache2/mod_passenger.so <IfModule mod_passenger.c> PassengerRoot /usr/local/rvm/gems/ruby-2.2.4/gems/passenger-5.3.0 PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.2.4/wrappers/ruby </IfModule> Listen 99 <VirtualHost *:99> DocumentRoot /path/redmine-3.4.5/public ErrorLog logs/redmine_error_log <Directory /path/redmine-3.4.5/public> # This relaxes Apache security settings. AllowOverride all # MultiViews must be turned off. Options -MultiViews </Directory> </VirtualHost>
重启 httpd, 访问本地 99 端口即可。
插件
安装插件
bundle install --without development test rmagick rake redmine:plugins:migrate RAILS_ENV=production
卸载插件
rake redmine:plugins:migrate NAME=redmine_lightbox2 VERSION=0 RAILS_ENV=production rm -Rf plugins/redmine_lightbox2
One more thing
修复 Redmine 调取 SVN https 地址返回404错误。
vi lib/redmine/scm/adapters/subversion_adapter.rbstr << " --no-auth-cache --non-interactive"
修改为
str << " --trust-server-cert --no-auth-cache --non-interactive"
重启 Apache 即可
参考资料
相关推荐
JOO 2020-04-26
安之偌素 2020-03-26
xsg 2020-01-25
83901832 2014-03-11
87447007 2014-03-11
蜀川居 2014-03-11
踩风火轮的乌龟 2008-03-22
wangyongwyk 2011-07-31
zhaoweiping 2009-12-09
dqcoffee 2014-03-11
ApachePHPMySQL 2014-03-11
zhaohuan 2011-10-30
Claroja 2011-08-09
chenchuang 2010-10-10
好脑筋不如烂笔头 2014-04-21
冷月醉雪 2014-03-13
Coohx 2014-02-27
sch 2012-08-18
newdye 2012-08-10