Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-30-2004, 02:21 PM   #1
LQ Newbie
Registered: Mar 2004
Location: Victoria, BC
Posts: 1

Rep: Reputation: 0
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.

Old 03-30-2004, 02:30 PM   #2
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,657

Rep: Reputation: 210Reputation: 210Reputation: 210
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).
Old 03-31-2004, 10:43 AM   #3
Registered: Mar 2004
Location: North Bay, Ontario - CANADA
Distribution: Debian
Posts: 77

Rep: Reputation: 16
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 and then the servername/alais would be..



DocumentRoot /path/to/documents

DocumentRoot /path/to/documents2

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Port Forwarding some ports works some don't Sarcha Linux - Networking 2 07-22-2005 04:03 PM
Iptables not forwarding ports pIscIs Linux - Networking 9 05-02-2005 07:56 AM
Linksys router- forwarding ports glore Linux - Networking 1 06-01-2004 11:00 PM
Forwarding ports Xenocide Linux - Networking 0 12-29-2003 05:12 PM
forwarding mail ports ewlnxnewB Linux - Networking 2 12-04-2003 03:46 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:56 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration