I am running Fedora 16 32bit and I installed passenger with nginx (option 1 during installation, everything was handled for me). Installation went ok, but nginx is not registered as service.
The only way I can run it is directly through /opt/nginx/sbin/nginx
. There is no possibility to run it via /etc/init.d/nginx
Is there any way how to register it as service?
Create file /etc/systemd/system/nginx.service
with the content:
[Unit]
Description=Nginx
After=syslog.target network.target
[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
[Install]
WantedBy=multi-user.target
After that you can control it with:
sudo systemctl stop|start|restart nginx.service
or
sudo service nginx stop|start|restart
To enable nginx to start on boot you can run sudo systemctl enable nginx.service
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With