Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/etc/init.d/nginx not executable

I searched on the internet for a while now and I don't find a solution so I am asking here: My question is, why is this file (/etc/init.d/nginx) not executeable?

I was following the tutorial of Alex yesterday and I got into an issue. Everything worked until 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 googling some time I found a potential answer, but this was already done in the tutorial/walkthrough of Alex:

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

Some info if you don't want to read the tutorial:

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

So I would be very thankful if anyone could help me. Thanks!

like image 277
Nick Schmidt Avatar asked Jan 25 '14 08:01

Nick Schmidt


1 Answers

Make sure the variables in your init script are correct:

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

For instance, 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.

like image 91
Hyperfocus Avatar answered Oct 09 '22 14:10

Hyperfocus