Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.