Re: Tomcat Native with Apr not initializing on 8443 with SSL

2009-11-27 Thread Alex Mestiashvili

occup_hazard wrote:

Nov 27 02:28:19 emr jsvc.exec[14439]: Nov 27, 2009 2:28:19 AM
org.apache.coyote.http11.Http11AprProtocol init INFO: Initializing Coyote
HTTP/1.1 on http-8080
Nov 27 03:27:07 emr jsvc.exec[14439]: Nov 27, 2009 3:27:07 AM
org.apache.coyote.http11.Http11AprProtocol init INFO: Initializing Coyote
HTTP/1.1 on http-8443
Nov 27 03:27:07 emr jsvc.exec[14439]: Nov 27, 2009 3:27:07 AM
org.apache.coyote.ajp.AjpAprProtocol init INFO: Initializing Coyote AJP/1.3
on ajp-8009
Nov 27 03:27:07 emr jsvc.exec[14439]: Nov 27, 2009 3:27:07 AM
org.apache.catalina.startup.Catalina load INFO: Initialization processed in
3529869 ms
Nov 27 03:27:08 emr jsvc.exec[14439]: Nov 27, 2009 3:27:08 AM
org.apache.catalina.core.StandardService start INFO: Starting service
Catalina
Nov 27 03:27:08 emr jsvc.exec[14439]: Nov 27, 2009 3:27:08 AM
org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine:
Apache Tomcat/5.5.27
Nov 27 03:27:08 emr jsvc.exec[14439]: Nov 27, 2009 3:27:08 AM
org.apache.catalina.core.StandardHost start INFO: XML validation disabled
Nov 27 03:27:12 emr jsvc.exec[14439]: Nov 27, 2009 3:27:12 AM
org.apache.coyote.http11.Http11AprProtocol start INFO: Starting Coyote
HTTP/1.1 on http-8080
Nov 27 03:27:13 emr jsvc.exec[14439]: Nov 27, 2009 3:27:13 AM
org.apache.coyote.http11.Http11AprProtocol start INFO: Starting Coyote
HTTP/1.1 on http-8443
Nov 27 03:27:13 emr jsvc.exec[14439]: Nov 27, 2009 3:27:13 AM
org.apache.coyote.ajp.AjpAprProtocol start INFO: Starting Coyote AJP/1.3 on
ajp-8009
Nov 27 03:27:13 emr jsvc.exec[14439]: Nov 27, 2009 3:27:13 AM
org.apache.catalina.storeconfig.StoreLoader load INFO: Find registry
server-registry.xml at classpath resource
Nov 27 03:27:14 emr jsvc.exec[14439]: Nov 27, 2009 3:27:14 AM
org.apache.catalina.startup.Catalina start INFO: Server startup in 6468 ms


Ok so it started up after a Hour..What could be the reason, is there
some kinda tuning required...?

Please advice..

  

Hello , not enough entropy probably , that is why it takes so long .
with tomcat 6.0.18 you need these options
SSLEngine=on SSLRandomSeed=/dev/urandom/

Listener className=org.apache.catalina.core.AprLifecycleListener 
SSLEngine=on SSLRandomSeed=/dev/urandom/


for older versions I had
RANDFILE=/opt/tomcat/.rnd
export RANDFILE

in the startup.sh script , and rand file was generated by
/usr/bin/openssl rand -out $CATALINA_HOME/.rnd 2048
from init script .

Regards ,
Alex


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



Re: Memory Question

2009-05-05 Thread Alex Mestiashvili

Matt Corban wrote:

Where does Tomcat store the memory usage that it displays in the Server
Status under the Manager console?  I was thinking about writing a shell
script to keep track of the memory usage over time (such as the free memory,
total memory and max memory) and store it in a file.

Thanks,
Matt

  


Hi ,
there is munin plugin which does exactly that .
munin also saves data in rrd database and draws nice graphics .
here is the script , it just parses status page .
http://munin.projects.linpro.no/browser/branches/debian/lenny/trunk/debian/patches/110-node.d-tomcat_jvm.patch

Alex


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



Re: Tomcat with LDAP - admin part authentication

2008-09-26 Thread Alex Mestiashvili

yann bizouerne wrote:

Hi,

I have installed tomcat 6 on our Lunix server.
I have configure it in order to use LDAP authentication for our application
and it is working fine.
My concern is about the admin part of the tomcat server.
Now the tomcat-users.xml seems not used anymore for the admin,manager part.
I have tried my LDAP login,password but it doesn't work for that part of the
server.
Does somebody have a clue how I can now go in the admin part of the tomcat
server ?
Thanks in advance
Yann

  

server.xlm

Realm   className=org.apache.catalina.realm.JNDIRealm
   connectionURL=ldaps://myLap.kernel.net:636
   userPattern=uid={0},ou=People,dc=project
   roleBase=ou=tomcatgroups,dc=project
   roleName=cn
   roleSearch=(uniqueMember={0})
   /


#cat tomcat.ldif
dn: uid=tomcat,ou=People,dc=project
objectClass: inetOrgPerson
uid: tomcat
sn:  app
cn: Tomcat manager
userPassword: test

# cat roles.ldif
dn: cn=tomcat,ou=tomcatgroups,dc=project
objectClass: groupOfUniqueNames
cn: tomcat
uniqueMember: uid=tomcat,ou=People,dc=project

dn: cn=manager,ou=tomcatgroups,dc=project
objectClass: groupOfUniqueNames
cn: manager
uniqueMember: uid=tomcat,ou=People,dc=project 
uniqueMember: uid=tommy,ou=People,dc=project



#cat tomcatgroups.ldif
dn: ou=tomcatgroups,dc=project
objectClass: organizationalUnit
ou: tomcatgroups

something like this
http://tomcat.apache.org/tomcat-6.0-doc/realm-howto.html#JNDIRealm

Alex



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



Re: add memory

2008-09-17 Thread Alex Mestiashvili

Caldarale, Charles R wrote:

From: Alex Mestiashvili
[mailto:[EMAIL PROTECTED]
Subject: Re: add memory

export JAVA_OPTS= -XX:MaxPermSize=256m -Xmx12000m 



Do you really have enough RAM on your server to make a 12 GB heap viable?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

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

  

Hi ,  this server has 16G  ,do you think  something wrong ?


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



Re: Securing Tomcat: HELP

2008-08-29 Thread Alex Mestiashvili

losintikfos wrote:

Thanks for your reply Mark! unfurtunatly the url sent to me contains only
language reference which i am not familier with. Do you know the original
command and where to put, to enforce the security?

I am using Tomcat 6







markt-2 wrote:
  

losintikfos wrote:


Hi Experts,


I am trying to secure my tomcat manager web console from been seen from
the
internet. For example if i open the browser and type the internet address
of
the server, it displays the console where ever i am in the world and
therefore want to hide it from been displayed to WAN users.


Can someone help me:working:
  

http://tomcat.apache.org/tomcat-5.5-doc/config/valve.html

You want the remote address filter.

Mark


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






  

Hi ,

$CATALINA_HOME/conf/Catalina/localhost/manager.xml

cat manager.xml
Context path=/manager debug=0 privileged=true

Valve className=org.apache.catalina.valves.RemoteAddrValve 
allow=127.0.0.1,192.168.1.107/


!-- Link to the user database we will get roles from
ResourceLink name=users global=UserDatabase 
type=org.apache.catalina.UserDatabase/

  --

/Context

Alex


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



Re: Securing Tomcat: HELP

2008-08-29 Thread Alex Mestiashvili

losintikfos wrote:

I have done as said and restarted the server but still wont work for me!
:-((.


  


and what do you have in logs/catalina.out ?

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



Re: SSL on TOMCAT with keytool

2008-08-28 Thread Alex Mestiashvili

Alexey Eronko wrote:

Hello Guys!

Don't beat me because I found so much docs about ssl and keystore but I
can't get it working with together.

I have pem cert,rsa_key and ca cert from my own CA. I don't understand what
kind of cert do I need in keystore to make it works on tomcat.

I tried

 keytool -import -alias tomcat -trustcacerts –file myserver.pem -keystore
keystore.jks

 And I Got error in tomcat :

java.net.SocketException: SSL handshake errorjavax.net.ssl.SSLException: No
available certificate or key corresponds to the SSL cipher suites which are
enabled.

at
org.apache.tomcat.util.net.jsse.JSSESocketFactory.acceptSocket(JSSESocketFactory.java:150)

at
org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:310)

at java.lang.Thread.run(Thread.java:619)

Aug 27, 2008 5:56:28 PM org.apache.tomcat.util.net.JIoEndpoint$Acceptor run

SEVERE: Socket accept failed

 I thought that I need to Impot rsa key also, I tried :

 keytool -import -alias tomcat3 -keyalg RSA -file key -trustcacerts
-keystore .keystore

 I got :

 keytool error: java.lang.Exception: Input not an X.509 certificate

 I've already lost 5 hours to solve this problem, could you please assist me
.

 Thanks a lot

 Alex

  

AFAIK java uses DER format for keystore

so , you have to convert .pem to .der

openssl x509 -in cacert.pem -inform PEM -out cacert.der -outform DER

keytool -import -alias tomcat -keystore 
/usr/java/jdk1.6.0_04/jre/lib/security/cacerts -file cacert.der


Alex

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



Re: How to restrict access to tomcat manager to specific hosts?

2008-08-01 Thread Alex Mestiashvili

Nar Karapetyan wrote:

Hi,

I need to allow access to tomcat manager 
(http://servername:port/manager/html)
only to the localhost using Tomcat's means.

Inspecting the request for the IP, and blocking a non-localhost ip is not 
accepted as per the requirement I have.


How can I do that?

I have tried to add the following to the catalina.policy file, but it didn't 
work:

grant codeBase http://server ip:8080/manager/html {
   permission java.net.SocketPermission 127.0.0.1, connect;
};

Thank you,
Regards,
Nareg Garabedian



  
  

Hi ,

$CATALINA_HOME/conf/Catalina/localhost/manager.xml

$cat manager.xml
Context path=/manager debug=0 privileged=true

 Valve className=org.apache.catalina.valves.RemoteAddrValve 
allow=127.0.0.1,192.168.1.107/


 !-- Link to the user database we will get roles from
 ResourceLink name=users global=UserDatabase 
type=org.apache.catalina.UserDatabase/

   --

/Context



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



Re: problem with tomcat-native 1.1.10 and tomcat 6.0.14

2008-08-01 Thread Alex Mestiashvili

ne_fat_s wrote:

I have the same problem, but with tomcat 6.0.16 and tomcat-native 1.1.14.

I installed the libapr1, libapr1-dev, libssl, libssl-dev packages from
ubuntu hardy heron, and there were no problems when building the native
library. I added export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:path to library
to bin/startup.sh.

And that's it. When I start tomcat, using startup.sh, I get the same logs -

Aug 1, 2008 11:44:49 AM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.14.
Aug 1, 2008 11:44:49 AM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters
[false], random [true].

And that's all she wrote. The process is running, but is not listening on a
port.

Mihai, did you solve this problem? Or does anyone else have a clue as to
what's wrong?

Thanks,
Stefan





Mihai COSTACHE wrote:
  

i have a working tomcat 6.0.14 and now i want to use tomcat-native
beacause it use openssl and not java-ssl

so .. 
1) i installed tomcat-native 1.1.10 
2) i edited server.xml (added SSLCertificateFile, SSLCertificateKeyFile,

SSLPassword and SSLProtocol=TLSv1 to HTTPS Connector ... for HTTP
Connector
nothing has changed)
3) started tomcat again ... no error .. but not tcp sockets (for 8080
and 8443 ports)

only this i have in catalina.out

--
Jan 23, 2008 7:29:12 PM org.apache.catalina.core.AprLifecycleListener
init
INFO: Loaded Apache Tomcat Native library 1.1.10.
Jan 23, 2008 7:29:12 PM org.apache.catalina.core.AprLifecycleListener
init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters
[false], random [true].
---

the tomcat is running but it doesn't listen on any port !!!

---
bin/bash /sbin/runscript.sh /etc/init.d/tomcat-6 start
tomcat2736 58.8  3.3 675280 34696 pts/0Sl   19:50   0:02
\_ /opt/sun-jdk-1.6.0.03/bin/java -server -Xms256M -Xmx512M
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=/var/lib/tomcat-6//conf/logging.properties
-classpath
/usr/share/tomcat-6/lib/:/usr/share/tomcat-6//lib:/opt/sun-jdk-1.6.0.03/lib/tools.jar:/usr/share/tomcat-6//bin/bootstrap.jar:/usr/share/tomcat-6//bin/tomcat-juli.jar
-Dcatalina.base=/var/lib/tomcat-6/ -Dcatalina.home=/usr/share/tomcat-6/
-Djava.io.tmpdir=/var/tmp/tomcat-6/ org.apache.catalina.startup.Bootstrap
start
--




  

I think the problem in slow /dev/random
I generate in my init script  random file :
/usr/bin/openssl rand -out $CATALINA_HOME/.rnd 2048

and then  export RANDFILE environment variable  , so I have next lines 
in my startup.sh

RANDFILE=/opt/tomcat/.rnd
export RANDFILE

here is thread with that problem 
http://marc.info/?l=tomcat-userm=118190563608389w=2



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



Re: FW: Rotate stdout_xxx.log without Restart Tomcat

2008-07-21 Thread Alex Mestiashvili

Alexander Diedler wrote:

Has nobody any idea about rotating Tomcat logfiles??

Alex

-Original Message-
From: Alexander Diedler [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 18, 2008 9:24 AM

To: users@tomcat.apache.org
Subject: Rotate stdout_xxx.log without Restart Tomcat

Hello,

It is possible to implement a log rotation for the Tomcat Default logs
(Stdout, stderr,localhost,Jakarta_service etc) ?

It is a Tomcat 6.0.14 x64 on Windows 2003 Std Ed.

 


Greetings

Alex

 

 



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

  


The problem is windows ...

but , may be this links will be useful for you
http://www.datori.org/?p=7
http://freshmeat.net/projects/perl-logrotate/

but , you should be careful with log rotation , it is better to copy log 
and truncate it , but not rename , in such case restart of tomcat is not 
needed .


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



Re: How to Set up Role in Tomcat

2008-07-16 Thread Alex Mestiashvili

Guojun Zhu wrote:

Hi,

We are using Tomcat 5.5 in a linux box.  And I am trying to set up the Realm
security for our webapp.   I only want a password and username challenge for
this webapp only.  So I guess I need to set up a role corresponding to it
directly.  I look around and did not find much information about how to do
this.  I found a section in the servlet spec., but it is quite general and
no specific details.  Can anyone give me more specific information on this
please?   I am not minding spend a couple of days to read.  I can program in
java and know the basic things about the language, not as advanced as to the
architecture level.  But I am very much willing to learn it.  Thanks.

Sincerely
zhu, Guojun

  

Have you tried google ?

http://www.onjava.com/pub/a/onjava/2001/07/24/tomcat.html


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



Re: Restart TC with cron/sh

2008-07-08 Thread Alex Mestiashvili

Piller Sébastien wrote:

Hello,

I have my application in production for a month now. I've some problem 
of memory leak that force me to restart TC each few days. I'm trying 
to automate this operation with a cron that runs a *.sh file. But I 
don't know how what to write in it. Actually, I've this:



do you have shebang header in your script ? - something like this #!/bin/sh

and do you have tomcat running under root ? -this is very not secure ...

/usr/local/tomcat/bin/shutdown.sh
killall -9 java
/usr/local/tomcat/bin/startup.sh

But when I run it using SSH, it makes a weird error:

[EMAIL PROTECTED] bin]# /usr/local/tomcat/bin/restart.sh
: No such file or directoryrt.sh: line 1:* 
/usr/local/tomcat/bin/shutdown.sh*
are this script executable ? if  not use chmod to set for example 755 
permissions

another thing about CRON , absolute paths to scripts must be used ...


: no process killed
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:   /usr/java/jre1.5.0_06

... but shutdown.sh exists!

Does anybody have an example of a script that restart Tomcat?


I have one , I use it for my init script for tomcat ...
if you are interesting in bash scripting , here is great manual 
http://www.tldp.org/LDP/abs/  or just google  Advanced Bash-Scripting 
Guide

restart.sh

#!/bin/sh

TOMCAT_USER=tomcat
CATALINA_HOME=/opt/tomcat
PATH=/bin:/sbin:/usr/bin:/usr/sbin
startdaemon=$CATALINA_HOME/bin/startup.sh
stopdaemon=$CATALINA_HOME/bin/shutdown.sh

export CATALINA_HOME

case $1 in
   start)
   sudo -u $TOMCAT_USER $startdaemon  
$CATALINA_HOME/logs/catalina.out 21

   ;;
   stop)
   sudo -u $TOMCAT_USER  $stopdaemon  
$CATALINA_HOME/logs/catalina.out 21

   while [[ $i -lt 10 ]]
   do
   status=`pidof java 21/dev/null ; echo $?`
   if  [[ $status == '0' ]]
   then
   echo -n .
   sleep 2
   fi
   let i += 1
   done
   status=`pidof java 21/dev/null ; echo $?`
   if  [[ $status == '0' ]]
   then
   echo Killing ALL JAVA Processes
   /usr/bin/killall -9 java
   fi
   ;;
   restart)
   echo Stopping Tomcat
   $0 stop
   sleep 2
   echo Starting Tomcat
   $0 start
   ;;
   *)
   echo Usage: $0 {start|stop|restart}
exit 1
   ;;
esac
exit 0



Thanks a lot!




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





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



Re: Running CGI (Perl) = Can't load module DBI

2008-07-08 Thread Alex Mestiashvili

Joris Kimpe wrote:

Hi all,

don't know if this is the correct place, but here it goes...

I've created a cgi script (perl) which need to run in Tomcat 5.5.  But when
I try to connect to our database, the error I get is:

install_driver(DB2) failed: Can't load
'w:/win32/install/core/CO_PERL/site/lib/auto/DBD/DB2/DB2.dll' for module
DBD::DB2: load_file:The specified module could not be found at
w:/win32/install/core/CO_PERL/lib/DynaLoader.pm line 230.
 at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at W:\win32\install\core\CO_TOMCAT\webapps\xtremis\WEB-INF\cgi\present.pl
line 283

If I check for the dll, I see that is present in this directory...

If I copy some dll's from C:\Program Files\IBM\SQLLIB\BIN to the same
directory, it works fine...  But I don't think this is the way to do it.

My question now is, how can I set a custom environment variable which I can
use in my perl script (while running in Tomcat).

Thanks!

  

Hi ,
I am not sure that it will help , but

for environment variables you can use %ENV  hash

and if you want to define some places with perl modules , you can  use
@INC array

here is an example
#!/usr/bin/perl

foreach my $val (keys (%ENV) ) {
   print $ENV{$val};
}

push (@INC,'/usr/lib/my_modules');

foreach my $val(@INC) {
   print $val\n;
}

$perl env.pl
DCOPRef(konsole-3234,session-6)/local/adm/.Xauthority\h:\w\$ local| 
/usr/bin/lesspipe 
%s/tmp/ssh-HUJSRj3179/agent.3179/stable/rooten_US.UTF-8root/usr/lib/jvm/jdk1.6.0_05/jreroot1;31/usr/bin/lesspipe 
%s 
%s3/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/bin/X11:/usr/lib/jvm/jdk1.6.0_0

skip
/usr/local/lib/perl/5.10.0
/usr/local/share/perl/5.10.0
/usr/lib/perl5
/usr/share/perl5
/usr/lib/perl/5.10
/usr/share/perl/5.10
/usr/local/lib/site_perl

or another example  (best) which i've found here 
http://www.devdaily.com/perl/edu/articles/pl010015/


#!/usr/bin/perl

use lib /home/george/modules;

print [EMAIL PROTECTED] is @INC\n;

$perl inc.pl
@INC is /home/george/modules /etc/perl /usr/local/lib/perl/5.10.0 
/usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 
/usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .





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



Re: allow access without auth to app from several ip ranges , but leave auth from any other hosts

2008-06-16 Thread Alex Mestiashvili

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]



allow access without auth to app from several ip ranges , but leave auth from any other hosts

2008-06-13 Thread Alex Mestiashvili

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 .


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