欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Centos 6.5 redmine

程序员文章站 2024-02-28 19:20:34
...
安装rvm

curl -sSL https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm


安装ruby

rvm install list
#输入版本号
rvm install x.x.x


更改gem 安装源

gem sources -l
gem sources -a http://ruby.taobao.org/
gem sources -r https://rubygems.org/
gem sources -u


安装rails


gem install rails -v 3.2.19


安装redmine所需ruby插件

wget http://www.redmine.org/releases/redmine-2.6.0.tar.gz
tar zxvf redmine-2.6.0.tar.gz
cd redmine-2.6.0
bundle install --without development test
gem install selenium-webdriver
yum install imagemagick ImageMagick-devel

yum install -y ImageMagick-devel
yum install -y mysql-devel

#为了正常使用Redmine的认证系统,我们需要为其生成一个Session TOKEN
rake generate_secret_token
#初始化数据库
rake db:migrate RAILS_ENV="production"

#运行ruby
ruby script/rails server webrick -e production


修改redmine的url
修改文件config/environment.rb
在RedmineApp::Application.initialize!之前加入
#Redmine::Utils::relative_url_root = "/redmine"
RedmineApp::Application.routes.default_scope = '/redmine'

apache 反向代理设置

ProxyPass /redmine http://localhost:3000/redmine
ProxyPassReverse /redmine http://loclalhost:3000/redmine

redmine 自启动脚本

#!/bin/bash

# Modify it to your configuration
DIR=/var/www/html/redmine/

# Start Redmine in daemon mode.
start(){
cd $DIR
ruby script/rails server -d -e production
}
# Stop Redmine daemon
stop(){
RUBYPID=`ps aux | grep "ruby script/rails" | grep -v grep | awk '{print $2}'`
if [ "x$RUBYPID" != "x" ]; then
kill -2 $RUBYPID
fi
}
# Check if Redmine is running
status(){
RUBYPID=`ps aux | grep "ruby script/rails" | grep -v grep | awk '{print $2}'`
if [ "x$RUBYPID" = "x" ]; then
echo "* Redmine is not running"
else
echo "* Redmine is running"
fi
}

case "$1" in
start)
start
status
;;
stop)
stop
sleep 2
status
;;
status)
status
;;
restart|force-reload)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload|status}"
exit 1
esac
相关标签: redmine rvm