Help with setup of Production / Testing environment with Apache on LAMP droplet

October 10, 2015 826 views
Apache LAMP Stack

I would like to setup a Testing / Production environment on my LAMP Droplet.

Basically I have currently two folders under /var/www, let's say:
/var/www/siteA/ --> used for production
/var/www/siteB/ --> used for development

my goal is to be able to access the two sites like this:
SiteA: http://my.ip.address/siteA
SiteB: http://my.ip.address/siteB

but currently whenever I try to access siteB I always get redirected to siteA

How to setup Apache to achieve this?
Thanks in advance!

1 Answer

Apache virtual hosts are a good solution to hosting two sites at different URLs, and this tutorial can help you get it setup.

by Justin Ellingwood
The Apache web server is the most popular way to serve web content on the internet. Apache has the ability to serve multiple domains from a single server by using a mechanism called "virtual hosts". If a virtual host is configured correctly for each domain, the web server can correctly route traffic to the appropriate files based on the domain name requested. In this guide, we'll demonstrate how to configure Apache virtual hosts on an Ubuntu 14.04 VPS.
Have another answer? Share your knowledge.