Configure Apache Virtual Hosts on Centos 6

(Last Updated On: 02 Jun 2018)

apachevirtualhosts2

About Virtual Hosts

Virtual Hosts are used to run more than one domain off of a single IP address. This is especially useful to people who need to run several sites off of one virtual private server. The sites display different information to the visitors, depending on with which the users accessed the site.There is no limit to the number of virtual hosts that can be added to a VPS. Configure Apache Virtual Hosts on Centos 6

Many people use it to host their websites and apps. In fact, according to the latest statistics, Apache is the most used web server in the world, with Windows IIS following in second and in third the Russian machinery that is Nginx. To setup Apache Virtual Hosts on CentOS 6 just follow our step by step tutorial below.

Apache’s functionality is great and one can find lots of good features for his website or application. In this tutorial, we will provide you with info about Apache Virtual Host through configuration examples on a CentOS 6 VPS.

A virtual host is, in fact, a unit that describes an individual domain in the grand scheme of the Apache web server. It enables you to host multiple websites using one server which is very useful for people that have more than one website.

Every domain that is configured with a virtual host directive inside Apache’s config will direct the visitor to a specific directory where that very website is hosted on the server. For example, you might have your WordPress site installed in /var/www/wordpress/ so when creating the virtual host directive, the document root for the site will be set to /var/www/wordpress/ which will enable the web server to pull the website data from the respective configured directory.

So let’s focus on our task at hand now.

 

Sumber:

  1. Sumber 1
  2. Sumber 2
  3. Sumber 3