R
R
Ramil2015-02-02 12:22:28
Nginx
Ramil, 2015-02-02 12:22:28

How to install passenger on nginx?

I made the settings in PuPHPet and raised the server to nginx via Vagrant. The next task for me is to install passenger. After reading on various sites about how to install passenger, I realized that basically its installation takes place along with nginx using the command:

passenger-install-nginx-module

But since I already have nginx, this action is not suitable for me. I went ahead and found out that passenger can be installed as a standalone nginx extension with:
sudo apt-get install nginx-extras passenger

Having added the necessary packages to the repository, I installed passenger. The installation was successful. After that, in /etc/nginx/nginx.conf I inserted lines into the http block, as stated in the official documentation :
passenger_root /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini;
passenger_ruby /usr/bin/ruby;

Then I restarted the server and got an error:
unknown directive "passenger_root" in /etc/nginx/nginx.conf:12

From this it is clear that nginx does not see the installed passenger. How to fix it? What are the possible solutions?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Shakhunov, 2015-02-02
@rshaibakov

The trouble with installing passenger for nginx is that nginx does not support loading external modules. That is, it is impossible for apache to install the module and connect it in the configs.
From here comes two ways to install passenger for nginx:
For both of these options, in any case, you need to connect the Phusion Passenger repository
After that, nginx, if it was updated to the version along with the passenger itself. If it was not there, then you can run passenger-install-nginx-module and follow the installation instructions to compile nginx and passenger on your own :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question