Can't install passanger mod_rails - ruby-on-rails

I am trying to install passenger server for my rails application using this guide http://www.modrails.com/documentation/Users%20guide%20Apache.html The problem occurs in step passenger-install-apache2-module.
When I run this command I get this -
WARNING: Apache doesn't seem to be compiled with the 'prefork', 'worker' or 'event' MPM
How can I solve this? My OS is Ubuntu 13.10 and I have already installed all necessary packages: apache2-bin apache2-data apache2-mpm-worker libapache2-mod-passenger

As Brad Werth said, https://serverfault.com/questions/546924/installing-phusion-passenger-4-0-20-on-ubuntu-13-10 provides a solution.
This problem is caused by a bug in Phusion Passenger's passenger-install-apache2-module program. Ubuntu 13.10 changed the way the httpd -V command works, so passenger-install-apache2-module was unable to correctly detect the MPM for your Apache, resulting in an incorrect warning message. You can safely ignore this warning.
I've fixed the problem in Phusion Passenger now. The fix will be included in version 4.0.34: https://github.com/phusion/passenger/commit/6f5af46de7cb80dd88ef3b35c7c5c4bfbfa0cfd3

Related

Passenger PassengerAgent does not exist

I'm updating the passenger for my app with rvm. Afterwards I used passenger-config --root to find the passenger and added it to my nginx.conf. This is the directory:
shared/bundle/ruby/2.3.0/gems/passenger-5.0.30
I'm not sure why the passenger root is this one. I thought it'll be the one installed under .rvm. Anyway, I got this error:
Unable to start Phusion Passenger: Support binary PassengerAgent not found...
I am able to use back my previous passenger, and I noticed the difference is the new package has no buildout/support-binaries/PassengerAgent. Am I missing something here?
Setup:
Ubuntu 14.04
rvm 1.29.3
rails 4.2.10
ruby 2.3
capistrano 3
It seems that I installed passenger with rvm. So I need to follow the instructions here and run passenger-install-nginx-module to do it correctly.

Upgrading passenger to 5.1.11 breaks setup with 403

Upgrading passenger to 5.1.11 makes all my requests fail with HTTP status code 403, downgrading to 5.1.10 works. I run nginx as root and all my rails applications reside in my non-root user's home directory. passenger and nginx-extras were installed from passenger apt repos as decribed here. There is no error in nginx or rails application logs other than the 403 status in access logs.
I have verified that all the rails application directories and their parent directories have read and executable permissions enabled for all users in the system.
I think this has something to do with https://blog.phusion.nl/2017/10/13/passenger-security-advisory-5-1-11/. What should I do to fix it?
OS: Ubuntu 17.04
Nginx: 1.10.3
Edit: you mentioned your OS is 17.04 and not 17.10. Phusion's instructions for 17.04 tell you to remove nginx-extras, not to install it (as you say you've done).
So, for 17.04, try removing nginx-extras, then installing nginx and libnginx-mod-http-passenger.
--
You list your OS as Ubuntu 17.10 Artful, but the instructions you linked are for Ubuntu 17.04 Zesty, so that's not going to work.
Ubuntu 17.10 was released yesterday, there are no Passenger packages for it yet (usually available when the next Passenger version is released).
You can either wait for those packages or install Passenger via gem or tarball (Option Other: www.phusionpassenger.com/library/install/nginx/install/oss/).

WARNING: Apache doesn't seem to be compiled with the 'prefork', 'worker' or 'event' MPM - Rails - Apache2 - Passenger

I am deploying a Rails application on an ubuntu server that has Apache2 installed, Rails installed, and I am trying to get the application deployed using Passenger.
Apache is installed just fine - I can view static files, reload it, start it, stop it, etc..
Rails is installed just fine - I can run the WeBrick server from the application root.
Now I want to use passenger to deploy.
When I run the following command:
passenger-install-apache2-module
It goes through some stuff then the following error comes up:
WARNING: Apache doesn't seem to be compiled with the 'prefork', 'worker' or 'event' MPM - Rails - Apache2 - Passenger
Basically, the Passenger installer tells me to recompile Apache with one of those MPM's or continue the installation process. I tried continue but it fails.
So, how do I got about fixing this issue?
You have two choices:
Fix Apache. How to fix this depends on how you installed Apache in the first place. If you installed Apache by installing it from source, then reinstall Apache by compiling it from source, but this time using the worker MPM. Refer to the Apache documentation to learn how to do that.
Don't use Apache. Instead, use Phusion Passenger + Nginx, or use Phusion Passenger Standalone.

Unable to start the Phusion Passenger watchdog?

I have done a Phusion Passenger setup on Ubuntu 10.04, with Apache2. Whenever I restart the Apache server I got the following error message, and the Rails application is not running.
[error] *** Passenger could not be initialized because of this error: Unable to start the Phusion Passenger watchdog because its executable (/usr/lib/phusion-passenger/agents/PassengerWatchdog) does not exist. This probably means that your Phusion Passenger installation is broken or incomplete, or that your 'PassengerRoot' directive is set to the wrong value. Please reinstall Phusion Passenger or fix your 'PassengerRoot' directive, whichever is applicable.
I ran into the same problem when compiling from source, but it was intermittent, which was really frustrating (I think it has to w/ Rails environments). We couldn't use the passenger-install-apache2-module/passenger-install-nginx-module scripts, because we needed a customized nginx installation.
I finally fixed the problem by going to whatever the passenger-config --root is, then running: rake nginx.
Update February 2016 (by Passenger author):
The officially supported method to compile PassengerAgent (without also compiling Nginx, as passenger-install-nginx-module does) is with this command:
passenger-config compile-agent
Passenger 5.0.26 and later will automatically detect the error described in this StackOverflow question, and will automatically suggest running the above command.
I've just hit this error myself and struggled to find a good answer, so here's my writeup.
In my setup I'm going for Ubuntu, Apache2, the latest Passenger and Rails 2.3.
Install Ruby and Rubygems NB: make (very) sure your gem -v is correct, if it's wrong you'll do all this twice
sudo gem install passenger
cd /usr/lib
wget http://rubyforge.org/frs/download.php/76005/passenger-3.0.12.tar.gz
tar zxvf passenger-3.0.12.tar.gz
cd passenger-3.0.12
./bin/passenger-install-apache2-module
Add export PATH=/var/lib/gems/1.8/bin:$PATH to ~/.bashrc
ln -s /usr/lib/passenger-3.0.12 /usr/share/phusion-passenger # => this fixes a world of hurt to do with PassengerWatchdog. NB: PassengerWatchdog doesn't come down with apt-get which is why we grabbed the binaries.
ln -s /usr/lib/passenger-3.0.12 /usr/lib/phusion-passenger # => similar issues.
This is from memory following thrashing it through for the last day and a half, I'll tidy up when I have to go through it again.
Try to install passenger module by running script passenger-install-apache2-module .
I had same problem but on nginx; I installed passenger via gem and then recompiled nginx manually with passenger module - this caused error described by you. After running passenger-install-nginx-module such error disappeared.
It had been a while since I had restarted nginx and in the meantime the path to passenger had changed. I looked in the nginx.conf to see what the passenger_root was set to and realized that it was the old value:
http {
passenger_root /home/nginx/rails_app/myapp/shared/bundle/ruby/1.9.1/gems/passenger-enterprise-server-3.0.17;
There are often two places to change:
server {
listen 8888;
root /home/nginx/rails_app/myapp/current/public;
I restarted nginx and the error was gone.
I had the same issue on my Nginx-Server.
In my case, the passenger_root directory was not correct, because of gem update.
[1] On Linux, i searched the passenger Directory with the following Command:
find / -name PassengerWatchdog
[2] Now i changed my 'passenger_root' Value to this Directory.
[3] And restart the Server.
suvankar, Maybe you should change your Passenger Path too.

why isn't my rails install using the latest version of passenger?

I'm using VirtualBox on Windows to run an Ubuntu OS, which is running the turnkey rails package, which comes with ruby 1.8, rails 2.3.8, and passenger 2.2.5. When I first booted it up with just a vanilla rails app it worked fine, but now I'm getting the following error:
uninitialized constant PhusionPassenger::Utils::PseudoIO::StringIO
I googled this, and on the phusion/google groups it said this was an old error and to upgrade passenger, which I did with gem upgrade passenger. It said it was installing passenger 2.2.15, but it doesn't appear to be using it. I re-started the whole virtualbox and it is still giving me the same error, with the backtrace showing passenger-2.2.5.
I realize there are several layers here and plenty of places for things to go wrong, and to add to that, I'm pretty much a Linux newb. I've got some experience with rails. I'd appreciate any help.
It could well be your Apache configuration file. When Passenger installs it adds some code to the /etc/apache2/http.conf file so that Apache loads the Passenger extension. This code includes the version number so if you've changed the version of Apache you'll need to modify this file. The code you're looking for looks like this
LoadModule passenger_module /opt/local/lib/ruby/gems/1.8/gems/passenger-2.2.15/ext/apache2/mod_passenger.so
PassengerRoot /opt/local/lib/ruby/gems/1.8/gems/passenger-2.2.15
PassengerRuby /opt/local/bin/ruby
You'll have to be authenticated to edit the file so open a terminal window and type
sudo gedit /etc/apache2/http.conf
and enter your password to edit the file. Once you've made the changes close gedit then run
sudo /etc/init.d/apache2 restart
to restart Apache and try your Rails application again.
Try using
gem list
to make sure the new version was installed. Next to the passenger gem should see more than version listed.
You can use
gem clean
to remove old versions.

Resources