日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

Wang Zhe's Blog | CentOS下部署Redmine項(xiàng)目管理系統(tǒng)

 亭下走馬 2015-03-30

CentOS下部署Redmine項(xiàng)目管理系統(tǒng)

環(huán)境需求:
CentOS6.2 + ruby1.9.2 + rails3.2.6 + redmine2.0.3 + rubygems1.3.7 (版本很重要)

1、關(guān)掉selinux和iptables

sed -i s/\=enforcing/\=disabled/g /etc/selinux/config
chkconfig --level 35 iptables off
chkconfig --level 35 ip6tables off

2、安裝相關(guān)的rpm包

yum -y install vim-enhanced wget ntp gcc gcc-c++ make automake autoconf  mysql-devel libxml2-devel curl-devel patch libxslt-devel libxslt cyrus-sasl-devel openssh openssh-clients subversion pcre-devel httpd

3、安裝ruby-1.9.2

tar zxvf ruby-1.9.2-p290.tar.gz
cd ruby-1.9.2-p290/
./configure 
make && make install
cd ext/openssl
ruby extconf.rb
make && make install
 
ruby -v(檢查安裝版本)
#ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]

4、安裝rails3.2.6

gem install rails -v=3.2.6

5、安裝mysql數(shù)據(jù)庫

yum -y install mysql-server
mv /etc/my.cnf /etc/my.cnf.bak
cp /usr/share/mysql/my-huge.cnf /etc/my.cnf
chown -R mysql.mysql /var/lib/mysql
 
/usr/bin/mysql_install_db 
service mysqld start
/usr/bin/mysqladmin -u root password '123456'
/usr/bin/mysql -u root -p123456
> create database redmine character set utf8;
> quit

6、安裝redmine

wget http://rubyforge.org/frs/download.php/76259/redmine-2.0.3.tar.gz
tar zxvf redmine-2.0.3.tar.gz
cp -rf redmine-2.0.3 /var/www/html/redmine
cd /var/www/html/redmine/config/
cp database.yml.example database.yml
vi database.yml
production:
  adapter: mysql2
  database: redmine	
  host: localhost
  username: redmine
  password: redmine
  encoding: utf8
 
## 注:文件內(nèi)的adapter項(xiàng)要寫mysql2,否則會(huì)報(bào)RuntimeError: Please install the mysql adapter: `gem install activerecord-mysql-adapter`

7、開始bundle install在執(zhí)行bundle時(shí)要監(jiān)測多項(xiàng)應(yīng)用安裝情況包括:mysql、postgresql、sqlite3、ImageMagick等,有一項(xiàng)沒安裝都會(huì)報(bào)錯(cuò),解決思路:提示安裝卻什么,就安裝什么。

yum -y install postgresql-server postgresql-devel
yum -y install ImageMagick ImageMagick-devel
yum -y install sqlite-devel
 
gem install pg -v '0.14.0'
gem install rmagick -v '2.13.1'
gem install sqlite3 -v '1.3.6'
 
bundle install --without development test		(出現(xiàn)綠字側(cè)成功)

8、配置redmine

rake generate_secret_token				(生成會(huì)話存儲(chǔ)密鑰)
RAILS_ENV=production rake db:migrate			(創(chuàng)建數(shù)據(jù)庫結(jié)構(gòu))
RAILS_ENV=production rake redmine:load_default_data	(載入默認(rèn)配置,之后會(huì)有語言選擇,選"zh")
ruby script/rails server webrick -e production		(若是想webrick像服務(wù)一樣啟動(dòng)加-d參數(shù))

9、測試

http://localhost:3000

二、集成apache
Redmine默認(rèn)使用RoR自帶的web服務(wù)器WEBrick,默認(rèn)的端口是3000,速度一般;很多人將Redmine集成到apache,nginx或 tomcat中,集成到apache通常采用CGI方式來集成,配置起來比較繁雜。Phusion Passenger組件是專門為apache和nginx開發(fā)的用來部署Ruby on Rails應(yīng)用的,配置起來非常的方便,使用下來感覺頁面的操作速度比WEBrick要快很多,本文記錄了如何安裝passenger來集成 Redmine到apache服務(wù)器。

環(huán)境信息:
CentOS6.2
Redmine 2.0.3
Passenger 3.0.14

1、安裝依賴庫

yum -y install httpd-devel apr-devel apr-util-devel

2、安裝passenger

gem install passenger
passenger-install-apache2-module

3、修改apache配置文件
passenger成功安裝后,它會(huì)給出如下的配置提示信息,需要將它們添加到apache的配置文件 /etc/httpd/conf/httpd.conf 中(不通版本目錄名稱不一樣)

vi /etc/httpd/conf/httpd.conf
LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.15/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.15
PassengerRuby /usr/local/bin/ruby

在httpd.conf中添加虛擬主機(jī):

<virtualhost *:80>
  ServerName redmine.
  ServerAdmin admin@
  DocumentRoot /var/www/html/redmine/public
  ErrorLog logs/redmine_error_log
 
  <directory "/var/www/html/redmine/public" >
    Options Indexes ExecCGI FollowSymLinks -MultiViews
    Order allow,deny
    Allow from all
    AllowOverride all
  </directory>
</virtualhost>

3、重啟apache

/etc/init.d/httpd restart

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請遵守用戶 評(píng)論公約

    類似文章 更多