View previous topic :: View next topic |
Author |
Message |
Leachim n00b


Joined: 25 Feb 2007 Posts: 66
|
Posted: Sat Jun 21, 2008 8:21 pm Post subject: redirecting port for domains [iptables] |
|
|
Hi all... I have one problem.. I need to redirect port 80 to other ports on server. I mean... I have 3 different apache server running on ports 80, 88, 8080. And redirect will be:
I found an iptables rule
Code: | iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080 |
But this will redirect all requests at port 80, not only for domain domain3.
How can I do this? |
|
Back to top |
|
 |
smerf l33t


Joined: 06 Nov 2004 Posts: 778 Location: Polska
|
Posted: Sun Jun 22, 2008 4:28 pm Post subject: |
|
|
AFAIK it is not possible to use in iptables information from http protocol. Why not use name based virtual hosts? You can still run 3 apache servers (i.e. if you need different versions for each domain) - use mod_proxy. _________________ Microsoft is not the answer, Microsoft is the question, the answer is no. |
|
Back to top |
|
 |
Leachim n00b


Joined: 25 Feb 2007 Posts: 66
|
Posted: Sun Jun 22, 2008 4:55 pm Post subject: |
|
|
Its not for apache, its for another service.... Its for Verlihub (DC++ hub servser software).
That was only example to understand, what I need. |
|
Back to top |
|
 |
smerf l33t


Joined: 06 Nov 2004 Posts: 778 Location: Polska
|
Posted: Mon Jun 23, 2008 5:06 am Post subject: |
|
|
It is not possible, packet has no information about the way the sender got your IP
(under which name he knows your machine) - the only possibility is, that he will put
this somewhere (like Host: header field in http - it is upper layer protocol specific).
Possible solution is to use multiple IP addresses (one for each domain). _________________ Microsoft is not the answer, Microsoft is the question, the answer is no. |
|
Back to top |
|
 |
|