すでに導入しているSubversionと連携するチケット管理システムの導入を検討しておったのですが、Tracを試すも微妙に日本語化が大変だったりした割に連携部分でなんかトラブったため、目先を変えてRedmineを試そうと。
1.とりあえず新しいRubyを入れとく
# wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz # tar xvfz ruby-1.8.7-p72.tar.gz # cd ruby-1.8.7-p72 # ./configure # make # make install
WebARENAにもともと導入されているRuby(1.8.1)は/usr/binにいますが、新しいRubyは/usr/local/binにインストールされます。(場合によってはpathを張りなおしてbashリロードが必要かも)
2.Rubygemsを入れる
# wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz # tar xvfz rubygems-1.3.1.tgz # cd rubygems-1.3.1 # ruby setup.rb
3.Ruby on Railsを入れる
RedmineはRoR上で作られたアプリケーションです。
# gem install rails --include-dependencies
4.Redmine
# wget http://rubyforge.org/frs/download.php/49319/redmine-0.8.0.tar.gz # tar xvfz redmine-0.8.0.tar.gz # cd redmine-0.8.0/config # vi database.yml -------------------- (追加) production: adapter: sqlite3 dbfile: db/redmine.db -------------------- # rake db:migrate RAILS_ENV=production (in /root/redmine-0.8.0) rake aborted! no such file to load -- openssl
(See full trace by running task with --trace) opensslがロードできませんエラーになっちゃいました。
5.RubyのOpenSSL拡張を確認する
http://d.hatena.ne.jp/hata-hata/20080416を参考にさせていただきました。
# cd ~/ruby-1.8.7-p72/ext/openssl # ruby extconf.rb === OpenSSL for Ruby configurator === === Checking for system dependent stuff... === checking for t_open() in -lnsl... no checking for socket() in -lsocket... no checking for assert.h... yes === Checking for required stuff... === checking for openssl/ssl.h... no === Checking for required stuff failed. === Makefile wasn't created. Fix the errors above. (ssl.hがないようなので、OpenSSLパッケージのバージョンを確認してソースコードをインストール) # rpm -qa | grep openssl openssl-0.9.7a-43.17.el4_7.2 # yum install openssl-devel-0.9.7a-43.17.el4_7.2 # ruby extconf.rb (Makefileが生成されればok) # make # make install # ruby -r openssl -e "" (何も表示されなければok)
6.Redmine(再)
# cd ~/redmine-0.8.0/config # rake db:migrate RAILS_ENV=production # rake load_default_data RAILS_ENV=production (対話式でロケールをたずねてくるのでjaでこたえる)
7.とりあえずRedmineを起動してみる
RoRアプリに付属しているWebサーバWEBrickを使ってとりあえず動作確認をする。
# cd ~/redmine-0.8.0 # script/server -e production ポート3000にアクセスしてRedmineログインページが表示されればok
8.RoRとapacheを連携させる
Redmineをapacheで動かす設定。まずRoRをapache上で動かすためのモジュール、Phusion Passengerを入れる。
# gem install passenger # passenger-install-apache2-module ・・・ Checking for required software...
* GNU C++ compiler... not found * Ruby development headers... found * OpenSSL support for Ruby... found * RubyGems... found * Rake... found at /usr/local/bin/rake * Apache 2... found at /usr/sbin/httpd * Apache 2 development headers... not found * Apache Portable Runtime (APR) development headers... found * Apache Portable Runtime Utility (APR) development headers... found * fastthread... found * rack... found Some required software is not installed. But don't worry, this installer will tell you how to install them.
Press Enter to continue, or Ctrl-C to abort. ・・・ おっと今度はg++とapacheのソースコードがないと。 # yum install gcc-c++ # yum install httpd-devel # passenger-install-apache2-module
9.apacheの設定
Phusion Passengerを入れた時にコンソールにhttpd.confの設定例を表示してくれるので、それを参考に適当に設定。公開するディレクトリのPermissonに注意ね。以上