How to Setup an Apache Virtual Host on CentOS 6
|DIFFICULTY strong>||Basic - 1 | Medium - 2 | Advanced - 3 td>|
|TIME REQUIRED strong>||15-30+ min|
|RELATED PRODUCTS strong>||Linux-based VPS or dedicated servers|
First, we need to create the document root for the virtual host we are about to create. For this example we will use virtualhost.com as the domain but you can use one of your own if you have one availible for this project. We will be logged in as root to complete these commands, permissions will be updated as we progress through the setup.
If this is one of many domains you plan on adding to the server, you want to make sure you create a consistent directory structure that you are able to replicate for other domains.
virtualhost.com being the domain you selected for this project.
Then we need to create an index file to validate whether or not we setup the Virtual Host correctly.
Here is a snippet of code you can use to test your index file.
Virtual Host Is Working
You Have Successfully Configured an Apache Virtual Host on CentOS