If you want to install nginx in your machine then follow the following steps:-
To install nginx on Debian/Ubuntu, you can use the following command:
apt-get install nginx
To install nginx on CentOS and RHEL, you can use the following command:
yum install nginx
If you want to start nginx server, it is very simple if you are using init.d scripts:
service nginx start
If you want to stop nginx server, it is very simple if you are using init.d scripts:
service nginx stop
Nginx servers are busy, it can take a few seconds. If you want a more aggressive kill, you can use following command:
killall -9 nginx
To restart nginx server use following command:-
service nginx restart
Output example:-
Stopping nginx: [ OK ]
Starting nginx: [ OK ]
If you want to reload nginx server, you can use following command:-
service nginx reload
Output example:-
Reloading nginx: [ OK ]