2009-05-10 Sun

[別の年の同じ日: 2003 2004 2006 2007 2008 2010

Sinatra + Passenger はてぶ

Passenger 経由で Sinatra で作ったアプリケーションにアクセスするには,
アプリケーションのあるディレクトリに
1. config.ru
2. public ディレクトリ
3. tmp ディレクトリ
を用意する.

config.ru の内容は

require 'app' # Sinatra アプリケーション
run Sinatra::Application


あとは httpd.conf に

<VirtualHost sinatra.example.com>
  ServerName sinatra.example.com
  DocumentRoot /path/to/SinatraApp/public
</VirtualHost>


などと書いておけばよい.

- Sinatraで鼻歌まじりのWeb開発
  http://www.slideshare.net/dara/sinatraweb?type=powerpoint
- Phusion Passenger をインストール [2009-05-10-2]

Phusion Passenger をインストール はてぶ

Rails アプリケーションを実行するための Apache モジュール Phusion Passenger をインストールしてみました.

インストール

# gem install passenger
# passenger-install-apache2-module # Apache モジュールのビルドとインストール


passenger-install-apache2-module で,
以下のような設定情報がでるので,これをもとに httpd.conf を書き換え.

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


<VirtualHost *:80>
  ServerName www.yourhost.com
  DocumentRoot /somewhere/public    # <-- be sure to point to 'public'!
</VirtualHost>


httpd.conf を書き換えて Apache を再起動しようとしたところ,
以下のエラーがでて起動できない.

 *** Passenger ERROR (ext/common/ApplicationPoolServer.h:602):
 Cannot execute /usr/lib/ruby/gems/1.8/gems/passenger-2.2.2/ext/apache2/ApplicationPoolServerExecutable: Permission denied (13)


- Re: Passenger 2.0.4 + Rails 2.2.2 + Centos 5.2 (Xen) = Help needed... - dlepage - com.googlegroups.phusion-passenger - MarkMail
  http://markmail.org/message/ukx2u5jr54nr4jbx
によると,SElinux が悪いらしいので,

# setenforce 0


すれば OK.

Referrer (Inside):
[2009-05-10-3] Sinatra + Passenger

Redmine をインストールしてみる はてぶ

mysqladmin -u root create redmine


cp config/database.yml.example config/database.yml
rake db:migrate RAILS_ENV=production
rake load_default_data RAILS_ENV=production