1、配置安装环境,安装所依赖的软件。
必备软件:Centos、mysql、Ruby、Apache、Redmine。
yuyum update
yum -y groupinstall "Development Tools"
yum -y install ntp zlib zlib-devel sqlite-devel httpd mysql-server mysql-devel curl-devel httpd-devel apr-devel apr-util-devel mlocate manlibxml2-devel libxslt-devel libffi-devel readline-devel
yum install -y ruby ruby-devel
yum install -y rubygems
yum install –y ImageMagick-devel
禁用selinux
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
sed -i "s/SELINUXTYPE=targeted/#SELINUXTYPE=targeted/g" /etc/selinux/config
2、安装RVM
安装方法:https://rvm.io/rvm/install
3、参考安装教程
http://www.redmine.org/projects/redmine/wiki/Install_Redmine_25x_on_Centos_65_complete
http://blog.youkuaiyun.com/win_lin/article/details/8514333
http://blog.tonycube.com/2013/11/redmine-centos-apache-ruby-on-rails.html
4、遇到的问题及解决方法
http://stackoverflow.com/questions/5201689/rmagick-gem-install-cant-find-magick-config
http://zorro.blog.51cto.com/2139862/893944
http://stackoverflow.com/questions/22571206/netbeans-and-rails-error-bin-ruby-no-such-file-or-directory-script-rails-l
5、RedMine 迁移方法
https://ruby-china.org/topics/8340
6、技巧
A、默认需要加上端口3000才可以访问,解决方法在vhost.conf中添加:
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
参考文档:
http://xuplus.com/article/2011/01/a221.html
default:
# Outgoing emails configuration (see examples above)
email_delivery:
delivery_method: :smtp
smtp_settings:
address: smtp.qq.com
port: 25
domain: qq.com
authentication: :login
user_name: "邮箱帐号"
password: "邮箱密码"
你的username是xx@163.com,那么password是你的163邮箱密码,address是smtp.163.com,domain 是163.com,
如果是xx@qq.com,那么password是你的qq邮箱密码,address是smtp.163.com,domain是163.com
C、修改主机名
若在第三步收到了邮件,则会发现邮件中会有这样的内容:
Redmine URL:http://localhost:3000/redmine/
这个显然是不对的...我们要的是正确的域名或是IP。
修改方法:管理->配置->一般->主机名称
D、开机启动及脚本
此处参考:http://www.vipzhicheng.com/blog/2014/04/09/install-redmine-on-centos/#!/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