URLに行くと、私のレールアプリはパブリックディレクトリを表示します。 私はapache、passenger、およびubuntuを使用しています。 私のapache virtualhostsファイルはです。Railsアプリのみがパブリックディレクトリを表示します。
<VirtualHost *:80>
ServerName www.phusion.nl
DocumentRoot /websites/phusion
<Directory /websites/phusion>
Allow from all
</Directory>
# These have been added:
Alias /subapp /websites/rails/public
<Location /subapp>
PassengerBaseURI /subapp
PassengerAppRoot /websites/rails
</Location>
<Directory /websites/rails/public>
Allow from all
Options -MultiViews
</Directory>
</VirtualHost>
私はすべてが正しくインストールされていると思う、私のconfig.ruは;
require ::File.expand_path('../config/environment', __FILE__)
run Rails.application
私は以下をapache2.confに追加しました。
LoadModule passenger_module /home/vps/.rvm/gems/ruby-2.0.0-p353/gems/passenger-4.0.35/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /home/vps/.rvm/gems/ruby-2.0.0-p353/gems/passenger-4.0.35
PassengerDefaultRuby /home/vps/.rvm/gems/ruby-2.0.0-p353/wrappers/ruby
</IfModule>
apache error.logが表示されます。
All Phusion Passenger agents started!
[ 2014-01-19 09:05:23.8076 12140/7f1e3695c740 agents/Watchdog/Main.cpp:526 ]:
Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/home/vps/.rvm/gems/ruby-2.0.0-p353/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/home/vps/.rvm/gems/ruby-2.0.0-p353/gems/passenger-4.0.35', 'passenger_version' => '4.0.35', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.35', 'web_server_pid' => '12137', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
サーバーのレールアプリへのフルパスを教えてください。あなたは本当にアプリケーションをサブURIに展開したいですか? – vooD
これはサブURIでなければなりません。フルパスは/ var/www/subapp –
あなたのアプリが '/ var/www/subapp'にある場合、ディレクトリが'/websites/rails/public'を指しているのはなぜですか? – vooD