简体   繁体   中英

Passenger, 403 Forbidden

I am trying to install passenger for my rails app, but i dont know where is the problem. I already try do chmod 775 in my app folder, nothing works. Fallow the files:

sites-avaliable and enable "meuapp.conf"

<VirtualHost *:80>
ServerName meuapp,localhost  
ServerAlias meuapp.localhost
ServerAdmin webmaster@localhost

DocumentRoot "/home/pedro/projects/meuapp/public"
<Directory "/home/pedro/projects/meuapp/public">
    Options FollowSymLinks
    AllowOverride None
</Directory>

RailsEnv development

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined

"hosts"

127.0.0.1 localhost
127.0.0.1 meuapp,localhost
127.0.1.1 pedro-pcl

"apache2.conf"

LoadModule passenger_module /home/pedro/.rvm/gems/ruby-1.9.3-p194/gems/passenger-4.0.45/buildout/apache2/mod_passenger.so
   <IfModule mod_passenger.c>
     PassengerRoot /home/pedro/.rvm/gems/ruby-1.9.3-p194/gems/passenger-4.0.45
     PassengerDefaultRuby /home/pedro/.rvm/gems/ruby-1.9.3-p194/wrappers/ruby
   </IfModule>

My log:

[ 2014-07-15 19:26:32.8459 1368/7ff21372a780 agents/HelperAgent/Main.cpp:649 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.1358/generation-0/request
    [ 2014-07-15 19:26:32.8519 1374/7f6b9f6ac780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.1358/generation-0/logging
    [ 2014-07-15 19:26:32.8522 1359/7f5ef2f45780 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
    [Tue Jul 15 19:26:32.870422 2014] [so:warn] [pid 1358] AH01574: module passenger_module is already loaded, skipping
    [ 2014-07-15 19:26:32.8745 1387/7f657ffb6780 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/home/pedro/.rvm/gems/ruby-1.9.3-p194/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/home/pedro/.rvm/gems/ruby-1.9.3-p194/gems/passenger-4.0.45', 'passenger_version' => '4.0.45', '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.37', 'web_server_pid' => '1385', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
    [ 2014-07-15 19:26:32.8787 1391/7f21df2fe780 agents/HelperAgent/Main.cpp:649 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.1385/generation-0/request
    [ 2014-07-15 19:26:32.8858 1397/7fa1e768c780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.1385/generation-0/logging
    [ 2014-07-15 19:26:32.8861 1387/7f657ffb6780 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
    [Tue Jul 15 19:26:33.387955 2014] [mpm_prefork:notice] [pid 1385] AH00163: Apache/2.4.7 (Ubuntu) Phusion_Passenger/4.0.37 PHP/5.5.9-1ubuntu4.3 configured -- resuming normal operations
    [Tue Jul 15 19:26:33.388003 2014] [core:notice] [pid 1385] AH00094: Command line: '/usr/sbin/apache2'

And i try the "Require all granted" thing, still dosent work

You may be encountering the same problem as the StackOverflow user describing his 403 Error with Passenger .

The recommendation, after checking your error log (the way you have configured it, it is likely in /var/log/apache2/error.log ) and confirming that you are seeing a client denied by server configuration issue, would be to add Require all granted within your <Directory> block in the virtual host file. So, your block would look like this:

<Directory "/home/pedro/projects/meuapp/public">
  Require all granted
  Options FollowSymLinks
  AllowOverride None
</Directory>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM