redmine安裝配置
參考頁面
* http://www.pyiner.com/centos-6-3-nginx-%E6%90%AD%E5%BB%BA-redmine/
* http://www.redmine.org/boards/1/topics/37254
* http://www.redmine.org/boards/2/topics/30142
* http://www.redmine.org/projects/redmine/wiki/Redmine_on_CentOS_installation_HOWTO#Set-environment-to-production
* http://www.doc88.com/p-018708303288.html
* http://www.redmine.org/projects/redmine/wiki/RedmineUpgrade
* http://www.redmine.org/issues/14787 [redmine 文件沒法上傳,另nginx提示文件太大,須要修改Nginx配置文件。]
安裝Redmine 2.0.3
mkdir -p /data/web
cd /data/web
wget http://rubyforge.org/frs/download.php/76259/redmine-2.0.3.tar.gz
tar -zxvf redmine-2.0.3.tar.gz
mv redmine-2.0.3 redmine
安裝須要使用的庫
yum -y install zlib-devel curl-devel openssl-devel apr-devel apr-util-devel mysql-devel
安裝 Ruby 對於 redmine 2.0.3 咱們使用 ruby 1.9.3
注:先安裝yaml-0.1.4.tar.gz ,在安裝ruby.
cd /data/soft
wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
./configure
make
make install
wget http://ftp.ruby-lang.org/pub/ruby/stable/ruby-1.9.3-p0.tar.gz
tar -zxvf ruby-1.9.3-p0.tar.gz
cd ruby-1.9.3-p0/
./configure
make
make install
ruby -v(查看版本號,若是順利查看到版本無需其餘操做,如運行ruby報錯,請配置環境變量,詳細見上面參考頁面)
安裝 RubyGems 1.8
cd /data/soft
wget http://rubyforge.org/frs/download.php/74806/rubygems-1.8.0.tgz
tar zxvf rubygems-1.8.0.tgz
cd rubygems-1.8.0
ruby setup.rb
gem -v (查看gem 版本號,驗證gem是否安裝好)
安裝 Phusion Passenger(nginx 模塊)
cd /usr/local/lib/ruby/gems/1.9.1/gems/
wget http://rubyforge.org/frs/download.php/76005/passenger-3.0.12.tar.gz
tar zxvf passenger-3.0.12.tar.gz
cd passenger-3.0.12
./bin/passenger-install-nginx-module(若是此部從新編譯NGINX 報錯,提示PCRE 錯誤,可-with-pcre= 指定其目錄,pcre見附件)
根據提示進行下一步操做,如選擇1,爲全新下載安裝編譯NGINX,如選擇2 可在以前已有NGINX上新增模塊,自定義編譯參數
因爲NGINX已經安裝(nginx安裝請參考部署文檔),本例選擇2.
Nginx 配置(支持 passenger模塊)
cd /usr/local/nginx/conf
vim nginx.conf
在http 字段裏面新增
passenger_root /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.12;
passenger_ruby /usr/local/bin/ruby;
server 字段裏面新增
passenger_enabled on;
passenger_use_global_queue on;
重啓 Nginx /usr/local/nginx/sbin/nginx -s reload
Redmine Setup,安裝 bundler
cd /data/web/redmine (進入redmine目錄)
gem install bundler
bundle install --without development test postgresql sqlite rmagick(咱們的用的是mysql 而後把postresql 和 sqlite 都忽略了吧~)
如提示報錯,沒法安裝mysql.
解決辦法:先刪除默認已安裝的mysql rm -rf /usr/local/Percona rm -f /etc/init.d/mysqld
而後 yum install mysql mysql-server mysql-devel
/etc/init.d/mysqld start
以後從新安裝.
若是你沒有安裝 ImageMagick, 你能夠忽略rmagick: bundle install –without development test postgresql sqlite rmagick
若是要安裝 ImageMagick 的話
yum install ImageMagick
yum install ImageMagick-devel
vim /data/web/redmine/Gemfile [編輯文件支持mysql(此例使用mysql 安裝完成後頁面出現字符問題),請使用mysql2]
在文件適當的位置添加
gem "mysql2 php
mv /data/web/redmine/config/database.yml.example /data/web/redmine/config/database.yml
vim /data/web/redmine/config/database.yml
Change the adapter in database.yml to mysql2
Add to config/environment.rb
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
數據庫相關操做
mysql -uroot -p
create database redmine character set utf8;
create user 'redmine'@'localhost' identified by'my_password';
grant all privileges on redmine.* to 'redmine'@'localhost';
cd /data/web/redmine/config/
vim database.yml
更改以下
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: my_password
Generate a session store secret
cd /data/web/redmine
rake generate_secret_token
建立數據庫基本信息表 RAILS_ENV=production rake db:migrate
此處如報錯 請參考本文章頭部參考頁面連接
RAILS_ENV=production rake redmine:load_default_data
如沒有報錯 則安裝完成
排錯日誌文件
tail -f /data/logs/nginx/error.log (nginx 錯誤日誌)
tail -f /data/web/redmine/log/production.log (redmine 日誌信息)
html