Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop nginx on my Amazon EC2 instance

I am trying to recompile nginx in order to add the page speed module. Never done anything like this before so a little scared! I am the step after doing "make" where I want to stop nginx. The problem is it seems like it restarts itself because my site never goes down and if I keep running the command it keeps stopping it with a new ID each time:

[ec2-user@ nginx-1.6.0]$ sudo service nginx stop
Stopping nginx: /sbin/service: line 66:  9107 Killed                  env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" ${OPTIONS}

[ec2-user@ nginx-1.6.0]$ sudo service nginx stop
Stopping nginx: /sbin/service: line 66:  9131 Killed                  env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" ${OPTIONS}

[ec2-user@ nginx-1.6.0]$ sudo service nginx stop
Stopping nginx: /sbin/service: line 66:  9151 Killed                  env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" ${OPTIONS}

[ec2-user@ nginx-1.6.0]$ sudo service nginx stop
Stopping nginx: /sbin/service: line 66:  9171 Killed                  env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" ${OPTIONS}

So now I am scared to do a make install while my Nginx is still running because I know I am supposed to stop it before doing a make install. What should I do?

like image 923
neptunian Avatar asked Jul 12 '14 04:07

neptunian


People also ask

How do I stop nginx EXE?

Make a . bat file in the nginx.exe folder with the command: nginx.exe -s quit .

How do I stop an EC2 instance from running?

To terminate an instance using the consoleOpen the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . In the navigation pane, choose Instances. Select the instance, and choose Actions, Instance State, Terminate. Choose Yes, Terminate when prompted for confirmation.


1 Answers

It looks like there is an upstart script that keeps Nginx up and running. After running this command I was able to stop Nginx:

sudo initctl stop nginx
like image 174
neptunian Avatar answered Oct 01 '22 03:10

neptunian