Johnny Kewl wrote:

----- Original Message ----- From: "Alex Mestiashvili" <[EMAIL PROTECTED]>
To: <users@tomcat.apache.org>
Sent: Friday, June 13, 2008 9:56 PM
Subject: allow access without auth to app from several ip ranges , but leave auth from any other hosts


HI ALL .
I have basic authentication for my tomcat application .
Now I want , allow access without authentication to this app from several ip ranges , but leave auth from any other hosts .
I did not find any solution  in google
Is it possible ?

tomcat version is 6.0.16

Thanks in advance .

Would have to be different pages...
/webapp/servlet
/webapp/servletip

TC security checks everything before you can get at it.... if the page is protected, its protected ;)

Another way is with "programmatic authentication"... ie do the BASIC auth in a servlet yourself... then you can do anything.

Have fun..

---------------------------------------------------------------------------
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---------------------------------------------------------------------------

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Great thanks  to  everyone   , but I've found another way .
I've  created to directories myapp1 and myapp with appropriate web.xml s
I've put reverse proxy with rewrite engine between clients and tomcat

NameVirtualHost *
<VirtualHost *>
       ProxyRequests Off
       <Proxy *>
               AddDefaultCharset off
               Order allow,deny
               Allow from all
       </Proxy>
       ProxyPass / http://localhost:8080/
       CustomLog /var/log/apache2/proxy_log common
       ProxyPassReverse / http://localhost:8080/
       RewriteEngine   on
RewriteCond %{REMOTE_ADDR} !((192\.168\.194\..*$)|(14\.5\..*$)|(14\.30\..*$))
       RewriteRule ^(.*)$ - [C]
       RewriteRule ^/myapp1(.*)$ /$1 [F,L]
        #forbidden for people who tries use directly /myapp1
# this rules are important because otherwise any host can connect to myapp1 , because request goes through proxy and tomcat gets connections from localhost .
       RewriteCond %{REMOTE_ADDR} ^((192\.168\.194\..*$)|(14\.5\..*$))
RewriteRule ^/myapp(.*)$ /myapp1$1 [R,L] RewriteRule "^/(.*)" "http://localhost:8080/$1"; [P] # main rule everything goes via PROXY
       RewriteLog /var/log/apache2/rewrite.log
       RewriteLogLevel 9
</VirtualHost>




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to