Phusion Passenger Not Working on Apache
Asked Answered
U

2

6

UPDATE: When entering 'passenger-memory-stats' I'm showing:

---Passenger processes---
Processes: 0

How do I troubleshoot this? Why would passenger not be starting even though I added it in httpd.conf and restart apache?

I'm having trouble getting Phusion Passenger to Run Ruby on Rails on a server. I've followed all instructions at Phusion web site and installed passenger and modified and created Apache VirtualHost to point to the new directory and verified that all .conf files are being loaded successfully. Also httpd -M passenger_module is loaded. I also successfully ran Passenger Standalone and Rails server webrick on localhost and was able to verify that it works with curl.

But when I try to run my domain from the browser, I just get a 404 not found or an empty index file that I create in that folder specified by the DocumentRoot under VirtualHost (so I know it's loading .conf and going into the right directory) but it's not loading Rails Application....Can someone please point out what I'm doing wrong? Here are my settings and config:

ruby -v:
ruby 2.1.2p95

rails -v:
Rails 4.2.3

passenger -v:
Phusion Passenger version 5.0.15

httpd -v:
Apache/2.2.27 (Unix)

opearting system:
CentOS

uname -i: 
x86_64

httpd.conf:

Include "/usr/local/apache/conf/includes/mydomain.conf"
LoadModule passenger_module /usr/local/rvm/gems/ruby-2.1.2/gems/passenger-5.0.15/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/rvm/gems/ruby-2.1.2/gems/passenger-5.0.15
PassengerDefaultRuby /usr/local/rvm/gems/ruby-2.1.2/wrappers/ruby
</IfModule>

/usr/local/apache/conf/includes/mydomain.conf:

<VirtualHost 208.79.235.241:80>
ServerName mydomain.com
DocumentRoot /home/clevert/public_html/rails_apps/mydomain.com/public
PassengerRuby /usr/local/rvm/gems/ruby-2.1.2/wrappers/ruby
<Directory /home/clevert/public_html/rails_apps/mydomain.com/public>
Allow from all
Options -MultiViews
</Directory>
</VirtualHost>

passenger-config about ruby-command:

Command: /usr/local/rvm/gems/ruby-2.1.2/wrappers/ruby

passenger-config validate-install:

Checking whether this Passenger install is in PATH... ✓
Checking whether there are no other Passenger installations... ✓
Checking whether Apache is installed... ✓
Checking whether the Passenger module is correctly configured in Apache... ✓
Everything looks good. :-)
Uncanny answered 23/8, 2015 at 19:12 Comment(5)
Could you please also add the output of apachectl configtest if there are any errors?Vide
httpd configtest: Syntax OKUncanny
Find the log files and look inside them.Kowatch
apache logs aren't showing anything in regards to passenger....Which logs will tell me debugging info about passenger?Uncanny
When entering 'passenger-memory-stats' I'm showing: ---Passenger processes--- Processes: 0Uncanny
U
2

Okay so after a couple of weeks of frustration/fascination trying to work this out, I have the solution and I really hope it helps someone out there struggling with this!

THE PROBLEM: I had both apache and litespeed installed on my server and that was the only culprit! I completely disabled litespeed and switched over to apache (you can easily switch between the two using WHM control panel) and ran the passenger-memory-stats again, and everything started working! Passenger auto magically showed up in the processes and then the app showed up in the memory stats as well when I loaded the app!

Uncanny answered 28/8, 2015 at 16:21 Comment(0)
B
2

It looks like you are missing your PassengerAppRoot directive.

I am running passenger successfully on my Ubuntu 14.04 machines. I have a few more directives in my /etc/apache2/sites-enabled/app.example.com.conf file. I don't know if there are needed for CentOS but they were needed to get things running on Ubuntu.

Also, I am using rbenv instead of rvm and I am deploying via Capistrano as the deployer on the server.

Here are the relevant parts of my app.example.com.conf file:

  DocumentRoot /srv/http/app.example.com/current/public
  <Directory /srv/http/app.example.com/current/public>
    Order allow,deny
    Allow from all
    Require all granted
  </Directory>

  PassengerRuby /home/deployer/.rbenv/shims/ruby
  PassengerAppType rack
  PassengerAppRoot /srv/http/app.example.com/current
  PassengerStartupFile config.ru
  PassengerRestartDir /srv/http/app.example.com/current/tmp
  PassengerDebugLogFile /srv/http/app.example.com/shared/log/passenger.log
  # 0 = warn; 1 to 3, increasing levels of debugging information
  PassengerLogLevel 1
Blackmarketeer answered 26/8, 2015 at 0:43 Comment(1)
Karl, do you have passenger processes showing when you run a passenger-memory-stats command even if none of the apps are running? Or do you actually have to load the app from the browser to start the passenger? I'm trying to figure out if it should be automatically loaded from the apache module or has to be started in some other way...I tried adding the line PassengerAppRoot and restart apache but it didn't do anythingUncanny
U
2

Okay so after a couple of weeks of frustration/fascination trying to work this out, I have the solution and I really hope it helps someone out there struggling with this!

THE PROBLEM: I had both apache and litespeed installed on my server and that was the only culprit! I completely disabled litespeed and switched over to apache (you can easily switch between the two using WHM control panel) and ran the passenger-memory-stats again, and everything started working! Passenger auto magically showed up in the processes and then the app showed up in the memory stats as well when I loaded the app!

Uncanny answered 28/8, 2015 at 16:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.