茫茫網海中的冷日
         
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已!
 恭喜您是本站第 1730418 位訪客!  登入  | 註冊
主選單

Google 自訂搜尋

Goole 廣告

隨機相片
IMG_60D_00353.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

小企鵝開談 : [轉貼]Redmine for CentOS 5.6 安裝專案管理系統

發表者 討論內容
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15773
[轉貼]Redmine for CentOS 5.6 安裝專案管理系統

Redmine for CentOS 5.6 安裝專案管理系統

由於工作的關係,又接觸到了這個從前聽說過的專案管理系統Redmine,這是一套由Ruby程式設計而成的管理工具,提供多使用者管理多個專案,藉由群組或使用者的權限控管使用行為,不過在較嚴謹的CentOS上安裝這套工具還真讓我吃了不少苦頭呢 ,首先是Redmine並不屬於LAMP環境下可直接安裝的網頁程式,再來就是已經習慣Ubuntu這種智慧型自動化的安裝模式,讓我有點感覺又回到了3年前碰SuSE的苦力生活呢!

 

 

1.Web Service

# yum install httpd httpd-devel

 

2.MySQL Service


# yum install mysqld mysql-devel mysql-server
# chkconfig --levels 235 mysqld on
# service mysqld start

 

3.Php install(若要使用phpMyAdmin管理MySQL的話才需要安裝 )

# yum install php php-mysql php-mbstring php-mcrypt php-gd

 

4.Ruby install ( 下載較新版的Ruby for CentOS 5.6 )

# Ruby -v
# cd /etc/yum.repos.d
# wget http://rubyworks.rubyforge.org/RubyWorks.repo
# yum install ruby
# yum install ruby-devel.x86_64 ruby-docs.x86_64 ruby-rdoc.x86_64

 

5.RubyGem install

# cd /opt
# wget http://production.cf.rubygems.org/rubygems/rubygems-1.4.2.tgz
# tar zxvf rubygems-1.4.2.tgz
# ruby ./rubygems-1.4.2/setup.rb

 

6.Redmine 
主程式下載

# cd /var/www/html
# wget http://rubyforge.org/frs/download.php/74722/redmine-1.1.3.tar.gz
# tar zxvf redmine-1.1.3.tar.gz
# mv redmine-1.1.3 ./redmine

 

7.Bundler & Gemfile

# gem install bundler
# vi /var/www/html/readmine/Gemfile

貼上以下文字...
source :rubygems
source " http://rubygems.org"
source :rubyforge
source " http://gems.rubyforge.org"
source :gemcutter
source "
http://gemcutter.org"
gem "rake", "0.8.3"
gem "rack", "1.0.1"
gem "i18n", "0.4.2"
gem "rubytree", "0.5.2", :require => "tree"
gem "RedCloth", "~>4.2.3", :require => "redcloth" # for CodeRay
gem "mysql"
gem "coderay", "~>0.9.7"

 

8.Rails install

# gem install rails -v=2.3.11 --no-ri --no-rdoc
# gem install i18n -v=0.4.2 --no-ri --no-rdoc
# gem install mysql --no-ri --no-rdoc
# gem install cgi_multipart_eof_fix --no-ri --no-rdoc
# gem install coderay --no-ri --no-rdoc

 

9.bundle install

# cd /var/www/html/redmine
# bundle install

 

10.Create Database


# mysql -u root -p 
Mysql> create database redmine character set utf8;
Mysql> exit

 

11.Redmine setting

# cp /var/www/html/redmine/config/database.yml.example /var/www/html/redmine/config/database.yml

請在database.yml中填入mysql相對應帳戶細節...

 

# cd /var/www/html/redmine
# RAILS_ENV=production bundle exec rake generate_session_store
# RAILS_ENV=production bundle exec rake db:migrate
# RAILS_ENV=production bundle exec rake redmine:load_default_data

Run redmine ( 網頁端口預設為3000 )
也可將這行指令寫在rc.local以便每次開機後都會自動執行!
# ruby script/server -e production

 

 

 

Redmine操作與使用

於瀏覽器URL處輸入server IP,埠號3000,利用web介面登入Redmine系統。

 

Admin登入 ( 密碼admin ) 後可以看到目前Redmine上進行中的專案。

 

Admin或管理人員群組的會員可以創建新專案。

 

進入剛剛建立好的專案頁面如下。

 

管理人員可以將所需會員加入此專案並分派成員角色權限。

 

專案中的成員可依權限建立專案中的功能、Bug等事項。

 

從該專案清單中可以條列所有相關事項

 

以甘特圖壓著版本來看專案中的事項狀態,一目瞭然!

 

從專案裡的「版本藍圖」可以知道專案的整體進度。

 

Redmine也細心的為每一個專案提供了簡易論壇的功能。

 

而在會員的帳戶首頁,也可以清楚看到被指派或自行通報的事項。

Redmine這套專案管理系統並非三言兩語可以介紹完畢,還是需要專案經理的設計、理解與實際使用才能真正讓工具與現實做結合,在這裡就只做個簡單的介紹,祝大家使用愉快喔!


原文出處:Redmine for CentOS 5.6 安裝專案管理系統
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15773
[轉貼]在CentOS 5.6安裝Ruby及Redmine

image20 在CentOS 5.6安裝Ruby及Redmine

又是因為工作需要,突然需要碰Redmine這套專案管理系統,但是可以動用的主機已經使用了CentOS,所以我必須在CentOS上安裝Ruby等相關Redmine所需的相關軟體。

安裝前你必須先:

  • 安裝好MySQL
  • MySQL可以新增資料庫並正常運作中
  • 有root權限


步驟上大致有:

  • 安裝Ruby
  • 安裝RubyGems
  • 下載Redmine
  • 安裝Bundler
  • 設定Redmine

在CentOS安裝Ruby

透過官方FTP下載安裝,首先先進入到你要存放的位置,然後使用anonymous帳號登入到
ftp.ruby-lang.org,並且進入到/pub/ruby資料夾中,下載版本ruby-1.8.7-p334.tar.gz。FTP登入相關指令如下:

cd ~/Downloads  #先到你要擺放下載的資料夾
ftp ftp.ruby-lang.org
anonymous
cd /pub/ruby
get ruby-1.8.7-p334.tar.gz
quit

畫面如下:

image17 在CentOS 5.6安裝Ruby及Redmine

解壓縮:

tar zxvf ruby-1.8.7-p334.tar.gz ruby-1.8.7-p334

設定系統組態:

cd ruby-1.8.7-p334
./configure

image12 在CentOS 5.6安裝Ruby及Redmine

安裝Ruby

make
make install


image13 在CentOS 5.6安裝Ruby及Redmine

安裝完成後檢查

安裝完成後,不需要重新開機即可使用以下指令檢查是否已經正常安裝,ruby -v指令可以查看目前所安裝的ruby版本,which ruby可以得知目前ruby程式在哪個資料夾中。
ruby -v
ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-linux]
which ruby
/usr/local/bin/ruby

image07 在CentOS 5.6安裝Ruby及Redmine

在CentOS安裝RubyGems

可以透過wget指令下載rubygems版本,由於在redmine官方網站有提到,目前redmine與rubygems 1.5不相容,所以請下載1.4.2版本即可(在寫這份文件時,最新版本為1.8.4,如要試驗最新版本,也可以到 https://rubyforge.org/projects/rubygems/ 去搜尋,在這邊以1.4.2版本為例)。

wget
http://production.cf.rubygems.org/rubygems/rubygems-1.4.2.tgz

image21 在CentOS 5.6安裝Ruby及Redmine

下載後解壓縮及安裝

tar zxvf rubygems-1.4.2.tgz rubygems-1.4.2
cd rubygems-1.4.2
ruby setup.rb

安裝後可以執行gem -v確認目前安裝版本,以及gem安裝位置,都可正常執行代表已經安裝成功。

gem -v
1.4.2
which gem
/usr/local/bin/gem
cd ..

image06 在CentOS 5.6安裝Ruby及Redmine

下載Redmine

在撰寫這份文件時,Redmine最新版本為1.1.3,如有需要最新版本,可以到
http://www.redmine.org/projects/redmine/wiki/Download 去找尋。可以透過wget方式下載最新版本。

wget http://rubyforge.org/frs/download.php/74722/redmine-1.1.3.tar.gz 

解壓縮Redmine與搬移至安裝路徑

tar zxvf redmine-1.1.3.tar.gz redmine-1.1.3

由於接下來要與Apache整合,所以我將redmine安裝至apache放置網頁的位置中,以centos上面的路徑為例就是/var/www底下。建立資料夾後,就可以將解壓縮完成的redmine搬移到該資料夾中。

mkdir /var/www/redmine
cd redmine-1.1.3
mv * /var/www/redmine

在CentOS安裝Bundler與設定

gem install bundler

image16 在CentOS 5.6安裝Ruby及Redmine

建立bundler所需要的Gemfile


Gemfile檔案的建立可以讓軟體在安裝時,避免軟體之間的衝突,所以會設定一些下載路徑及版本需求等。更多細節可以參考( http://gembundler.com/ )
來到要安裝Redmine的資料夾中,建立Gemfile檔案。

cd /var/www/redmine
vi Gemfile

source :rubygems
source "http://rubygems.org"
source :rubyforge
source "http://gems.rubyforge.org"
source :gemcutter
source "http://gemcutter.org"
gem "rake", "0.8.3″
gem "rack", "1.0.1″
gem "i18n", "0.4.2″
gem "rubytree", "0.5.2″, :require => "tree"
gem "RedCloth", "~>4.2.3″, :require => "redcloth" # for CodeRay
gem "mysql"
gem "coderay", "~>0.9.7″

image23 在CentOS 5.6安裝Ruby及Redmine

開始安裝相關Library

bundle install


這個部分執行的時間會比較久,執行完畢會有如下畫面:

image14 在CentOS 5.6安裝Ruby及Redmine

如果執行出現如下的錯誤:

Building native extensions. This could take a while…
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for mysql_ssl_set()… *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

請重新安裝msyql

yum remove mysql
yum install mysql
yum install mysql-devel
yum isstall mysql-server

然後再執行bundle install
如果出現「No definition for next_result 」訊息,請安裝ri及rdoc然後再bundle install

gem install ri rdoc


你也可以單獨試著安裝gem mysql library使用以下指令,正常安裝的畫面如下:

gem install mysql — \
–with-mysql-include=/usr/include/mysql \
–with-mysql-lib=/usr/lib/mysql

建立Redmine所需資料庫

確定mysql是否已經以服務的形態啟動,如果還沒啟動,請使用

service mysqld start

啟動,並且設定mysql為開機時自動啟用。

chkconfig mysqld on

建立redmine資料庫

mysql -u root -p
create database redmine character set utf8;
exit

設定Redmine資料庫設定檔

cd /var/www/redmine/config
cp database.yml.example database.yml

image11 在CentOS 5.6安裝Ruby及Redmine

產生Redmine所需的Session Store

cd /var/www/redmine
RAILS_ENV=production bundle exec rake generate_session_store

image02 在CentOS 5.6安裝Ruby及Redmine

Migrate the Database models

RAILS_ENV=production bundle exec rake db:migrate

載入Redmine預設資料

RAILS_ENV=production bundle exec rake redmine:load_default_data

安裝至此你已經可以透過ruby script/server -e production查看Redmine是否安裝正常了。

ruby script/server -e production

可以從 http://127.0.0.1:3000看到目前的網站已經正常執行。(圖片中開的是8080port已經是我與apache整合之後的畫面了)

image20 在CentOS 5.6安裝Ruby及Redmine

值得一提的,由於使用指令執行Ruby無法在系統開機時,就預設啟動,所以在這邊我們還必須要跟Apache做整合,使其為Apache的一個站台。不過這是下一篇所要介紹的內容了。


原文出處:在CentOS 5.6安裝Ruby及Redmine | 墨嗓的資訊筆記
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15773
[轉貼]安裝 Redmine 專案管理系統

安裝 Redmine 專案管理系統

Redmine 是一套使用 Ruby 語言開發的專案管理系統,它非常好用!
在 Ubuntu 環境安裝 Redmin 專案管理系統,需要先佈置好 Ruby 環境。
可以參考:http://zx-1986.blogspot.com/2010/09/ruby-on-rails-in-ubuntu.html

[LAMP 環境]
架設 Ubuntu Web Server

[安裝 Ruby]

sudo apt-get install ruby
sudo apt-get install ruby-dev
sudo apt-get install irb libruby libopenssl-ruby ri rdoc
sudo apt-get update

[安裝 RubyGems]

sudo su -
cd /opt
wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz
tar zxvf rubygems*
cd rubygems*
ruby --version
ruby setup.rb --help
ruby setup.rb
ln -s /usr/bin/gem1.8 /usr/bin/gem

sudo apt-get install rubygems
# 註:如果可以,盡量使用 Ruby 來編譯安裝 RubyGems


[安裝需要的 Gems]

sudo su -
gem install -v=0.8.7 rake
gem install -v=1.1.1 rack
gem install -v=0.4.2 i18n
gem install -v=2.3.11 rails
# 註:打包好的 Redmine 內(非原始碼包)已經自帶了 Rails(vendor/rails)
# Gems 預設會放在:/usr/lib/ruby/gems/1.8

[SQLite 資料庫]
假設是使用 sqlite3,需要補充必要套件:

sudo apt-get install sqlite3 sqlite3-doc
sudo apt-get install libsqlite3-ruby


[下載 Redmine 程式]

cd /var/www/
wget http://rubyforge.org/frs/download.php/75099/redmine-1.2.1.zip
unzip redmine*.zip
mv redmine*.zip /tmp
mv redmine* redmine


使用 svn 直接同步 Redmine 的線上原始檔,所以先安裝 svn:
sudo apt-get install subversion

假設要將 Redmine 部署在 /var/www/ 底下,執行:
cd /var/www
svn checkout http://redmine.rubyforge.org/svn/branches/1.1-stable redmine-1.1


[Redmine 的資料庫設定]
修改 conf 資料夾下的 database.yml:

cd /var/www/redmine/config
cp database.yml.example database.yml
vim database.yml
將 database.yml 預設 MySQL (default setup) 內容全部註解起來。
檔案最開頭,補上:

production:
adapter: sqlite3
database: db/redmine.db
development:
adapter: sqlite3
database: db/redmine.db

[相關的資料夾設置]

cd /var/www/redmine
mkdir -p tmp public/plugin_assets
sudo chown -R www-data.www-data files log tmp public/plugin_assets
sudo chmod -R 755 files log tmp public/plugin_assets

[執行 Rake 進行部署]

chown -R www-data.www-data /var/www/redmine  # 避免權限問題,把 Redmine 給 HTTP Server 控制者
cd /var/www/redmine
ruby script/about
/var/lib/gems/1.8/bin/rake generate_session_store # Ubuntu Desktop
RAILS_ENV=production /var/lib/gems/1.8/bin/rake db:migrate
RAILS_ENV=production /var/lib/gems/1.8/bin/rake redmine:load_default_data
Ubuntu 系統預設不會把 /var/lib/gems/1.8/bin 加到環境路徑。
所以呼叫 Rake 程式時,需要使用絕對路徑:/var/lib/gems/1.8/bin/rake
當然,你可以選擇把這個路徑加到系統的 PATH 變數 [Ref. 03]。
或者,直接使用 apt-get 安裝一個系統層級的 Rake 套件,但不建議 [Ref. 04]。

在 Ubuntu Server 版的環境中,Rake 的絕對路徑預設是:
/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake

[測試 Redmine]
使用 Ruby 附帶的 WEBrick Web Server 測試啓動 Redmine:

cd /var/www/redmine
ruby script/server webrick -e production

預設的連結是本地端的 3000 埠:
http://localhost:3000

預設管理者的帳號密碼是:
admin/admin

Redmine 佈景主題安裝很簡單,推薦一個不錯的:
Pixel Cookers
將佈景主題下載到 /var/www/redmine/public/themes 下,解壓縮就可以用了。

Redmine 主頁面的 html 可以修改這個檔案:
/var/www/redmine/app/views/layouts/base.rhtml



【run with Apache】

補充必要套件:

sudo apt-get install build-essential
sudo apt-get install apache2-prefork-dev libaprutil1-dev libapr1-dev libcurl4-openssl-dev

使用 RubyGems 安裝 Phusion Passenger 及其 Passenger Apache2 Module。
Passenger 也叫做 mod_rails 或 mod_rack,類似 mod_ruby 那種角色。
Passenger Apache2 Module 安裝過程會出現互動選項,請務必謹慎閱讀與選擇。
不同環境的執行結果或許有出入,以下僅記錄我個人環境執行的訊息:

sudo gem install passenger
sudo /var/lib/gems/1.8/bin/passenger-install-apache2-module

Passenger Apache2 Module 安裝開始時的貼心說明:

Here's what you can expect from the installation process:
1. The Apache 2 module will be installed for you.
2. You'll learn how to configure Apache.
3. You'll learn how to deploy a Ruby on Rails application.
# 安裝會完成的三件事。
Don't worry if anything goes wrong. This installer will advise you on how to solve any problems.
# 都說 do not worry 了,那就 do not worry 吧!哈哈!
# 如果真的出現什麼問題,就照它指示的修正,然後再重新執行安裝。

編譯與佈置完成後出現的訊息:

The Apache 2 module was successfully installed.
Please edit your Apache configuration file, and add these lines:
# 下面這三行是要寫到 /etc/apache2/apache2.conf 的。
LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-3.0.2/ext/apache2/mod_passenger.so
PassengerRoot /var/lib/gems/1.8/gems/passenger-3.0.2
PassengerRuby /usr/bin/ruby1.8
After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific
configuration!
--------------------------------------------
Deploying a Ruby on Rails application: an example
Suppose you have a Rails application in /somewhere. Add a virtual host to your
Apache configuration file and set its DocumentRoot to /somewhere/public:
# 在 /etc/apache2/sites-available 底下新增一個檔案叫:redmine
# 並且把底下這段複製貼到 redmine 這個虛擬主機設定檔
<virtualhost *:80>
ServerName www.yourhost.com
DocumentRoot /somewhere/public # <-- be sure to point to 'public'!
<directory /somewhere/public>
AllowOverride all # <-- relax Apache security settings
Options -MultiViews # <-- MultiViews must be turned off
</Directory>
</VirtualHost>
# 注意!裡面的 /somewhere/public 要改成 /var/www/redmine/public 的絕對路徑
# ServerName 可以設定成 localhost
# 因爲技術問題,請自行把上文全形的<>換成 <>

當 /etc/apache2/apache2.conf 與 /etc/apache2/site-available/redmine 都配置好。
執行:

sudo chown -R www-data:www-data /var/www/redmine
sudo a2ensite redmine
sudo service apache2 restart

連線 http://localhost:80 測試。

Reference:
01. http://www.redmine.org/projects/redmine/wiki/RedmineInstall
02. http://www.redmine.org/projects/redmine/wiki/RedmineRepositories
03. http://stackoverflow.com/questions/1664974/rake-command-not-found
04. http://fak3r.com/geek/ruby-on-rails-gem-install-versus-apt-get
05. http://www.redmine.org/issues/8325
06. http://www.redmine.org/boards/2/topics/26138
07. http://jugemchosuke.blogspot.com/2011/06/redmine-1.html

原文出處:張旭: 安裝 Redmine 專案管理系統
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15773
[轉貼]在CentOS 5.6 讓Redmine運作於Apache Virtual Host

在CentOS 5.6 讓Redmine運作於Apache Virtual Host

發表於 2011 年 06 月 14 日 mouson | 974 Views |

image05 在CentOS 5.6 讓Redmine運作於Apache Virtual Host

前一篇文章已經說明了如何在 沒有Ruby環境的CentOS從無到有安裝Redmine,現在這一篇主旨在與Apache 2整合,使Redmine可以在系統開機時,就啟動服務。在Redmine的官方文件中有提到一些,但是並不完整,後來在網路上 看到了這一篇,再加上
官方文件,併在一起看,終於完成了在CentOS 5.6上整合Apache與Redmine。

以下就說明我自己的步驟,與遇到的問題解決。

1. 設定Redmine

Rename CGI File

到redmine資料夾中的public資料夾

cd /var/www/redmine/public
mv dispatch.cgi.example dispatch.cgi
mv dispatch.fcgi.example dispatch.fcgi
mv dispatch.rb.example dispatch.rb
mv htaccess.fcgi.example .htaccess

image27 在CentOS 5.6 讓Redmine運作於Apache Virtual Host

修改redmine資料夾的權限與所有人

cd /var/www
chown -R apache:apache redmine
chmod -R 755 redmine

修改dispatch.cgi

cd /var/www/redmine/public
vi dispatch.cgi

把原本的


#! /usr/bin/env: ruby

修改為:

#! /usr/local/bin/ruby

你在修改之前也可以在確認一次你的Ruby程式擺在哪裡,可以在一般終端機模式下ruby -v確認。

image19 在CentOS 5.6 讓Redmine運作於Apache Virtual Host

確認dispatch.cgi的權限為755

chmod 755 dispatch.cgi

修改config/environment.rb文件的rails環境

vi environment.rb

移除Uncomment ENV['RAILS_ENV'] ||= ‘production’ (刪除# 號)

image09 在CentOS 5.6 讓Redmine運作於Apache Virtual Host

在/etc/httpd/conf.d/底下建立redmine.conf

vi /etc/httpd/conf.d/redmine.conf


<VirtualHost *:8080>
DocumentRoot /var/www/redmine/public
ErrorLog logs/redmine_error_log
<directory /var/www/redmine/publie >
Options Indexes ExecCGI FollowSymLinks
Order allow,deny

Allow from all

AllowOverride all
</directory>
</VirtualHost>

image26 在CentOS 5.6 讓Redmine運作於Apache Virtual Host

2. 安裝 passenger

gem install passenger

image10 在CentOS 5.6 讓Redmine運作於Apache Virtual Host

passenger-install-apache2-module

出現以下畫面,請按Enter


image04 在CentOS 5.6 讓Redmine運作於Apache Virtual Host

接下來會確認你的環境還少些什麼元件。會出現類似以下的畫面:

image25 在CentOS 5.6 讓Redmine運作於Apache Virtual Host

紅字的部份也就是你缺少或有問題的元件,請繼續按Enter,接下來會出現教你怎麼安裝這些缺少的元件的畫面。

image00 在CentOS 5.6 讓Redmine運作於Apache Virtual Host

以我的系統而言,就是缺少Rake和一些apache所需要的元件,所以以下會安裝Rake和http-devel。

首先安裝Rake

執行以下指令安裝

gem install rake


image03 在CentOS 5.6 讓Redmine運作於Apache Virtual Host

安裝http-devel

使用root執行指令,執行以下指令

yum install httpd-devel

image28 在CentOS 5.6 讓Redmine運作於Apache Virtual Host

執行的時候,可以發現除了httpd-devel因為相依性的關係,連帶接下來要安裝的apr-devel和apr-util-devel也一下下載安裝了。

image29 在CentOS 5.6 讓Redmine運作於Apache Virtual Host

沒有安裝的元件都已安裝,此時可以再執行一次:

passenger-install-apache2-module


image24 在CentOS 5.6 讓Redmine運作於Apache Virtual Host

就可以通過測驗,正常安裝了,看到這個畫面,請注意並且記住您的passenger-3.0.7的路徑在哪邊,待會會用到,接著請按Enter繼續。接下來可以看到提醒,配置apache應該要如何對應的訊息。

image08 在CentOS 5.6 讓Redmine運作於Apache Virtual Host

建立passenger.conf文件

請在/etc/httpd/conf.d/底下建立passenger.conf

vi /etc/httpd/conf.d/passenger.conf

輸入以下內容

LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.7/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.7
PassengerRuby /usr/local/bin/ruby


請確認你的passenger安裝路徑是否正確,可能會有版本不同的問題。

image18 在CentOS 5.6 讓Redmine運作於Apache Virtual Host

修改 redmine.conf 文件

vi /etc/httpd/conf.d/redmine.conf

<VirtualHost *:8080>
DocumentRoot /var/www/redmine/public
ErrorLog logs/redmine_error_log
<directory /var/www/redmine/publie >
AllowOverride all
Options -MultiViews
</directory>
</VirtualHost>

主要是刪除Options、Order、Allow這些選項,然後加入Option –MultiViews

image26 在CentOS 5.6 讓Redmine運作於Apache Virtual Host

因為使用Apache Port Based的VistualHost,所以請記得回到
/etc/httpd/conf/httpd.conf

增加要Listen的port 8080

image22 在CentOS 5.6 讓Redmine運作於Apache Virtual Host

接著重新啟動apache服務

service httpd restart

就可以看到與apache2整合的redmine了

image05 在CentOS 5.6 讓Redmine運作於Apache Virtual Host

參考連結:



原文出處:在CentOS 5.6 讓Redmine運作於Apache Virtual Host | 墨嗓的資訊筆記
冷日
(冷日)
Webmaster
  • 註冊日: 2008/2/19
  • 來自:
  • 發表數: 15773
[分享]冷日在CentOS上安裝Redmine的過程
冷日今天測試安裝了一個Redmine。
這裡把冷日的過程記錄下來:

首先,先把ruby相關的東西裝起來:
# yum -y install ruby
# yum -y install ruby-devel
# yum -y install ruby-docs
# yum -y install ruby-rdoc
# yum -y install rubygems


但是呢,rubygems用yum裝的是1.3.x(忘記抄版本了)
所以還是要乖乖的去裝1.4.2:
# wget http://rubyforge.org/frs/download.php/73882/rubygems-1.4.2.tgz
# tar -zxvf rubygems-1.4.2.tgz
# ruby ./setup.rb
RubyGems 1.4.2 installed

順帶一題,冷日安裝時,看到rubygems的最新版本是1.8.11,但這個版本裝起來也怪怪低(應該是因為官方說redmine和rubygems1.5以上不合),所以還是乖乖的裝1.4.2吧!

再來就是redmine的安裝:
# wget --no-check-certificate https://rubyforge.org/frs/download.php/75518/redmine-1.2.2.tar.gz
# tar -zxvf redmine-1.2.2.tar.gz
# mv redmine-1.2.2 redmine
# chown -Rf apache:root redmine && chmod -Rf 0774 redmine
# cd redmine
# gem install bundler
Successfully installed bundler-1.0.21
1 gem installed
Installing ri documentation for bundler-1.0.21...
Installing RDoc documentation for bundler-1.0.21...


redmine裝完以後,要幫他作gem設定檔:
# vi Gemfile
source :rubygems
source "http://rubygems.org"
source :rubyforge
source "http://gems.rubyforge.org"
source :gemcutter
source "http://gemcutter.org"
gem "rake", "0.8.7"
gem "rack", "1.1.1"
gem "i18n", "0.4.2"
gem "rubytree", "0.5.2", :require => "tree"
gem "RedCloth", "~>4.2.3", :require => "redcloth" # for CodeRay
gem "mysql"
gem "coderay", "~>0.9.7"
gem "rails", "2.3.11"


然後是用gem安裝一些必須的環境:
# gem install rails -v=2.3.11 --no-ri --no-rdoc
Fetching: rake-0.9.2.2.gem (100%)
Fetching: activesupport-2.3.11.gem (100%)
Fetching: activerecord-2.3.11.gem (100%)
Fetching: rack-1.1.2.gem (100%)
Fetching: actionpack-2.3.11.gem (100%)
Fetching: actionmailer-2.3.11.gem (100%)
Fetching: activeresource-2.3.11.gem (100%)
Fetching: rails-2.3.11.gem (100%)
Successfully installed rake-0.9.2.2
Successfully installed activesupport-2.3.11
Successfully installed activerecord-2.3.11
Successfully installed rack-1.1.2
Successfully installed actionpack-2.3.11
Successfully installed actionmailer-2.3.11
Successfully installed activeresource-2.3.11
Successfully installed rails-2.3.11
8 gems installed

# gem install i18n -v=0.4.2 --no-ri --no-rdoc
Fetching: i18n-0.4.2.gem (100%)
Successfully installed i18n-0.4.2
1 gem installed

#  gem install mysql --no-ri --no-rdoc
Fetching: mysql-2.8.1.gem (100%)
Building native extensions.  This could take a while...
Successfully installed mysql-2.8.1
1 gem installed

# gem install cgi_multipart_eof_fix --no-ri --no-rdoc
Fetching: cgi_multipart_eof_fix-2.5.0.gem (100%)
Successfully installed cgi_multipart_eof_fix-2.5.0
1 gem installed

# gem install coderay --no-ri --no-rdoc
Fetching: coderay-1.0.4.gem (100%)
Successfully installed coderay-1.0.4
1 gem installed


這裡大家可以看到,一開駛向上面那樣安裝的話rack版本是1.0.1的時候,後面會有問題!
# bundle install
Fetching source index for http://rubygems.org/
Fetching source index for http://rubygems.org/
Fetching source index for http://rubygems.org/
Fetching source index for http://gems.rubyforge.org/
Fetching source index for http://rubygems.org/
Fetching source index for http://gemcutter.org/
Installing rake (0.8.3)
Installing RedCloth (4.2.8) with native extensions
Installing coderay (0.9.8)
Installing hoe (2.12.3)
Using i18n (0.4.2)
Using mysql (2.8.1)
Installing rack (1.0.1)
Installing rubytree (0.5.2)
Using bundler (1.0.21)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.


因為rack版本的不符,所以要特別裝(更新)一次rack:
# gem install -v=0.8.7 rake
# gem install -v=1.1.1 rack
# gem install -v=0.4.2 i18n
# gem install -v=2.3.11 rails
# bundle update rake

最後那個update是安裝後建議我更新低,當然就乖乖更新囉!

再執行bundle install的話,就可以看到rack已經更新為1.1.1了,冷日是這樣才OK低:
# bundle install
Using rake (0.8.7)
Using RedCloth (4.2.8)
Using activesupport (2.3.11)
Using rack (1.1.1)
Using actionpack (2.3.11)
Using actionmailer (2.3.11)
Using activerecord (2.3.11)
Using activeresource (2.3.11)
Using coderay (0.9.8)
Using hoe (2.12.3)
Using i18n (0.4.2)
Using mysql (2.8.1)
Using rails (2.3.11)
Using rubytree (0.5.2)
Using bundler (1.0.21)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.


新增mysql資料庫:
# mysql -u root -p
Mysql> create database redmine character set utf8;
Mysql> exit


再來設定redmine的資料庫連結設定檔:
# cd config
# cp database.yml.example database.yml
# vi database.yml
# MySQL (default setup).

production:
  adapter: mysql
  database: {your database name(default:redmine)}
  host: {your database address}
  username: {your username that can access the database you set before}
  password: {your password that pair of the username you set before}
  encoding: utf8

development:
  adapter: mysql
  database: {your database name(default:redmine_development)}
  host: {your database address}
  username: {your username that can access the database you set before}
  password: {your password that pair of the username you set before}
  encoding: utf8

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: mysql
  database: redmine_test
  host: localhost
  username: root
  password:
  encoding: utf8

test_pgsql:
  adapter: postgresql
  database: redmine_test
  host: localhost
  username: postgres
  password: "postgres"

test_sqlite3:
  adapter: sqlite3
  database: db/test.sqlite3


最後三個動作:
產生Redmine所需的Session Store
# RAILS_ENV=production bundle exec rake generate_session_store

Migrate the Database models
# RAILS_ENV=production bundle exec rake db:migrate

載入Redmine預設資料
# RAILS_ENV=production bundle exec rake redmine:load_default_data


上述如果都沒有錯誤的話,就可以啟動redmine來玩囉:
# ruby script/server -e production


補充:
Redmine的官方下載:https://rubyforge.org/frs/?group_id=1850&release_id=46368
rubygems官方下載:http://rubyforge.org/frs/?group_id=126
前一個主題 | 下一個主題 | 頁首 | | |



Powered by XOOPS 2.0 © 2001-2008 The XOOPS Project|