Now days nginx is most powerfull web server because it is more resource-friendly than Apache in most cases. It can be used as a web server or a reverse proxy.
we can install nginx on ubuntu server very eaisly because nginx package is available in ubuntu default repositories. Before install any package on server, first of all we should update our local package index on sever. To update local index on server use following command.
Above command will update local package index on server. Now we’ll install nginx using following command.
sudo apt-get install nginx
This command will download latest nginx package and will install it on your server. After installing the nginx you can check it by visiting following url on webbrowser.
you will see output like below on your screen.
To add/upload files to server, Your default document root will be /usr/share/nginx/html/. you can add/update/upload files to this server.
As you have sucessfully installed nginx server, Now we should also have knowledge of some basic commands required to manage nginx server
To start Nginx Server
sudo /etc/init.d/nginx start
To Stop Nginx Server
sudo /etc/init.d/nginx stop
To stop and then start Nginx Server
sudo /etc/init.d/nginx restart
sudo service nginx restart
Now you have sucessfully installed nginx on your server, I will show you how to install php-fpm and its supporting libraries on server in next post. Stay tuned…