/etc/init.d/nginx is not executable

I searched the Internet for a while and I did not find a solution, so I ask here: "My question is: why this file ( /etc/init.d/nginx ) is not running?

Yesterday I studied at Alex and I got into a problem. Everything worked before the service nginx restart command. When I try to run this command, I will get

  nginx: You don't have permissions to execute nginx. 

After a while I found a potential answer, but this has already been done in the tutorial / walkthrough Alex:

  $ sudo chmod +x /etc/init.d/nginx 

Some information if you do not want to read the tutorial:

  • I am using Nginx (as you will know when reading this bit)
  • He installed it using Passenger, and then imported the Nginx Init script and nginx.conf from scratch.
  • Oh and I run Debian instead of Ubuntu, but that shouldn't be a problem or?

Therefore, I would be very grateful if anyone could help me. Thanks!

+6
source share
1 answer

Make sure the variables in the init script are correct:

Here is an example script: http://wiki.nginx.org/Nginx-init-ubuntu

For example, I had to change NGINX_CONF_FILE = "/usr/local/nginx/conf/nginx.conf" to NGINX_CONF_FILE = "/etc/nginx/nginx.conf" and it solved my problem.

+8
source

All Articles