Question

use multiple domains on one droplet/server?

Posted February 21, 2015 9k views

Is it possible to have multiple domains on one droplet/server? For example a .net domain, two .no domain ? I have searched and read some questions here, but I dont get my question answered fully. I reckon it is done by using virtual hosts, and I reckon one of the domains need to be the major domain?

Thanks in advance

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

3 answers
by Adam LaGreca
This article runs through setting up Apache virtual hosts on Debian 7.

Thanks for your answer krekas, I will check it out

Short of the long is..
Drop stuff like this at the end of /etc/httpd/conf/httpd.conf

create folders for your html files / site files..
mkdir /var/www/html/site1.com
mkdir /var/www/html/site2com

<VirtualHost *:80>
DocumentRoot “/var/www/html/site1.com”
ServerName site1.com
ServerAlias www.site1.com
<Directory “/var/www/html/site1.com”>
AllowOverride all
allow from all
Options +Indexes
</Directory>
</VirtualHost>

<VirtualHost *:80>
DocumentRoot “/var/www/html/site2.com”
ServerName site2.com
ServerAlias www.site2.com
<Directory “/var/www/html/site2.com”>
AllowOverride all
allow from all
Options +Indexes
</Directory>
</VirtualHost>

Submit an Answer