Recommended method in managing virtual hosts

May 21, 2016 379 views
LAMP Stack Configuration Management Ubuntu 16.04

Hi there.

I'd like to use a Droplet for a bunch of small websites using Apache's Virtual Hosts, PHP and MySQL. I'd like to do it safely, like putting the hosts in a sandbox (chroot, open base dir) something like that.
I can do this by configuring this all by hand for each domain. That will work fine, but it takes quite some time and it's easy to make a mistake. On the other hand, I could use a bloated manager like DirectAdmin. I could also use a shell script.

I'm wondering about the recommended and most used method to get this done. Thank you in advance.

1 Answer


This is a bit of a difficult question to give a direct answer to as it all comes down to personal preference.

I personally prefer to do it all by hand, with a little help making templates. I will create a base setup that I can then copy with simple modifications.

I like to set a Virtualhost that has some very distinct blank values like URLGOESHERE so I can easily search for them while making modifications.

Scripts and applications can get it done, but I feel that by doing it myself I have complete control over the process from start to finish. This ensure the most accuracy as I can review everything. I actually feel I'm less prone to a mistake by doing it manually vs using an application.

As for a recommended way, I don't believe there is one, and it's all how you feel most comfortable. Obviously I'm just one opinion, but I hope this has helped a bit.

Have another answer? Share your knowledge.