これは私を夢中にさせています。
同じ Redhat サーバーで 2 つの異なる Rails アプリを実行しています。Web サーバーは Apache、アプリ サーバーは Passenger 5.0 です。
App1 - Rails 3.0.2 および Ruby 1.9.3
App2- レール 2.0.3 & ルビー 1.8.7
App1 は正常に動作し、これが構成です。
<VirtualHost *:8081>
ServerName server-xyz
RailsEnv test
DocumentRoot /webapps/test/app1/current/public
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
app2 を実行すると、デフォルトの Apache ページが表示され、次のエラーが表示されます。
Options ディレクティブによって禁止されているディレクトリ インデックス: /webapps/test/app2/current/public/
これは app2 の仮想ホストです。
<VirtualHost *:8081>
ServerName server-xyz
RailsEnv test
DocumentRoot /webapps/test/app2/current/public
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
これは、一般的な passgenger 構成です。
LoadModule passenger_module /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/passenger-5.0.8/buildout/apache2/mod_passenger.so
PassengerRoot /opt/ruby-1.9.3/lib/ruby/gems/1.9.1/gems/passenger-5.0.8
PassengerDefaultRuby /opt/ree-1.8.7/bin/ruby_with_env
PassengerLogLevel 1
PassengerMaxPoolSize 10
ruby 1.8.7ではなくruby.1.9.3アプリで機能する理由は誰にもありますか?
同様のスレッドをたどってみましたが、うまくいきませんでした。
編集:そのパスに「apache」書き込み権限を与えました。役に立たなかったようです。
編集 2: public の下に次の .htaccess 構成が見つかりました:
/webapps/test/app2/releases/20150622171404/public/.htaccess
# General Apache options
AddHandler fastcgi-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI
RewriteEngine On
# If your Rails application is accessed via an Alias directive,
# then you MUST also set the RewriteBase in this htaccess file.
#
# Example:
# Alias /myrailsapp /path/to/myrailsapp/public
# RewriteBase /myrailsapp
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.cgi [QSA,L]