7

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?

neptunian
  • 410
  • 4
  • 17

2 Answers2

8

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
neptunian
  • 410
  • 4
  • 17
0
sudo systemctl stop nginx.service

This command will stop Nginx from your EC2 instance, further we also have the following commands to start and also to know the status of Nginx

sudo systemctl start nginx.service
sudo systemctl status nginx.service