Why to use Nginx?
Nginx is the most popular web servers in the world. It is used for hosting websites and it holds highest traffic sites on internet. It is more resource friendly than Apache.
Step 1: Installing Nginx
Firstly update the packages and then install nginx by these commands:
$ sudo apt-get update
$ sudo apt-get install nginx
You will probably be prompted for your user's password. Enter it to confirm that you wish to complete the installation. The appropriate software will be downloaded to your server and then automatically installed.
Step 2: Check Web server
When you have your servers IP address or domain, enter it into your browser's address bar:
http://server_domain_name_or_IP
Or if you are installing it on localhost than simply write on your browser's address bar and hit enter
localhost
If you will see above snapshot on your domain/ip/localhost page then it means that now you are all set to go!
Step 3: Manage Nginx process
To stop nginx server, write below command:
$ sudo service nginx stop
To start nginx server again, write this command:
$ sudo service nginx start
To restart nginx server, write this command:
$ sudo service nginx restart
We can make sure that our web server will restart automatically when the server is rebooted by typing:
$ sudo update-rc.d nginx defaults
This should already be enabled by default, so you may see a message like this:
System start/stop links for /etc/init.d/nginx already exist.
All done now!
Thanks for reading the blog
0 Comment(s)