A way to prevent conflict between Nginx and Apache server

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:

  1. The duplication in port: both of them are listening to the same port 80
  2. 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










The following are to be added to the default configuration of the nginx server





After that, we can just restart and test for the result





The results should be returned like this below

Final results of port 8001 and the content of a returned static page

Related posts

Vietnam Dream

Diary #21 – Returning to Tennis game

Diary #18 – Passed the G2 Road Test