インストールした Ruby on Rails を、Apache の CGI 経由で呼び出してみた。
public_html 下の rails でアクセスできるよう、以下のように設定。
・/etc/httpd/conf/httpd.conf に以下を追加。
<Directory /home/*/public_html>
Options +FollowSymLinks
AllowOverride all
</Directory>
・シンボリックリンク作成
% cd public_html
% ln -s ~/rails/Bookmarker/public rails
これで動かしてみると、動かなかった。
/etc/httpd/logs/error.log を見ると、
File does not exist: /home/httpd/html/home/pie001/rails/Bookmarker/public/index.html とか出てる。見ているパスが変だ。
調べてみると、Alias ディレクティブとかで使う場合、RewriteBase を設定しないといけないらしい。
・public/.htaccess に以下を追加
RewriteBase /~pie001/rails
これで動くようになった。
しかし、確かに遅い。。表示に数秒かかる。
FastCGI を使ってみるか。
public_html 下の rails でアクセスできるよう、以下のように設定。
・/etc/httpd/conf/httpd.conf に以下を追加。
<Directory /home/*/public_html>
Options +FollowSymLinks
AllowOverride all
</Directory>
・シンボリックリンク作成
% cd public_html
% ln -s ~/rails/Bookmarker/public rails
これで動かしてみると、動かなかった。
/etc/httpd/logs/error.log を見ると、
File does not exist: /home/httpd/html/home/pie001/rails/Bookmarker/public/index.html とか出てる。見ているパスが変だ。
調べてみると、Alias ディレクティブとかで使う場合、RewriteBase を設定しないといけないらしい。
・public/.htaccess に以下を追加
RewriteBase /~pie001/rails
これで動くようになった。
しかし、確かに遅い。。表示に数秒かかる。
FastCGI を使ってみるか。