hetman
03-14-2003, 08:17 PM
is it possible to be able to access 2 different web sites hosted on a machine with the same ip for both but using different domain names?
|
Click to See Complete Forum and Search --> : how to forward/bind port to domain? hetman 03-14-2003, 08:17 PM is it possible to be able to access 2 different web sites hosted on a machine with the same ip for both but using different domain names? bwkaz 03-15-2003, 12:04 AM Of course. You can even use the same port, assuming all your users are using recent (read: released sometime after Netscape 2 or so) browsers, that send the HOST string as part of the HTTP GET command. Look at Apache 2's virtual host documentation (http://httpd.apache.org/docs-2.0/vhosts/). Of course, I am assuming you use Apache 2; if you're still using 1.3 for some reason, I'm pretty sure vhost documentation exists for it too, but I don't know offhand where it would be, other than somewhere at apache.org. hetman 03-15-2003, 01:16 AM sweet. thanks. that works nice. what about this scenario. if i have 2 linux machines, both running apache, both behind a router under only one ip. could i set this up so each of the linux machines has its own name.domain.com that it loads up? ex. box1.domain.com loads a web page from box 1 and box2.domain.com loads from box 2 bwkaz 03-15-2003, 09:59 AM You may have to go with different ports for that scenario. Set the router's iptables up to forward port 80 (for example) to box 1, and port 8080 to box 2. Then you'd have to use box1.mydomain.com and box2.mydomain.com:8080, and have them resolve to the same IP address -- your router's public one. Or, you might be able to set something up with www.dyndns.org to forward from box2.mydomain.com to <your public IP>:8080 and from box1.mydomain.com to <your public IP>:80. I think they provide services like that, but it might cost a few bucks. The upside is that you don't have to tell people to use a different port for box2. hetman 03-15-2003, 10:10 AM yeah thats what i feared... was hoping to avoid that since adding ports to the address kinda sux. thats the setup i have going on now actually. both domains point to one ip, but if you access a diff port u get the 2nd pc. another way i though about it was to make a virtual host point to only the one computer, but the root of the 2nd web page is actually a nfs mount to the 2nd computer. this way although only one web server is needed, both computers can be accessed via their names. thanks for all the help... cleared some stuff up bwkaz 03-15-2003, 12:05 PM Yeah, that would work too (the NFS mount thing). justlinux.com
Copyright Internet.com Inc. All Rights Reserved. |