Introduction
At the moment there are approximately 100 Puppet agents that connect to the Puppetmaster. Sometimes it takes a while before implemented changes on the Puppetmaster are picked up by the agents. Some information has been found that Passenger combined with a web server, e.g. Apache2 or Nginx could accelerate this process. Above all, according to this documentation it is strongly recommended to use such functionality in Production environments.
Aim
The aim is to install Nginx and implement Phusion Passenger support on CentOS7 using passenger-install-nginx-module
to accelerate the recognizing of changes implemented on the Puppetmaster by Puppet-agents.
Attempts
Attempt 1
sudo /usr/local/share/gems/gems/passenger-4.0.56/bin/passenger-install-nginx-module --auto --auto-download
was executed and the installation steps were followed.
Attempt 2
As the Nginx service was not installed during attempt 1, it was installed using yum -y install nginx
.
Attempt 3
Googling: "[emerg] unknown directive passenger_enabled"
indicated that nginx was compiled without Phusion Passenger support. In this case this should be false as passenger-install-nginx-module
has been run and the output of the installation during attempt 1 indicated that Nginx should have been installed.
Attempt 4
/etc/nginx/nginx.conf
passenger_root /usr/local/share/gems/gems/passenger-4.0.56;
passenger_ruby /usr/bin/ruby;
/etc/nginx/conf.d/puppet.conf
passenger_enabled on;
Attempt 5
To test whether this issue occurs using another web server as well sudo /usr/local/share/gems/gems/passenger-4.0.56/bin/passenger-install-apache2-module
was executed.
Expected outcome
Executing passenger-install-nginx-module
and completing the installation steps installs Nginx. Nginx service can be started and Phusion-Passenger support is included. Checking whether port 8140 is in LISTEN state should result in true as Nginx should start the Puppetmaster.
Current outcome
Executing passenger-install-nginx-module
and completing the installation steps does not install Nginx while the output indicates the contrary.
Nginx with Passenger support was successfully installed.
Please edit your Nginx configuration file (probably /opt/nginx/conf/nginx.conf),
and set the passenger_root and passenger_ruby configuration options in the
'http' block, like this:
http {
...
passenger_root /usr/local/share/gems/gems/passenger-4.0.56;
passenger_ruby /usr/bin/ruby;
...
}
Installing Nginx using yum does not work either. The issue persists even when passenger-install-nginx-module
is executed again.
[vagrant@vm-one ~]$ sudo systemctl status nginx.service -l
nginx.service - The nginx HTTP and reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled)
Active: failed (Result: exit-code) since Thu 2015-01-01 01:55:56 UTC;
2min 19s ago
Process: 7963 ExecStop=/bin/kill -s QUIT $MAINPID (code=exited, status=0/
SUCCESS)
Process: 7935 ExecStart=/usr/sbin/nginx (code=exited, status=0/SUCCESS)
Process: 10814 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
Main PID: 7937 (code=exited, status=0/SUCCESS)
Jan 01 01:55:56 vm-one.local systemd[1]: Starting The nginx HTTP and reverse
proxy server...
Jan 01 01:55:56 vm-one.local nginx[10814]: nginx: [emerg] unknown directive
"passenger_enabled" in /etc/nginx/conf.d/puppet.conf:5
Jan 01 01:55:56 vm-one.local nginx[10814]: nginx: configuration file /etc/nginx
/nginx.conf test failed
Jan 01 01:55:56 vm-one.local systemd[1]: nginx.service: control process exited,
code=exited status=1
Jan 01 01:55:56 vm-one.local systemd[1]: Failed to start The nginx HTTP and
reverse proxy server.
Jan 01 01:55:56 vm-one.local systemd[1]: Unit nginx.service entered failed state.
Trying to install another web server with Passenger support results in:
* Checking for Apache 2...
Found: no
* Checking for Apache 2 development headers...
Found: no
This indicates that passenger-install-apache2-module
in contrast to passenger-install-nginx-module
seems to check whether a web server has been installed or not.