how to set up 2 sites on one server Linux in conjunction nginx + apache

Posted December 11, 2016 2.5k views

How to install and configure the 2 sites on a single Linux server in conjunction nginx + apache on centos 6.
If you can throw off the manual

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

You don’t really need both Apache and Nginx, all sites will work with one, but in some cases you want to do so.
There is Ubuntu tutorial for it but it still can apply to CentOS: How To Configure Nginx as a Reverse Proxy for Apache.

To set up multiple sites, Virtual hosts for Apache and Server Blocks for Nginx will do th job:
How To Set Up Apache Virtual Hosts on CentOS 6.
How To Set Up nginx Virtual Hosts (Server Blocks) on CentOS 6.

by Etel Sverdlov
This tutorial shows you how to set up a new directory, how to grant the correct permissions, how to add content to a new page, how to turn on virtual hosting, and how to, if needed, set up local hosts. Virtual Hosts are used to run more than one domain off of a single IP address and allows you to run multiple sites off of a single DigitalOcean droplet. This tutorial describes how to set up virtual hosts with Apache on Centos