Forwarding domains rather than ports?
I have been using a linux firewall box (from LRP) for years now, but I haven't *relly* learned linux. The one I have now is portfwarding stuff to internal machines fine.
Can anyone tell me if its possible to forward to internal machines based on the domain requested rather than the port? I am guessing that I would have to forward everything to an apache server, that would then find the files for the right domain using rewrite script (are these the right words?). I'd prefer to be able to do it all from the firewall though. Cliff |
With iptables is extremaly hard to do. It works using IP addresses and ports. Requests are made after domain names were resolved to IPs. That's why you'd need to filter by content of the packages (HTTP requests and so on).
|
for the forwarding of domains.. dont think the firewall can do it. Take a look at virtualhosts and NameVirtualHost in apache.
This will do it no problem.. you tell it that the host is on 192.168.1.2 and then the servername/alais would be.. www.site1.com. ie. NameVirtualHost 192.168.1.2 NameVirtualHost 192.168.1.3 <VirtualHost 192.168.1.2> ServerAdmin you@email.com DocumentRoot /path/to/documents ServerName www.sitename.com ServerAlias sitename.com </VirtualHost> <VirtualHost 192.168.1.3> ServerAdmin you@email2.com DocumentRoot /path/to/documents2 ServerName www.sitename2.com ServerAlias sitename2.com </VirtualHost> This should work no problem... but if all the documents for the sites are on one server take out the IP address's (everywhere above) and replace with an * where the IP's are above. And you would only need one NameVirtualHost directive so comment out the second one. good luck |
All times are GMT -5. The time now is 08:42 PM. |