Passenger not start on 80 port - ruby-on-rails

I start passenger — rvmsudo passenger start -p 80 --user=support on Ubunto 12.10, and get this error:
Stopping web server... done
/usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/daemon_controller-1.1.5/lib/daemon_controller.rb:407:in
start_without_locking': [ 2013-08-22 13:19:09.5563 16334/7f245089a740
agents/Watchdog/Main.cpp:459 ]: Options: { 'analytics_log_user' =>
'nobody', 'default_group' => 'support', 'default_python' => 'python',
'default_ruby' =>
'/usr/local/rvm/wrappers/ruby-1.9.3-p429#rails32/ruby', 'default_user'
=> 'support', 'log_level' => '0', 'max_instances_per_app' => '0', 'max_pool_size' => '6', 'passenger_root' =>
'/tmp/passenger-standalone.1cjq616/locations.ini', 'pool_idle_time' =>
'300', 'prestart_urls' => 'aHR0cDovLzAuMC4wLjA6ODAA', 'temp_dir' =>
'/tmp', 'union_station_gateway_address' =>
'gateway.unionstationapp.com', 'union_station_gateway_port' => '443',
'user_switching' => 'false', 'web_server_pid' => '16333',
'web_server_type' => 'nginx', 'web_server_worker_gid' => '1000',
'web_server_worker_uid' => '1000' } (DaemonController::StartTimeout)
[ 2013-08-22 13:19:09.5610 16337/7f7a32f48740 agents/HelperAgent/Main.cpp:602 ]: PassengerHelperAgent online,
listening at unix:/tmp/passenger.1.0.16333/generation-0/request
[ 2013-08-22 13:19:09.5637 16342/7f7a14f71740 agents/LoggingAgent/Main.cpp:334 ]: PassengerLoggingAgent online,
listening at unix:/tmp/passenger.1.0.16333/generation-0/logging
[ 2013-08-22 13:19:09.5642 16334/7f245089a740 agents/Watchdog/Main.cpp:642 ]: All Phusion Passenger agents started!
/usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/helper-scripts/prespawn:105:in
initialize': Connection refused - connect(2) (Errno::ECONNREFUSED)
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/helper-scripts/prespawn:105:in
new'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/helper-scripts/prespawn:105:in
connect'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/helper-scripts/prespawn:86:in socket'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/helper-scripts/prespawn:90:inhead_request'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/helper-scripts/prespawn:145:in
<main>'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/daemon_controller-1.1.5/lib/daemon_controller.rb:218:in
block in start'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/daemon_controller-1.1.5/lib/daemon_controller/lock_file.rb:68:in
block in exclusive_lock'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/daemon_controller-1.1.5/lib/daemon_controller/lock_file.rb:63:in
open'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/daemon_controller-1.1.5/lib/daemon_controller/lock_file.rb:63:in
exclusive_lock'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/daemon_controller-1.1.5/lib/daemon_controller.rb:217:in
start'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/lib/phusion_passenger/standalone/start_command.rb:414:in
start_nginx'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/lib/phusion_passenger/standalone/start_command.rb:71:in
run'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/lib/phusion_passenger/standalone/main.rb:92:in
run_command'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/lib/phusion_passenger/standalone/main.rb:62:in
run!'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/lib/phusion_passenger/standalone/main.rb:39:in
run!'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/gems/passenger-4.0.14/bin/passenger:34:in
'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/bin/passenger:19:in load'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/bin/passenger:19:in
'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/bin/ruby_noexec_wrapper:14:in
eval'
from /usr/local/rvm/gems/ruby-1.9.3-p429#rails32/bin/ruby_noexec_wrapper:14:in
'
What I do wrong, maby this is permission?

Ports below 1024 can be opened only, although you can use iptables to redirect the traffic:
# iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000
Since loopback devices (like localhost) do not use the prerouting rules, if you need to use localhost, etc., add this rule as well:
# iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 3000
Or you can use passagener under apache http server or nginx, and use their configs to set the applications.

Actually, that is a bug in Phusion Passenger. The command rvmsudo passenger start -p 80 --user=support should just work, without the iptables changes that Paulo suggested. I've fixed this bug and the bug fix will be part of Phusion Passenger 4.0.15.
Hongli Lai
Phusion CTO
Phusion Passenger developer

Related

Poll success, but error: Operation now in progress (29). when Xdebug trying connect to PhpStorm from docker container

I'm trying debug CLI script, and Xdebug can't connect to PhpStorm.
I see error Operation now in progress (29). in Xdebug remote log.
I'm sure Xdebug configured right, but I don't know how to debug PhpStorm.
Summary from phpinfo() generated by https://xdebug.org/wizard.php
Tailored Installation Instructions
Summary
Xdebug installed: 2.6.1
Server API: Command Line Interface
Windows: no
Zend Server: no
PHP Version: 7.1.24
Zend API nr: 320160303
PHP API nr: 20160303
Debug Build: no
Thread Safe Build: no
OPcache Loaded: no
Configuration File Path: /usr/local/etc/php
Configuration File: /usr/local/etc/php/php.ini
Extensions directory: /usr/local/lib/php/extensions/no-debug-non-zts-20160303
You're already running the latest Xdebug version
Xdebug log
Log opened at 2019-02-19 11:59:37
I: Connecting to configured address/port: 46.201.50.194:9000.
W: Creating socket for '46.201.50.194:9000', poll success, but error: Operation now in progress (29).
E: Could not connect to client. :-(
Log closed at 2019-02-19 11:59:37
Xdebug config
xdebug
xdebug support => enabled
Version => 2.6.1
IDE Key => PHPSTORM
Supported protocols
DBGp - Common DeBuGger Protocol
Directive => Local Value => Master Value
xdebug.auto_trace => Off => Off
xdebug.cli_color => 0 => 0
xdebug.collect_assignments => Off => Off
xdebug.collect_includes => On => On
xdebug.collect_params => 0 => 0
xdebug.collect_return => Off => Off
xdebug.collect_vars => Off => Off
xdebug.coverage_enable => On => On
xdebug.default_enable => On => On
xdebug.dump.COOKIE => no value => no value
xdebug.dump.ENV => no value => no value
xdebug.dump.FILES => no value => no value
xdebug.dump.GET => no value => no value
xdebug.dump.POST => no value => no value
xdebug.dump.REQUEST => no value => no value
xdebug.dump.SERVER => no value => no value
xdebug.dump.SESSION => no value => no value
xdebug.dump_globals => On => On
xdebug.dump_once => On => On
xdebug.dump_undefined => Off => Off
xdebug.extended_info => On => On
xdebug.file_link_format => no value => no value
xdebug.filename_format => no value => no value
xdebug.force_display_errors => Off => Off
xdebug.force_error_reporting => 0 => 0
xdebug.gc_stats_enable => Off => Off
xdebug.gc_stats_output_dir => /tmp => /tmp
xdebug.gc_stats_output_name => gcstats.%p => gcstats.%p
xdebug.halt_level => 0 => 0
xdebug.idekey => PHPSTORM => PHPSTORM
xdebug.max_nesting_level => 256 => 256
xdebug.max_stack_frames => -1 => -1
xdebug.overload_var_dump => 2 => 2
xdebug.profiler_aggregate => Off => Off
xdebug.profiler_append => Off => Off
xdebug.profiler_enable => Off => Off
xdebug.profiler_enable_trigger => Off => Off
xdebug.profiler_enable_trigger_value => no value => no value
xdebug.profiler_output_dir => /tmp => /tmp
xdebug.profiler_output_name => cachegrind.out.%p => cachegrind.out.%p
xdebug.remote_addr_header => no value => no value
xdebug.remote_autostart => On => On
xdebug.remote_connect_back => Off => Off
xdebug.remote_cookie_expire_time => 3600 => 3600
xdebug.remote_enable => On => On
xdebug.remote_handler => dbgp => dbgp
xdebug.remote_host => 127.0.0.1 => localhost
xdebug.remote_log => /app/xdebug.log => no value
xdebug.remote_mode => req => req
xdebug.remote_port => 9000 => 9000
xdebug.remote_timeout => 200 => 200
xdebug.scream => Off => Off
xdebug.show_error_trace => Off => Off
xdebug.show_exception_trace => Off => Off
xdebug.show_local_vars => Off => Off
xdebug.show_mem_delta => Off => Off
xdebug.trace_enable_trigger => Off => Off
xdebug.trace_enable_trigger_value => no value => no value
xdebug.trace_format => 0 => 0
xdebug.trace_options => 0 => 0
xdebug.trace_output_dir => /tmp => /tmp
xdebug.trace_output_name => trace.%c => trace.%c
xdebug.var_display_max_children => 128 => 128
xdebug.var_display_max_data => 512 => 512
xdebug.var_display_max_depth => 3 => 3
Xdebug can't connect to PhpStorm because PhpStorm was not reachable by my external host ip.
How I debug it.
First I checked from docker container that PhpStorm listen port (9000 in my case)
nc -vz external_ip 9000
It got (tcp) failed: Connection refused
I try the same from the host and also got the error
Then I tried from host
nc -vz localhost 9000
And I got [tcp/*] succeeded!
So the problem in xdebug.remote_host not in PhpStorm probably
I found host ip in container
netstat -nr | grep '^0\.0\.0\.0' | awk '{print $2}'
Put it in xdebug.remote_host and now it works correctly
Thanks for #LazyOne
In my case I simply set the following xdebug conf:
xdebug.remote_connect_back=0
xdebug.remote_host=host.docker.internal
host.docker.internal should 'magically' find the host's IP (cf. documentation). Note that this requires Docker v18.03+ and currently only works on Mac and Windows hosts.
May be your xdebug.remote_port 9000 is using by php-fpm. You try changing other port. Example xdebug.remote_port=9001 and in launch.json file still port=9000
If someone doesn't want to hardcode or modify their docker, Dockerfile, or compose file (maybe someone is using a 2.x xdebug, it doesn't support environment variable). Adding the header X-Forwarded-For by using a header modifying extension on the browser so as to set $_SERVER['HTTP_X_FORWARDED_FOR'] is a very convenient approach. Don't forget the configuration xdebug.remote_connect_back=1.
Dockerfile
FROM php:7.1-apache
RUN yes | pecl install xdebug-2.5.5 \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_port=9000" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_connect_back=1" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_log=/tmp/xdebug.log" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini
ModHeader extension
xdebug.log
Log opened at 2021-07-06 16:06:59
I: Checking remote connect back address.
I: Checking header 'HTTP_X_FORWARDED_FOR'.
I: Checking header 'REMOTE_ADDR'.
I: Remote address found, connecting to 172.17.0.1:9000.
W: Creating socket for '172.17.0.1:9000', poll success, but error: Operation now in progress (29).
E: Could not connect to client. :-(
Log closed at 2021-07-06 16:06:59
Log opened at 2021-07-06 16:07:40
I: Checking remote connect back address.
I: Checking header 'HTTP_X_FORWARDED_FOR'.
I: Remote address found, connecting to 172.30.112.1:9000.
I: Connected to client. :-)
For me the fix to this error was simply clicking the phone icon in PhpStorm twice to disable and then re-enable listening for debug connections.
It shouldn't change anything but it worked because before that I fixed a bunch of other issues, one of them being that port 9003 was blocked by something else. Apparently PhpStorm doesn't warn when it can't use the specified port, so after resolving other issues it might be necessary to re-initiate listening for debug connections.
Have you configured the mapping from phpstorm in PHP->Server, you have to map the project file to the absolute path of the server eg. src -> "/var/www/html/test/src"
Also the xdebug file from the server that contains the ip address
I have opened "Windows Defender Firewall with Advanced Security" (Windows firewall settings) and have found that I have two rules, which appeared not clear from where, that block the phpStorm.
I disabled them - and the xDebugger started working for me.

Rails - Caught SIGTERM, shutting down on AWS EC2 running on Apache Server [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I get this error when I make some changes in my app. Previously it works well until i pushed the last code. I made a lot of changes in my file so that i can not track which one is causing this error.
I haved tried to search at other threads but i could not find solution that can solve my problem. This problem is similar to other threads that have been discussed few times here but only few people interested to post any solutions.
Please can someone shared their experience on this?
This error can be found in /var/log/apache2/error.log
mpm_event:notice] [pid 14458:tid 140091015935872] AH00491: caught SIGTERM, shutting down
[ 2014-10-13 09:48:43.7713 14759/7fb04324c780 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/home/ubuntu/.rvm/gems/ruby-2.1.2/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/home/ubuntu/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.46', 'passenger_version' => '4.0.46', '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.46', 'web_server_pid' => '14758', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2014-10-13 09:48:43.7759 14762/7f11d7132780 agents/HelperAgent/Main.cpp:649 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.14758/generation-0/request
[ 2014-10-13 09:48:43.7825 14767/7f1165b73780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.14758/generation-0/logging
[ 2014-10-13 09:48:43.7829 14759/7fb04324c780 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[ 2014-10-13 09:48:43.7914 14782/7f938c30f780 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/home/ubuntu/.rvm/gems/ruby-2.1.2/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/home/ubuntu/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.46', 'passenger_version' => '4.0.46', '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.46', 'web_server_pid' => '14779', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2014-10-13 09:48:43.7958 14785/7f3da825f780 agents/HelperAgent/Main.cpp:649 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.14779/generation-0/request
[ 2014-10-13 09:48:43.8019 14790/7fcd26fe4780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.14779/generation-0/logging
[Mon Oct 13 09:48:43.802685 2014] [mpm_event:notice] [pid 14779:tid 140057092278144] AH00489: Apache/2.4.7 (Ubuntu) Phusion_Passenger/4.0.46 configured -- resuming normal operations
[Mon Oct 13 09:48:43.802751 2014] [core:notice] [pid 14779:tid 140057092278144] AH00094: Command line: '/usr/sbin/apache2'
[ 2014-10-13 09:48:43.8053 14782/7f938c30f780 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
Try to check your configurations. This problem may be because you set your config.force_ssl equal to true. Change it back to false then restart your server using sudo service apache2 restart.

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>

RoR Application and nginx with Passenger on Ubuntu

i installed Ruby using RVM on a Ubuntu 13.10 Server. The same thing i do with rubygems and Rails. When i start my application with
rails server
and enter
localhost:3000
in my Browser it works.
Now i want to make the application visible for other users.
So i checked rubyonrails.org/deploy-Site and decided to install nginx with Passenger.
gem install passenger
rvmsudo passenger-install-nginx-module
After this i downloaded stuff who was missing and do
rvmsudo passenger-install-nginx-module
again.
Before i runned
sudo service nginx start
i edit my .conf-File in /opt/nginx/conf/nginx.conf
server {
listen 80;
server_name example.com;
passenger_enabled on;
root /var/www/my_awesome_rails_app/public;
}
As server name i take the ip-Adress for the domain.
The passenger_enabled Line i added and as root i take /home/ServerName/AppName/public
My Problem is that i doesn't see anything when i open the server-ip-page.
When i run 'top' i see that nginx is running.
The Ruby on Rails Application is also running.
AND i restartet nginx after editing the .conf-File.
Anybody know i solution
OR
how i can test nginx?
Thanks
Update - error.log, access.log
access.log: file is empty (no content inside)
error.log:
[ 2014-05-13 14:08:18.9450 2548/7fc38986d740 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/home/mustermann/.rvm/gems/ruby-2.1.1/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/home/mustermann/.rvm/gems/ruby-2.1.1/gems/passenger-4.0.42', 'passenger_version' => '4.0.42', '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.42', 'web_server_pid' => '2547', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '65534', 'web_server_worker_uid' => '65534' }
[ 2014-05-13 14:08:18.9501 2551/7fbf96162740 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.2547/generation-0/request
[ 2014-05-13 14:08:18.9590 2556/7fcd93dab780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.2547/generation-0/logging
[ 2014-05-13 14:08:18.9604 2548/7fc38986d740 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[ 2014-05-13 14:10:33.6645 2592/7f40a1fe8740 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/home/mustermann/.rvm/gems/ruby-2.1.1/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/home/mustermann/.rvm/gems/ruby-2.1.1/gems/passenger-4.0.42', 'passenger_version' => '4.0.42', '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.42', 'web_server_pid' => '2591', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '65534', 'web_server_worker_uid' => '65534' }
[ 2014-05-13 14:10:33.6693 2595/7fc930750740 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.2591/generation-0/request
[ 2014-05-13 14:10:33.6777 2600/7f645bf0f780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.2591/generation-0/logging
[ 2014-05-13 14:10:33.6780 2592/7f40a1fe8740 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[ 2014-05-13 14:18:19.9938 2638/7fae3ef32740 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/home/mustermann/.rvm/gems/ruby-2.1.1/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/home/mustermann/.rvm/gems/ruby-2.1.1/gems/passenger-4.0.42', 'passenger_version' => '4.0.42', '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.42', 'web_server_pid' => '2637', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '65534', 'web_server_worker_uid' => '65534' }
[ 2014-05-13 14:18:19.9990 2641/7f6ed18af740 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.2637/generation-0/request
[ 2014-05-13 14:18:20.0074 2646/7fbb3494b780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.2637/generation-0/logging
[ 2014-05-13 14:18:20.0077 2638/7fae3ef32740 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[ 2014-05-13 14:18:25.2711 2673/7f292be1d740 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/home/mustermann/.rvm/gems/ruby-2.1.1/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/home/mustermann/.rvm/gems/ruby-2.1.1/gems/passenger-4.0.42', 'passenger_version' => '4.0.42', '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.42', 'web_server_pid' => '2656', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '65534', 'web_server_worker_uid' => '65534' }
[ 2014-05-13 14:18:25.2760 2676/7f26f5920740 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.2656/generation-0/request
[ 2014-05-13 14:18:25.2839 2681/7f0cf6b96780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.2656/generation-0/logging
[ 2014-05-13 14:18:25.2847 2673/7f292be1d740 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[ 2014-05-13 14:18:35.0327 2709/7f19099b8740 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/home/mustermann/.rvm/gems/ruby-2.1.1/wrappers/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/home/mustermann/.rvm/gems/ruby-2.1.1/gems/passenger-4.0.42', 'passenger_version' => '4.0.42', '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.42', 'web_server_pid' => '2708', 'web_server_type' => 'nginx', 'web_server_worker_gid' => '65534', 'web_server_worker_uid' => '65534' }
[ 2014-05-13 14:18:35.0374 2712/7f6ce241a740 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.2708/generation-0/request
[ 2014-05-13 14:18:35.0457 2718/7fba54563780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.2708/generation-0/logging
[ 2014-05-13 14:18:35.0461 2709/7f19099b8740 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
Update - ps aux | egrep '(PID|nginx)'
http://s1.directupload.net/images/140513/v2lv5dpe.jpg
Now its running.
Port 80 was blocked by the firewall of our university.
After unlocking Port 80 we get the nginx page when running the ip-adress of the server.
Finally we just needed to change the .conf of nginx with the following lines:
location / {
proxy_pass http://localhost:3000/;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
}
Source: Link
This part is important if you don't want access your Application with ip-adress:3000
The old location-part can be deleted.
Now you can restart/reload the nginx:
sudo service nginx restart
and start the rails server (on Port 3000 - default):
rails server
If you want you can start the rails server i another mode with:
rails server -e ....
Now you can access your RoR-Application.
Good Luck :-)

Rails app only displaying public directory with passenger

My rails app will only display the public directory when I go to the url.
I'm using apache, passenger and ubuntu.
My apache virtualhosts file is;
<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>
I think everything is installed properly, my config.ru is;
require ::File.expand_path('../config/environment', __FILE__)
run Rails.application
I've added the following to 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>
the apache error.log gives;
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' }
duh...
I had PassengerAppRoot set to the public folder, not rails root.
This issue may be because of the way you installed the Passenger module
Wrong way : sudo passenger-install-apache2-module
Right way : rvmsudo passenger-install-apache2-module
I am just guessing you used the first one which is leading to this issue, please correct me if i'm wrong.

Resources