Ruby Enterprise Edition+Passengerの環境構築
■VMware playerをインストール
以下からダウンロード
http://www.vmware.com/jp/products/player/
■subversionインストール
root$ yum install subversion
■Ruby Enterprise Editionをインストール
http://www.rubyenterpriseedition.com/
上記からダウンロードして
tar xzvf ruby-enterprise-1.8.6-20080621.tar.gz
解凍し
./ruby-enterprise-1.8.6-20080621/installer
でインストール
途中で
GNU C++ compiler
Zlib development
OpenSSL development
などがnot foundで怒られたのでそれらを入れて再度
./ruby-enterprise-1.8.6-20080621/installer
したらうまくいった。
■パスを通す
export PATH=$PATH:/opt/ruby-enterprise-1.8.6-20080507/bin
■PJをcheckout
svn checkout URL
でpjをチェックアウト
■sambaを設定
yum -y install samba
設定はshare/samba.txt
and
以下を参考に
http://centossrv.com/samba.shtml
http://www.miloweb.net/samba.html
http://www.geocities.jp/tatsus490824/selinux_status-change.html
http://www.nextren.com/okamoto/2007/10/centos5_samba.html
■oracle10g-instant cliantインストール
rpm -hiv oracle-instantclient-basic-10.1.0.4-1.i386.rpm
rpm -hiv oracle-instantclient-devel-10.1.0.4-1.i386.rpm
rpm -hiv oracle-instantclient-sqlplus-10.1.0.4-1.i386.rpm
でインストール、sqlplusコマンドを叩いたら下記のエラー
sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory
原因はlibsqlplus.so が見つからないとのこと
export LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.3/client/lib/
[m-matsumoto@CentOS ~]$ echo $NLS_LANG
[m-matsumoto@CentOS ~]$ export NLS_LANG=Japanese_Japan.UTF8
[m-matsumoto@CentOS ~]$ sqlplus m-matsumoto_d/m-matsumoto_d@10.6.0.99/madison
でつながることを確認
■ruby-oci8(http://ruby-oci8.rubyforge.org/ja/)のインストール
http://rubyforge.org/frs/?group_id=256
より1.0.0-rc3をインストール
tar xzvf ruby-oci8-1.0.0-rc3.tar.gz
で解凍
cd ruby-oci8-1.0.0-rc3/
make
make install
でインストール
■パス設定
source /home/m-matsumoto/.bash_profile
■ファイアフォール解除
/etc/init.d/iptables stop
で解除できる
特定のポートを解除するには
vi /etc/sysconfig/iptables
で下から3行目に
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3000 -j ACCEPT
を追加して
/etc/init.d/iptables restart
で再起動
■Passengerをインストール
gem install passenger
でインストール
Apache 2 development headers... not found
* To install Apache 2 development headers:
Please run yum install httpd-devel as root.
といわれたので
yum install httpd-devel
でインストールし再度
gem install passenger
最後下記のメッセージが出てインストール完了
-------------------------------------------- The Apache 2 module was successfully installed. Please edit your Apache configuration file, and add these lines: LoadModule passenger_module /opt/ruby-enterprise-1.8.6-20080507/lib/ruby/gems/1.8/gems/passenger-1.0.5/ext/apache2/mod_passenger.so RailsSpawnServer /opt/ruby-enterprise-1.8.6-20080507/lib/ruby/gems/1.8/gems/passenger-1.0.5/bin/passenger-spawn-server RailsRuby /opt/ruby-enterprise-1.8.6-20080507/bin/ruby 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! Press ENTER to continue. -------------------------------------------- Deploying a Ruby on Rails application: an example Suppose you have a Ruby on Rails application in /somewhere. Add a virtual host to your Apache configuration file, and set its DocumentRoot to /somewhere/public, like this: <VirtualHost *:80> ServerName www.yourhost.com DocumentRoot /somewhere/public </VirtualHost> And that's it! You may also want to check the Users Guide for security and optimization tips and other useful information: /opt/ruby-enterprise-1.8.6-20080507/lib/ruby/gems/1.8/gems/passenger-1.0.5/doc/Users guide.html Enjoy Passenger, a product of Phusion (www.phusion.nl) :-) http://www.modrails.com/