Following the series of bash commands along with its comments to allow Nginx Server and Apache Server to be able to run along with each other. There are two conflicts we are resolving in this article:
The duplication in port: both of them are listening to the same port 80
The duplication in default HTML page: this doesn’t matter, it depends on the usage of pointing the server to which service or which static HTML pages. For the further demo purpose of my labs, we will not point both services to serve the same directory. In this case: /var/www/html
# install nginx in ubuntusudoaptupdate-ysudoaptinstallnginx-y# create static folder for nginx and the index filesudomkdir-p/var/www/nginx/htmlsudochmod777-R/var/www/nginx/htmlecho"hello world">/var/www/nginx/html/index.html# update the default site configurationsudonano/etc/nginx/sites-available/default
The following are to be added to the default configuration of the nginx server