2012/8/21 Miguel González Castaños <miguel_3_gonza...@yahoo.es>:
> On 20/08/2012 12:37, Jose María Zaragoza wrote:
>>>
>>>    I assume I can use iptables to redirect people to a different web
>>> server,
>>> but how can I know that I need to redirect them to the maintenance.html
>>> if
>>> that server is serving other web pages too?
>>
>>
>> You can try Valve filters .
>> With Valve, you have access to Request and Response objects
>>
>> I didn't do ever , but it's an idea :-)
>
> maybe I haven't worded my idea correctly. I can't assume the Tomcat service
> in server1 is running all the time (since it's under maintenance, tomcat
> might be restarted a few times during the maintenance). That's why I thought
> about iptables. The issue is that iptables run at the IP level while
> redirects work at application level.

1. Yes, with iptables you can redirect requests to another port number
(where other Tomcat instance runs, or just some other web server).

There is an example of redirecting from port 80 to port 8080 using iptables.

https://wiki.apache.org/tomcat/HowTo#How_to_run_Tomcat_without_root_privileges.3F

Note that there exists the "proxyPort" attribute on <Connector>
element that will tell Tomcat what its public port number is.

2. Maybe you can redirect selectively by remote host address (I do not
remember iptables docs so throughly, but I think it is possible),

but an easier solution might be to just add a different Connector with
different port number (and maybe with address="127.0.0.1" if you are
connecting locally) that you would use for administering.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to