Hello Josh,

but it seems like you are using the <Location> directive as if it were a
<Directory> directive.  <Location> points to a mapping.  In the
example I gave <Location "/myapp">....</Location> would map to
http://localhost/myapp and anything inside that.  What you seem to be
doing is pointing to where the directory of your context actually sits
on the machine.

In you case, you should probably use the <Directory>:

<Directory "/drives/a/webapps/intranet1">
    AuthType Basic
    AuthName "protected.zeus.intranet1"
    AuthUserFile /drives/a/webapps/.intranet1_passwd
</Directory>

And then below that, include your mod_jk.conf with your JkMount
mappings in whatever <VirtualHost> directives that you want.

I'm not an Apache configuration expert, but I would think that would
work.

If it doesn't work, you might have more luck by perusing the Apache
configuration documentation and/or checking out the Apache Web Server
user list.

Jake



Tuesday, July 30, 2002, 2:21:35 PM, you wrote:

JL> Hello Jacob,

JL> I have now received three copies of this same message you sent me. It
JL> doesn't appear to work to way you describe, when working with virtual hosts.

JL> --
JL> Josh


>> -----Original Message-----
>> From: Jacob Kjome [mailto:[EMAIL PROTECTED]]
>> Sent: Tuesday, July 30, 2002 1:12 PM
>> To: Tomcat Users List; [EMAIL PROTECTED]
>> Subject: Re: Apache Authentication for Tomcat
>>
>>
>> Hello Josh,
>>
>> I have my Apache authentication set up like this:
>>
>> <Location "/myapp">
>>     AuthType Basic
>>     AuthName "protected area"
>>     AuthUserFile security/.htpasswd
>>     AuthGroupFile security/.htgroup
>>     require group myapp_admin myapp_user
>> </Location>
>>
>> One thing to note is the Apache authentication configuration comes
>> before the JKMounts.  I include mod_jk.conf as the last thing in my
>> httpd.conf file.  I have had no problems with this setup even when
>> passing every request to "/myapp" to Tomcat like:
>>
>> JkMount /myapp ajp13
>> JkMount /myapp/* ajp13
>>
>>
>> Apache *always* catches it first and forces BASIC authentication.
>>
>> Jake
>>
>> Tuesday, July 30, 2002, 11:58:21 AM, you wrote:
>>
>> JL> I'm running apache-2.0.39 and tomcat-4.0.2 using mod_jk
>> compiled on RH7.2. I
>> JL> setup Apache to require authentication for a given virtual
>> host using an
>> JL> htpasswd file. Because the same virtual host has some JkMount
>> directives,
>> JL> some requests are forwarded on to Tomcat without
>> authentication. How can I
>> JL> configure this so Apache always handles and requires
>> authentication for
>> JL> requests prior to handing them off to Tomcat?
>>
>> JL> In my httpd.conf I have the following:
>>
>> JL> <VirtualHost *>
>> JL>     DocumentRoot /drives/a/webapps/intranet1
>> JL>     ServerName intranet1
>> JL>     JkMount /*.jsp zeuscat
>> JL>     JkMount /wup/* zeuscat
>> JL>     ServerAlias *intranet1
>> JL>     <Directory "/drives/a/webapps/intranet1">
>> JL>        AuthUserFile /drives/a/webapps/.intranet1_passwd
>> JL>        AuthName "restricted.zeus.intranet1"
>> JL>        AuthType Basic
>> JL>        Require valid-user
>> JL>     </Directory>
>> JL> </VirtualHost>
>>
>> JL> In my server.xml I have the following:
>>
>> JL> <Host name="intranet1" >
>> JL>      <Context path="" docBase="/drives/a/webapps/intranet1"/>
>> JL>      <Logger className="org.apache.catalina.logger.FileLogger"
>> JL>              directory="logs"  prefix="intranet1_log." suffix=".txt"
>> JL>              timestamp="true"/>
>> JL> </Host>
>>
>>
>> JL> --
>> JL> Josh
>>
>>
>> JL> --
>> JL> To unsubscribe, e-mail:
JL> <mailto:[EMAIL PROTECTED]>
JL>> For additional commands, e-mail:
JL> <mailto:[EMAIL PROTECTED]>



JL> --
JL> Best regards,
JL>  Jacob                            mailto:[EMAIL PROTECTED]


JL> --
JL> To unsubscribe, e-mail:
JL> <mailto:[EMAIL PROTECTED]>
JL> For additional commands, e-mail:
JL> <mailto:[EMAIL PROTECTED]>



JL> --
JL> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
JL> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



-- 
Best regards,
 Jacob                            mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to