LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Internal DNS server needed?? (https://www.linuxquestions.org/questions/linux-networking-3/internal-dns-server-needed-229634/)

jme 09-12-2004 08:06 AM

Internal DNS server needed??
 
Hey guys.

Soon I will have two web servers sat behind my firewall (smoothwall). At the moment things are pretty simple as I just forward any port 80 requests to the one webserver, but when I get the second server I will need to forward different requests to different machines depending on what domain they are for.

Basically how do I go about this and is it a internal DNS server that I require. Im not looking for someone to give me a complete run down of what to do, but it's a case of not knowing what to look for!

Thanks guys.

Jamie

TigerOC 09-12-2004 11:44 AM

You do not need to have 2 machines to do this. All you need do is configure virtual hosting in apache. There are lots of howto's on this just do a google search on virtual domain hosting. This is how the isp's do their hosting.

jme 09-12-2004 12:07 PM

Quote:

Originally posted by TigerOC
You do not need to have 2 machines to do this. All you need do is configure virtual hosting in apache. There are lots of howto's on this just do a google search on virtual domain hosting. This is how the isp's do their hosting.
I understand virtual hosting - each server is hosting many different sites, but this isn't really related to something as simple as that! If only it was ;)

Becasue of a few problems that a friend is having while moving house, he is moving his server to my house for a few weeks so that his site will still be up. This will be connected to the switch which in on my DMZ with a static IP. I need to know what I have to do to make any requests for the sites on my server go to 192.168.1.195 (my webserver) and those for my friends server to go to 192.168.1.200.

Any ideas are welcome.

Thanks for your response though TigerOC.

Cheers, Jamie

jme 09-19-2004 07:20 AM

Anyone? ;)

netopia 09-19-2004 10:25 AM

I am pretty sure a setup like this isn't possible. The way virtual servers in apache work is this (we'll start from the top of http - 24.x.x.x is your house's IP address)
a web browser looks up www.example.com and gets 24.168.0.1
It opens a connection on port 80 to 24.168.0.1
it says
GET / HTTP/1.1
Host: www.example.com

and from the host header Apache knows which page to serve
Now what you're saying is that www.example.com and www.example2.com will both be pointed at 24.168.0.1 (your house) while your friend's server is there. But web browsers, when they open a connection to your house, aren't specifying the host name. they are only specifying IP address - until the connection is open, i.e. they are already talking to one web server or the other, and it is too late for you to decide which server they should be talking to.

So, you need either:
a) two EXTERNAL (real) IP addresses that can each be pointed to one of the web servers
b) some sort of script on your existing web server that could serve up pages from the other. This wouldn't be too hard to write in PHP or Perl but if you don't already know how to do that, it's not going to be easy to explain in this venue.

slightcrazed 09-30-2004 06:53 PM

Behind a router?
 
Virtual hosting might actually work. Turn your friends box into an NFS server and have it serve the directory where his WWW files are, then you set up your box w/ virtual hosting, mount the NFS share and have the DocumentRoot set to the mount point. Basically you'll be piggy backing his box on yours. Its a bloody awful work around, but it will probably work for the time being.

The only other option I see would be to have your friend set his site to a port other than 80.... he would have to set up a redirector so that requests for his web page come into a port other than 80, and then your router forwards that port to his box, but that could potentially be alot more work.

slight


All times are GMT -5. The time now is 04:59 PM.