LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 03-30-2004, 03:21 PM   #1
cquinn
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.

Cliff
 
Old 03-30-2004, 03:30 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,569

Rep: Reputation: 171Reputation: 171
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, 11:43 AM   #3
tuxguy
Member
 
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 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
 
  


Reply


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 05:03 PM
Iptables not forwarding ports pIscIs Linux - Networking 9 05-02-2005 08:56 AM
Linksys router- forwarding ports glore Linux - Networking 1 06-02-2004 12:00 AM
Forwarding ports Xenocide Linux - Networking 0 12-29-2003 06:12 PM
forwarding mail ports ewlnxnewB Linux - Networking 2 12-04-2003 04:46 PM


All times are GMT -5. The time now is 11:28 PM.

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