由于開發(fā)過程中使用的軟件太過于多桩蓉,導(dǎo)致需要登錄好多平臺才能完成,于是想整合一下使用的軟件劳闹,將所有的功能集中于一個軟件中院究,于是就開始安裝redmine,但是誰想到在安裝過程中的坑呀玷或,摔的自己遍體鱗傷儡首,自己做一下總結(jié),希望別人能繞過這些坑偏友,走直路闷煤。
1. 安裝環(huán)境: 系統(tǒng):ubutu12.04 ?架構(gòu):LAMP ?安全:防火墻和selinix(全部關(guān)閉)
2.安裝流程:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
A. 安裝ruby #官網(wǎng)下載 ruby-2.2以上的版本,否則安裝過程中的組件會安裝不上铺纽。(以2.2.4為例)?
tar zxvf ruby-2.2.4.tar.gz ? ? ? ???
cd ruby-2.2.4?
?./configure??
make && make install?
設(shè)置Ruby環(huán)境變
vim ~/.profile?
export PATH=$PATH:/usr/local/src/ruby-2.2.4/ ? ? ??
B.安裝rubygems? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? tar zxvf rubygems-2.6.6.tgz?
cd rubygems-2.6.6?
ruby setup.rb
C.安裝依賴包:apt-get install libmysqlclient-dev ??apache2-threaded-dev? -y
D.安裝 redmine
?官網(wǎng)下載 redmine-2.4.3.tar.gz
tar zxf redmine-2.4.3.tar.gz?
./configure? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
make &&make install? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
mv redmine-2.4.3 ??/usr/local/redmine? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
E.gem 組件安裝:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
? 1. ?gem install bundler? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
?安裝過程需要更改源(否則安裝很慢):
?gem sources --remove https://rubygems.org/? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
gem sources -a https://ruby.taobao.org/ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
2.安裝過程中可能會出現(xiàn):報錯-->Can't find Magick-config? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
查看提示日志內(nèi)容發(fā)現(xiàn) :
find_executable: checking for Magick-config... -------------------- no? ? ? ? ? ? ??
解決發(fā)法:sudo apt-get install libmagickwand-dev ?imagemagick? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
再次安裝即可:gem install bundler
3.修改redmine源碼包中:
Gemfile文件部服,替換 https://rubygems.org 為 https://ruby.taobao.org(開頭)??
#bundle install --without development test postgresql sqlite rmagick? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
?******************************安裝完成后會生成Gemfile.lock.**************************************?
詳解:?
Gemfile是指定需要使用的哪些gem及其版本的地方;? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Gemfile.lock文件是Bundler記錄已經(jīng)安裝了的版本的地方鹅髓。通過這樣的方式舞竿,當(dāng)相同庫/項目在另外一臺機(jī)器上部 署的時候,運(yùn)行bundle install將會查看Gemfile.lock窿冯,然后安裝同樣的版本骗奖,而不是使用Gemfile以及安裝最新的版本。(在不同的機(jī)器上運(yùn)行不同版本會導(dǎo)致測試的失敗……)你不需要直接地更改Gemfile.lock.
F.數(shù)據(jù)庫方面的配置:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
1.創(chuàng)建數(shù)據(jù)庫醒串,添加用戶? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
?create database redmine character set utf8;?
create user 'redmine'@'localhost' identified by '123456';? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
?grant all privileges on redmine.* to 'redmine'@'localhost';? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
2.數(shù)據(jù)庫配置文件(/usr/local/redmine/config):? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
修改數(shù)據(jù)庫配置文件?
cd config?
cp database.yml.example database.yml?
vim database.yml (修改database.yml文件如下:)?
production:?
adapter: mysql2?
database: redmine?
host: localhost?
username: redmine?
password: 123456?
encoding: utf8?
3.rake generate_secret_token ? ? ??
#生成config/initializers/secret_token.rb文件执桌,在redmine-2.4.3中,這個文件事先是不存在的芜赌,如果事先有仰挣,刪除。 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
a)此處可能會出現(xiàn)說rake版本太低缠沈,gem install rake ?-v '版本號' 膘壶,然后再次bundle install(ralis版本低错蝴,也是如上方法解決)
b)安裝是可能會報rake aborted!rbpdf-font不能被加載,手動安裝:gem install rbpdf-font? ? ? ? ? ? ? ??
4.數(shù)據(jù)庫初始化(注意此時的目錄一定要在redmine/config里)? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?rake db:migrate RAILS\_ENV="production" ? ? ? ? ? ?// 數(shù)據(jù)庫初始化? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 在此處遇到的坑最多颓芭,我遇到過“addr沒有定義過顷锰,有些版本過低,不支持的原因,
遇到過?rake aborted!??ActiveRecord::AdapterNotSpecified: production' database is not configured. Available: ["production", "development", "test"] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
解決方法:cd??/usr/local/lib/ruby/gems/2.2.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb
將找到第466行畜伐,把它用井號“#”注釋掉? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
5.rake redmine:load_default_data RAILS_ENV=”production" ??//加載默認(rèn)配置? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
Select language: bg, ca, cs, da, de, en, es, fi, fr, he, hu, it, ja, ko, lt, nl, no, pl, pt, pt-br, ro, ru, sk, sr, sv, th, tr, uk, vn, zh, zh-tw [en] zh?
這個默認(rèn)設(shè)置只是在未登錄時的界面語言馍惹,當(dāng)用戶登錄后,默認(rèn)語言還是英語玛界,在My account里可以修改成其它語言万矾。
G.apache/nginx之間的聯(lián)系(此處以apache為例):? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
1.修改文件權(quán)限:chmod -R 777 files log tmp public/plugin_assets ? (/usr/local/redmine)? ? ? ? ? ? ??
2.添加apache/nginx模塊:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?gem install passenger? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
?cd ?/usr/local/lib/ruby/gems/2.2.0/gems/passenger-5.0.30/bin
?passenger-install-apache2-module? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
此處要分情況看apache中apxs2?: /usr/bin/apxs2和Executable: /usr/sbin/apache2 直接使用上面的命令,如果是源碼安裝:passenger-install-apache2-module ?--apxs2-path "/usr/local/apache/bin/apxs" 引號中的字符是源碼安裝apache位置慎框。
H.apache配置文件內(nèi)容:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
?1.模塊加載(此內(nèi)容在上一步安裝之后會顯示相關(guān)內(nèi)容良狈,將其復(fù)制到配置文件中即可)
LoadModule passenger\_module /usr/local/lib/ruby/gems/2.2.0/gems/passenger-5.0.30/buildout/apache2/mod\_passenger.so?
? ?<IfModule mod_passenger.c>?
? ? ?PassengerRoot /usr/local/lib/ruby/gems/2.2.0/gems/passenger-5.0.30?
? ? ?PassengerDefaultRuby /usr/local/bin/ruby?
? ?</IfModule>
<IfModule unixd_module>
? 2.apache網(wǎng)址設(shè)置
<VirtualHost *:80>?
? ? ? ServerName ip地址?
? ? ? DocumentRoot "/usr/local/redmine/public"?
? ? ? ErrorLog ?"/tmp/redmine_error_log"?
</VirtualHost>
重新啟動apache,啟動mysql 笨枯,http://ip 訪問網(wǎng)站即可薪丁。
用戶名:admin ? ? ? ? 密碼:admin
截圖一張(高興一下):?
以上就是安裝流程,希望能夠讓大家少走彎路馅精。