系統:centos 6.5 x64html
redmine 版本:3.1.0mysql
ruby 版本: 2.2.3jquery
rails 版本 : 4.2linux
安裝公鑰
nginx
[root@localhost ~]# curl -sSL https://rvm.io/mpapis.asc | gpg --import gpg: 已建立目錄‘/root/.gnupg’ gpg: 新的配置文件‘/root/.gnupg/gpg.conf’已創建 gpg: 警告:在‘/root/.gnupg/gpg.conf’裏的選項於這次運行期間未被使用 gpg: 鑰匙環‘/root/.gnupg/secring.gpg’已創建 gpg: 鑰匙環‘/root/.gnupg/pubring.gpg’已創建 gpg: /root/.gnupg/trustdb.gpg:創建了信任度數據庫 gpg: 密鑰 D39DC0E3:公鑰「Michal Papis (RVM signing) <mpapis@gmail.com>」已導入 gpg: 合計被處理的數量:1 gpg: 已導入:1 (RSA: 1)
安裝rvm
git
[root@localhost ~]# curl -L https://get.rvm.io | bash -s stable % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 22721 100 22721 0 0 6915 0 0:00:03 0:00:03 --:--:-- 113k Downloading https://github.com/rvm/rvm/archive/1.26.11.tar.gz #省略…… # Administrator, # # Thank you for using RVM! # We sincerely hope that RVM helps to make your life easier and more enjoyable!!! # # ~Wayne, Michal & team. In case of problems: http://rvm.io/help and https://twitter.com/rvm_io
載入RVM環境並獲取須要的支持安裝包
github
[root@localhost ~]# source /etc/profile.d/rvm.sh [root@localhost ~]# rvm requirements Checking requirements for centos. Installing requirements for centos. Installing required packages: patch, libyaml-devel, autoconf, patch, readline-devel, libffi-devel, automake, libtool, sqlite-devel .......... Requirements installation successful.
# rvm install 2.2.3
# rvm use 2.2.3 --default
因爲國內網絡緣由(你懂的),致使rubygems.org存放 Amazon S3上面的資源文件間歇性鏈接失敗。因此你會與遇到gem install rack或bundle install的時候半天沒有響應,具體能夠用gem install rails -V來查看執行過程。下面替換成淘寶的GEM鏡像站:web
# gem sources -l *** CURRENT SOURCES *** https://rubygems.org/ # gem sources --remove https://rubygems.org/ https://rubygems.org/ removed from sources # gem sources -a https://ruby.taobao.org/ https://ruby.taobao.org/ added to sources # gem sources -l *** CURRENT SOURCES *** https://ruby.taobao.org/
安裝rails 4.2
sql
gem install rails -v=4.2
下載redmine3.1.1shell
wget http://www.redmine.org/releases/redmine-3.1.1.tar.gz
解壓並進入目錄
tar -zxvf redmine-3.1.1.tar.gz cd redmine-3.1.1
安裝管理ruby的包依賴的工具bundler
gem install bundler #注意是在網站根目錄下執行
安裝redmine依賴的全部ruby包
bundle install --without development test rmagick #完成redmine依賴包的安裝
若是失敗執行下列命令
gem install json -v '1.8.3' gem install minitest -v '5.8.0' gem install activesupport -v '4.2.3' gem install actionview -v '4.2.3' gem install actionpack -v '4.2.3' gem install activejob -v '4.2.3' gem install actionmailer -v '4.2.3' gem install actionpack-action_caching -v '1.1.1' gem install actionpack-xml_parser -v '1.0.2' gem install activemodel -v '4.2.3' gem install activerecord -v '4.2.3' gem install coderay -v '1.1.0' gem install railties -v '4.2.3' gem install jquery-rails -v '3.1.4' gem install mysql2 -v '0.3.20' gem install net-ldap -v '0.3.1' gem install protected_attributes -v '1.1.3' gem install ruby-openid -v '2.3.0' gem install rack-openid -v '1.4.2' gem install rails -v '4.2.3' gem install rbpdf -v '1.18.6' gem install redcarpet -v '3.1.2' gem install request_store -v '1.0.5'
rake generate_secret_token
建立redmine數據庫
mysql> create database redmine;
添加mysql用戶
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost' IDENTIFIED BY 'my_password';
配置Redmine的database.yml
cp config/database.yml.example config/database.yml cat database.yum #修改對應數據庫鏈接信息 production: adapter: mysql2 database: redmine host: localhost username: redmine password: "my_password" encoding: utf8
建立數據庫結構
RAILS_ENV=production bundle exec rake db:migrate
生成缺省數據
RAILS_ENV=production bundle exec rake redmine:load_default_data
bundle exec rails server webrick -e production -b 0.0.0.0
地址:http://IP:3000 (注意:打開iptables 3000端口號)
缺省管理員用戶:
login: admin
password: admin
按ctrl+c結束webrick服務
安裝passenger
gem install passenger passenger-install-nginx-module
在湖聞樟注:passenger-install-nginx-module能夠選擇自動下載完整nginx仍是本身編譯,我在這裏是選了下載完整nginx
複製redmine到nginx的html目錄
cp ../redmine-3.1.1 /usr/local/nginx/html/redmine
配置nginx.conf,修改server部分的location 爲
location / { root html/redmine/public; index index.html index.htm; }
啓動nginx
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf