標籤:Redmine
Highlight:
參考文檔:http://www.redmine.org/projects/redmine/wiki/RedmineInstall
mysql和redmine在同一台主機上,實際部署時可單獨部署mysql。
本文不包括整合Apache/Nginx。
以下內容在virtualbox虛擬機器上測試可行。
作業系統:Windows Server 2012 R2 x64 英文標準版(MSDN下載ISO)
安裝完系統後,安裝以下patch,這些patch都可以從微軟官方網站下載:
clearcompressionflag.exe
vcredist_x64.exe
Windows8.1-KB2919355-x64.msu
Windows8.1-KB2919442-x64.msu
Windows8.1-KB2932046-x64.msu
Windows8.1-KB2934018-x64.msu
Windows8.1-KB2937592-x64.msu
Windows8.1-KB2938439-x64.msu
Windows8.1-KB2959977-x64.msu
下載mysql-5.5.59-winx64.msi後按照安裝嚮導及實際需求完成安裝,安裝完畢,執行以下sql建立空資料庫redmine及使用者redmine,並賦予使用者redmine所有許可權。
CREATE DATABASE redmine CHARACTER SET utf8;
CREATE USER 'redmine'@'Server2012-05' IDENTIFIED BY 'redmine';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'Server2012-05';
注意:推薦使用mysql-5.5,5.5之後的版本和redmine相容上存在問題,我自己試過多個版本,折騰很久,最後還是用mysql-5.5最方便。
(1)部署Redmine應用程式套件
從http://www.redmine.org/releases/redmine-3.4.4.zip 下載Redmine壓縮包,然後解壓至C:\redmine-3.4.4
(2)安裝ruby, rubyGems
下載並按照安裝嚮導的預設設定安裝以下軟體,下載連結見參考文獻:
rubyinstaller-2.3.3-x64.exe
DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe
安裝完畢,修改環境變數path,添加C:\Ruby23-x64\bin,C:\DevKit\bin和C:\DevKit\mingw\bin,如下所示:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;
C:\Program Files\MySQL\MySQL Server 5.5\bin; C:\Ruby23-x64\bin;C:\DevKit\bin;C:\DevKit\mingw\bin
確認版本:
C:\Windows\system32>ruby -v
ruby 2.3.3p222 (2016-11-21 revision 56859) [x64-mingw32]
C:\Windows\system32>gem -v
2.5.2
(3)安裝bundle >= 1.5.0
在cmd中執行:
gem install bundle
(4)安裝其他依賴包
修改C:\redmine-3.4.4\Gemfile,將gem "mysql2", "~> 0.4.6"改為gem "mysql2", "0.4.6"。
cd c:\redmine-3.4.4
bundle install –without development test rmagick
(5)產生會話秘鑰
cd c:\redmine-3.4.4
bundle exec rake generate_secret_token
(6)產生資料庫結構
cd c:\redmine-3.4.4
set RAILS_ENV=production
bundle exec rake db:migrate
(7)啟動Redmine
cd c:\redmine-3.4.4
ruby bin/rails server -e production –b 0.0.0.0
(8)登入Redmine
從區域網路內任意機器訪問http://Redmine_Host_IP:3000
預設賬戶及密碼為admin/admin。
使用admin賬戶登入,系統會強制使用者修改密碼,請牢記住修改後的密碼!
基於Windows Server 2012 R2 x64搭建Redmine