Click to See Complete Forum and Search --> : About 2 or more domains on same IP address
satimis
11-07-2007, 05:42 AM
Hi folks,
Can two or more domain names be mapped to the same IP address, e.g;
aaa.com
bbb.com
ccc.com
mapped to the same IP 123.123.123.123. Would confusion be created on sharing the same IP address? TIA
satimis
deathadder
11-07-2007, 07:25 AM
My understanding is the following...
You can create as many 'aliases' for a domain as you want, so if aaa/bbb/ccc.com all point to same domain, then all you need to do is make sure all of the different domains points to the same address.
However as more likely you've got three different domains that you want to host off the same machine, you'll need to set apache to use Virtual Hosts, have a look here (http://www.linux.com/feature/118471).
The basic would be something like:
<VirtualHost *>
ServerAdmin admin@aaa.com
DocumentRoot /var/www/htdocs/
ServerAlias aaa.com *.aaa.com
</VirtualHost>
<VirtualHost *>
ServerAdmin admin@bbb.com
DocumentRoot /var/www/htdocs/bbb/
ServerAlias bbb.com *.bbb.com
</VirtualHost>
<VirtualHost *>
ServerAdmin admin@ccc.com
DocumentRoot /var/www/htdocs/ccc/
ServerAlias ccc.com *.ccc.com
</VirtualHost>
You'll need to edit your apache config, but it shouldn't be too hard...
satimis
11-07-2007, 08:34 AM
My understanding is the following...
You can create as many 'aliases' for a domain as you want, so if aaa/bbb/ccc.com all point to same domain, then all you need to do is make sure all of the different domains points to the same address.
However as more likely you've got three different domains that you want to host off the same machine, you'll need to set apache to use Virtual Hosts, have a look here (http://www.linux.com/feature/118471).
The basic would be something like:
<VirtualHost *>
ServerAdmin admin@aaa.com
DocumentRoot /var/www/htdocs/
ServerAlias aaa.com *.aaa.com
</VirtualHost>
<VirtualHost *>
ServerAdmin admin@bbb.com
DocumentRoot /var/www/htdocs/bbb/
ServerAlias bbb.com *.bbb.com
</VirtualHost>
<VirtualHost *>
ServerAdmin admin@ccc.com
DocumentRoot /var/www/htdocs/ccc/
ServerAlias ccc.com *.ccc.com
</VirtualHost>
You'll need to edit your apache config, but it shouldn't be too hard...
Thanks for your advice and URL.
I'll use the 2nd domain for test only, following;
PostfixVirtualMailBoxClamSmtpHowto
https://help.ubuntu.com/community/PostfixVirtualMailBoxClamSmtpHowto
The test needs at least 2 domains.
I have my own domain running on static IP and will register another subdomain on changeip.com for this test. They will detect the static IP address.
B.R.
satimis
deathadder
11-07-2007, 08:51 AM
Let us know how it turns out!
ph34r
11-07-2007, 09:20 AM
I'm running 10 domains with 2 ips on the same box. One of the IPs does nothing but act as secondary DNS entry, and has ssh bound on both port 80 and 443 (so I can get out to it if 22 is blocked from somewhere). Gonna change that soon so that the second IP will be secondary DNS and a VPN on 80/443.