How to host multiple domains on a LAMP server?

April 3, 2014 13.3k views
Hello, I'm away from my droplet more than a month. So, by comming back myself at this some old question came too. How can I host multiple domains on a LAMP droplet? I don't have a glue about on how to do it... Is this just about DNS zone? Which files do I need to change?
6 Answers
I've done some changes about SSL certificates etc. I'm afraid of it getting messed because add or config other domains at the same droplet
this is how i did it.
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.
jntslvdrt, you need to tell us which distro you are using or you may well find you are receiving advice which will not help you. theshiver has kindly given you a link for Ubuntu and that will also work for Debian. But the document root for a Red Hat derived distro such as CentOS is different.

Also, you can probably find what you need to know by following this link: and scrolling though until you find the heading for your distro and scanning for a suitable article in that section.
Ok. I will create a new droplet and move everything from my old one to new one but this time using this

By the way my distro is Ubuntu ^^.
Any doubt I have I gonna back here to annihilate it. Thank you so much
Hello, I have a good answer for you: Webmin

Open an SSH client such as Putty so you can be in the console, logged in as root.

Enter these commands:


dpkg --install webmin_1.680_all.deb

The install will likely not finish due to missing dependencies. To resolve the dependencies and finish webmin install, type:

apt-get install -f

Once done, you can access Webmin by opening a browser and going to https://x.x.x.x:10000

I have 3 websites running on 1 Ubuntu 12.04 droplet and they each use directives (which you can find inside of Webmin) that are like this:


# Indexes + Directory Root.
DirectoryIndex index.php index.html
DocumentRoot /var/www/

# CGI Directory
ScriptAlias /cgi-bin/ /var/www/

Options +ExecCGI

# Logfiles
ErrorLog /var/www/
CustomLog /var/www/ combined


I've installed successful the webmin_1.680 as per your instruction, but afterward i cannot access to http://[MY IP]:10000

Is there any thing wrong? Ubuntu LAMP on 14.04

Have another answer? Share your knowledge.