Follow below steps to install nginx web server in Ubuntu :
Note : Machine Need to Full/Network Bypass if the Web-sense or proxy is used in organization, because "nginx" need many dependency packages which is available only on internet.
Open Terminal > and get the updates first using below command
Apt-get update
Once update complete kindly Enter below command to install "nginx"
sudo apt-get Install nginx
When Prompted then say Yes to complete the installation
Now Start the Service using below command :
sudo service nginx start
___________________________________________________
Note : Getting an error as below while starting the nginx service
Error : nginx - nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) [closed]
Error : nginx - nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) [closed]
Procedure to resolve this issue :
Find out the running port using below command
netstat -an | grep 80
netstat -an | grep 80
Looks like you already have a webserver running. and port 80 is already in use
( Run this command to see which application is use port 80 )
( Run this command to see which application is use port 80 )
sudo fuser -v 80/tcp
And if you find the Apache or any other web server is installed then kindly stop the service using below command :
E.g. - Apache is installed and it is using port 80 then run below command to stop the same
service apache2 stop
Searches Related Links :
How To Install nginx on Ubuntu
How To Migrate from an Apache Web Server to Nginx on an Ubuntu
Setup NginX Web Server on Ubuntu
Installing nginx on Ubuntu as a high performance web server
Install the high performance Nginx web server on Ubuntu
port 80 already in use error while starting nginx server
nginx server is not starting
already have a webserver running
nginx - nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) [closed]
Ubuntu error with apache: (98)Address already in use
There is already an instance running
nginx fails to start after reboot
How To Migrate from an Apache Web Server to Nginx on an Ubuntu
Setup NginX Web Server on Ubuntu
Installing nginx on Ubuntu as a high performance web server
Install the high performance Nginx web server on Ubuntu
port 80 already in use error while starting nginx server
nginx server is not starting
already have a webserver running
nginx - nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) [closed]
Ubuntu error with apache: (98)Address already in use
There is already an instance running
nginx fails to start after reboot