|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hosting two sites on one ip Adress
Let's say that I own two domain names: myblog.com and myforum.com.
The blog and forum are both hosted on the same box, just under different directories. Therefore they have the same IP address. When I set up the dns entries for myblog.com and myforum.com, i need them to point to the ip address AND the directory, however GoDaddy's dns tool says that's not allowed. Is this the wrong way to do this? Is there a better way? Thanks, vital101 |
|
#2
|
||||
|
||||
|
Quote:
Welcome to Dev Shed. DNS will be used to point an IP address to a domain (or in this case, domains). Then since the domains will be on the same box, you can setup your webserver for virtual hosts. The Virtual Hosts are what will set the particular directory for each domain. Just a few questions: What web server will you be using? What OS are you running? You're using GoDaddy's DNS config tool... do you have a dedicated server with them, or are you using their DNS manager to point to your own box? |
|
#3
|
|||
|
|||
|
I have been hosting multiple sites on the same IP for ages. In the DNS all the A records point to the IP address of the webserver (which in this case will be the same IP for both domains). You can then differentiate the two websites by using Host Header Names which you configure in the webserver. The way i understand it is the webserver checks what domain name the client actually typed in and then matches it with a host header name you have assigned a website.
I can only describe it for IIS on windows as thats all i've ever run. You open the properties of the website in IIS, on the website tag select the IP that the website will use (this can be left as unassigned if the server only has 1 IP and there are no other webservers on your network). Click the advanced button next to it. A window opens and you will see in the top box is a record that relates to the IP address of the webserver. Select it and click edit and there you can enter the Host Header Name. This is just the web address without http:// I use IIS on Windows server and it works really well. I understand it has a few drawbacks, especially concerning SSL (i think you can only have 1 website using SSL per IP), but otherwise i haven't come across any problems. I'm not 100% sure if it can be done in the same way using software other than IIS but i think it can. Hope that helps in some way, Michael |
|
#4
|
|||
|
|||
|
Thanks for the information. I'm new to using DNS. For your information, I'm using Apache2, running on an Ubuntu Dapper box. I'm using the DNS to point to my own box, as I'm fairly cheap and don't want to pay for a real host. Now that I know what I'm looking for, I'll see what I can find on virtual hosts. However, any more help on configuring Apache to use virtual hosts would be greatly appreciated.
|
|
#5
|
|||
|
|||
|
Solved!
Once again, I can't thank everyone enough for the help. Here's my solution to the problem (for the record).
1) Go to: /etc/apache2/httpd.conf 2) Add something like this: Code:
<VirtualHost *>
ServerName www.mydomainname.com
DocumentRoot /var/www/folder
</VirtualHost>
<VirtualHost *>
ServerName www.otherdomain.com
DocumentRoot /var/www/otherfolder
</VirtualHost>
3) Restart Apache. This worked like a charm. /vital101 |
|
#6
|
|||
|
|||
|
Not Solved....
Okay, so I have a different issue now but it's still related. I set up my virtual hosts file just like above, however now if I enter my server's ip address (local or outward facing), or either of the domains, they both point to the first entry in the virtual hosts file.
Any ideas? |
![]() |
| Viewing: Dev Shed Forums > System Administration > DNS > Hosting two sites on one ip Adress |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|