You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Harold Arando <ar...@estudiantes.ucbcba.edu.bo> on 2001/06/19 16:20:52 UTC

how protect a servlet?

Hi, every body

I have the following problem:

I would like protect a servlet with AuthType Basic, for apache display the dialog "login/pass".

my directory where is my servlet is:

C:/tomcat/webapps/defe/Web-inf/classes/defe/AdministrationServlet.class

the file:  AdministrationServlet.class is the servlet that I would like protect.

my directory where is the file htttp.conf is: 

C:/apache/conf/httpd.conf

what I must put in the file http.conf to protect the servlet AdministrationServlet.class

thanks in advance...

I use apache Version 1.3 and tomcat 3.2.1 please help me....

atte. harold arando

Re: how protect a servlet?

Posted by Harold Arando <ar...@estudiantes.ucbcba.edu.bo>.
thanks for you answer, but I tried but I not find a url apropiate for apache
protect it...

my directory where is my servlet is:
C:/tomcat/webapps/defe/Web-inf/classes/defe/AdministrationServlet.class

I put in <Location "/defe/WEB-INF/">  but not run ?

help me

----- Original Message -----
From: "Jason Koeninger" <jk...@jjcc.com>
To: <to...@jakarta.apache.org>
Sent: Tuesday, June 19, 2001 10:51 AM
Subject: Re: how protect a servlet?


> I believe you need a Location directive in httpd.conf.  You
> would have something like:
>
> <Location /mywebapp>
>    AuthName "myauth"
>    AuthType Basic
>    AuthUserFile /path/to/myauthfile
>    require valid-user
> </Location>
>
> Of course, replace mywebapp as appropriate.  Sounds like you
> may want to protect just one servlet in your app.  If so, adjust the
> Location appropriately.  Just keep in mind that location deals with
> the url path, not the real path on your file system.
>
> Best Regards,
>
> Jason Koeninger
> J&J Computer Consulting
> http://www.jjcc.com
>
>
>
> On Tue, 19 Jun 2001 10:20:52 -0400, Harold Arando wrote:
>
> >Hi, every body
> >
> >I have the following problem:
> >
> >I would like protect a servlet with AuthType Basic, for apache display
the dialog "login/pass".
> >
> >my directory where is my servlet is:
> >
> >C:/tomcat/webapps/defe/Web-inf/classes/defe/AdministrationServlet.class
> >
> >the file:  AdministrationServlet.class is the servlet that I would like
protect.
> >
> >my directory where is the file htttp.conf is:
> >
> >C:/apache/conf/httpd.conf
> >
> >what I must put in the file http.conf to protect the servlet
AdministrationServlet.class
> >
> >thanks in advance...
> >
> >I use apache Version 1.3 and tomcat 3.2.1 please help me....
> >
> >atte. harold arando
> >
>
>


Re: how protect a servlet?

Posted by Jason Koeninger <jk...@jjcc.com>.
I believe you need a Location directive in httpd.conf.  You 
would have something like:

<Location /mywebapp>
   AuthName "myauth"
   AuthType Basic
   AuthUserFile /path/to/myauthfile
   require valid-user
</Location>

Of course, replace mywebapp as appropriate.  Sounds like you 
may want to protect just one servlet in your app.  If so, adjust the 
Location appropriately.  Just keep in mind that location deals with 
the url path, not the real path on your file system.

Best Regards,

Jason Koeninger
J&J Computer Consulting
http://www.jjcc.com



On Tue, 19 Jun 2001 10:20:52 -0400, Harold Arando wrote:

>Hi, every body
>
>I have the following problem:
>
>I would like protect a servlet with AuthType Basic, for apache display the dialog "login/pass".
>
>my directory where is my servlet is:
>
>C:/tomcat/webapps/defe/Web-inf/classes/defe/AdministrationServlet.class
>
>the file:  AdministrationServlet.class is the servlet that I would like protect.
>
>my directory where is the file htttp.conf is: 
>
>C:/apache/conf/httpd.conf
>
>what I must put in the file http.conf to protect the servlet AdministrationServlet.class
>
>thanks in advance...
>
>I use apache Version 1.3 and tomcat 3.2.1 please help me....
>
>atte. harold arando
>