Redmine比BoardReview还要折腾,主要是让apache支持Redmine(即不通过3000端口访问,通过80端口访问),总是提示错误。后来查看apache的错误日志,才知道需要修改:
1. config/environment.rb,指定环境变量。ENV['RAILS_ENV'] ||= 'production'
2. public/dispatch.fcgi,加载rubygems和fcgi模块。
一种方式是安装完Redmine后通过3000访问,这个据说性能低;所以改为Apache的cgi支持的方式。
Redmine单独启动
- echo "for Centos6 x86_64bit. Centos5.5因为Python是2.4的,无法支持ReviewBoard。"
- echo "refer to: http://www.redmine.org/projects/redmine/wiki/RedmineInstall"
- echo "refer to: http://www.redmine.org/projects/redmine/wiki/Redmine_on_CentOS_installation_HOWTO"
-
-
-
- sudo yum -y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel mysql-devel
-
- sudo yum install -y ruby ruby-devel
-
- sudo yum install -y rubygems
-
- sudo yum install -y mysql-server
-
- sudo vi /etc/my.cnf
-
- [mysqld]
- default-character-set=utf8
- [client]
- default-character-set=utf8
- sudo chkconfig mysqld on
- sudo service mysqld start
-
- sudo gem install passenger
- echo "very important to run redmine on apache. choose 1 to install passenger for apache."
- sudo passenger-install-apache2-module
-
-
-
-
- wget http://rubyforge.org/frs/download.php/76677/redmine-2.2.1.tar.gz
- tar xf redmine-2.2.1.tar.gz
- sudo mkdir /var/www/redmine
- sudo cp -a redmine-2.2.1/* /var/www/redmine
-
-
-
-
-
- sudo yum install -y ImageMagick-devel postgresql-devel sqlite-devel
-
- sudo gem install bundler pg sqlite3
-
-
-
- cd /var/www/redmine
- sudo bundle install
-
-
-
-
-
-
- mysqladmin -uroot -p"" password root
-
- mysql -uroot -proot
- create database redmine character set utf8;
- create user 'redmine'@'localhost' identified by 'my_password';
- \q
-
- cd /var/www/redmine/config
- sudo cp database.yml.example database.yml
- sudo vi database.yml
-
-
-
-
-
-
- cd /var/www/redmine
-
- sudo rake generate_secret_token
-
- RAILS_ENV=production rake db:migrate
- RAILS_ENV=production REDMINE_LANG=fr rake redmine:load_default_data
-
- cd /var/www/redmine/config
- cp configuration.yml.example configuration.yml
-
- cd /var/www/redmine
- sudo ruby script/rails server webrick -e production
- echo "Redmine is running..."
Apache和Redmine
-
-
-
- echo "refer to: http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Apache_to_run_Redmine"
-
- cd /var/www/redmine/public
- cp dispatch.fcgi.example dispatch.fcgi
- cp htaccess.fcgi.example .htaccess
-
- cd /var/www
- sudo chown -R apache:apache redmine
- sudo chmod -R 755 redmine
-
- cd /var/www/redmine
-
- sudo vi config/environment.rb
- cat << END
- ENV['RAILS_ENV'] ||= 'production'
- END
-
- sudo vi public/dispatch.fcgi
- cat << END
- require 'rubygems'
- require 'fcgi'
- END
-
-
-
-
-
- cd; wget http://www.fastcgi.com/dist/mod_fastcgi-current.tar.gz
- tar xf mod_fastcgi-current.tar.gz
- (cd mod_fastcgi-2.4.6; cp Makefile.AP2 Makefile;)
-
- (cd mod_fastcgi-2.4.6; make top_dir=/usr/lib64/httpd;)
- (cd mod_fastcgi-2.4.6; sudo make install top_dir=/usr/lib64/httpd)
-
- sudo vi /etc/httpd/conf.d/mod_fastcgi.conf
- cat << END
- LoadModule fastcgi_module modules/mod_fastcgi.so
- <IfModule mod_fastcgi.c>
- FastCgiIpcDir /tmp/fcgi_ipc/
- </IfModule>
- END
-
- sudo /sbin/service httpd restart
- sudo chmod 777 /tmp/fcgi_ipc -R
- sudo /sbin/service httpd restart
-
- cd; wget http://www.fastcgi.com/dist/fcgi-2.4.0.tar.gz
- tar -zxvf fcgi-2.4.0.tar.gz
-
- cd fcgi-2.4.0;
- vi include/fcgio.h
- echo "在第34行加上以下include"
-
- echo "为了支持新版的gcc。"
-
- (cd fcgi-2.4.0;./configure;)
- (cd fcgi-2.4.0;make; sudo make install)
- sudo gem install fcgi
-
- sudo vi /etc/httpd/conf/httpd.conf
- cat << END
- <VirtualHost *:80>
- ServerName redmine.winlin.com
- ServerAdmin webmaster@winlin.com
- DocumentRoot /var/www/redmine/public/
- ErrorLog logs/redmine_error_log
-
- <Directory "/var/www/redmine/public/">
- Options Indexes ExecCGI FollowSymLinks
- Order allow,deny
- Allow from all
- AllowOverride all
- </Directory>
- </VirtualHost>
- END
-
-
-
-
-
- sudo /sbin/service httpd restart