You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by bcochofel <br...@gmail.com> on 2006/10/30 15:00:44 UTC

mod_jk configuration

I'm new to tomcat and mod_jk and I have a question abou the configuration...
I can access  http://localhost:8080/jsp-examples
http://localhost:8080/jsp-examples  and  http://localhost/jsp-examples/
http://localhost/jsp-examples/  but when I try 
http://localhost/jsp-examples http://localhost/jsp-examples  (without the /)
I get this error:

Forbidden
You don't have permission to access /jsp-examples on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an
ErrorDocument to handle the request.

Here's my jk.conf (/etc/apache2/conf.d/jk.conf):

http://www.nabble.com/file/3907/jk.conf jk.conf 

Can someone help me on this?
Thanks,
Bruno
-- 
View this message in context: http://www.nabble.com/mod_jk-configuration-tf2539505.html#a7074844
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: mod_jk configuration

Posted by bcochofel <br...@gmail.com>.
Well I would appreciated... 


Jorge Cabrera wrote:
> 
> Hi,
> 
> Christopher Schultz wrote:
>> Bruno,
>>
>>   
>>> when I try
>>> http://localhost/jsp-examples http://localhost/jsp-examples  (without
>>> the /)
>>> I get this error:
>>>
>>> Forbidden
>>> You don't have permission to access /jsp-examples on this server.
>>> Additionally, a 403 Forbidden error was encountered while trying to use
>>> an
>>> ErrorDocument to handle the request.
>>>     
> That happened to me once and the problem was in Apache's configuration. 
> I had to specify a <directory> for jsp-examples and set the correct 
> permissions with AllowOverride.
>>
>> It looks like you have Indexes turned off for this directory/location in
>> httpd.conf, or you don't have an index.html (or whatever) file there to
>> display.
>>
>> In that case, it's not surprising that Apache httpd is generating this
>> error (note that it's httpd, not Tomcat, that is generating the error).
>>
>> If you want Tomcat to respond to requests for the URI with no trailing
>> slash, you'll have to map that explicitly.
>>
>>   
>>> Here's my jk.conf (/etc/apache2/conf.d/jk.conf):
>>>
>>> http://www.nabble.com/file/3907/jk.conf jk.conf 
>>>     
>>
>> I'm guessing that was a copy/paste error. Let me guess what you have in
>> jk.conf:
>>
>> JkMount /jsp-examples/*       worker1
>> and/or
>> JkMount /jsp-examples/*.jsp   worker1
>>
>> Since "/jsp-examples" does not match "/jsp-examples/*", your mappings
>> are failing. You'll need to add something like:
>>
>> JkMount /jsp-examples         worker1
>>
>> Hope that helps,
>> -chris
>>
>>   
> Hope this helps, if you need the specific lines in Apache tell me and 
> I'll send them.
> 
> -- 
> 
> Jorge Cabrera
> Consultor técnico
> Ándago Ingeniería - www.andago.com
> 
> Teléfono: +34 912 732 228
> Móvil: +34 637 741 034
> e-mail: jcabrera@andago.com
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/mod_jk-configuration-tf2539505.html#a7076457
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: mod_jk configuration

Posted by Jorge Cabrera <jo...@map.es>.
Hi,

Christopher Schultz wrote:
> Bruno,
>
>   
>> when I try
>> http://localhost/jsp-examples http://localhost/jsp-examples  (without the /)
>> I get this error:
>>
>> Forbidden
>> You don't have permission to access /jsp-examples on this server.
>> Additionally, a 403 Forbidden error was encountered while trying to use an
>> ErrorDocument to handle the request.
>>     
That happened to me once and the problem was in Apache's configuration. 
I had to specify a <directory> for jsp-examples and set the correct 
permissions with AllowOverride.
>
> It looks like you have Indexes turned off for this directory/location in
> httpd.conf, or you don't have an index.html (or whatever) file there to
> display.
>
> In that case, it's not surprising that Apache httpd is generating this
> error (note that it's httpd, not Tomcat, that is generating the error).
>
> If you want Tomcat to respond to requests for the URI with no trailing
> slash, you'll have to map that explicitly.
>
>   
>> Here's my jk.conf (/etc/apache2/conf.d/jk.conf):
>>
>> http://www.nabble.com/file/3907/jk.conf jk.conf 
>>     
>
> I'm guessing that was a copy/paste error. Let me guess what you have in
> jk.conf:
>
> JkMount /jsp-examples/*       worker1
> and/or
> JkMount /jsp-examples/*.jsp   worker1
>
> Since "/jsp-examples" does not match "/jsp-examples/*", your mappings
> are failing. You'll need to add something like:
>
> JkMount /jsp-examples         worker1
>
> Hope that helps,
> -chris
>
>   
Hope this helps, if you need the specific lines in Apache tell me and 
I'll send them.

-- 

Jorge Cabrera
Consultor técnico
Ándago Ingeniería - www.andago.com

Teléfono: +34 912 732 228
Móvil: +34 637 741 034
e-mail: jcabrera@andago.com


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


Re: mod_jk configuration

Posted by Martin Gainty <mg...@hotmail.com>.
Bruno-

box:
login as root to the box
tomcat:
 login with tomcat-user (such as admin or manager) that already has admin,manager privs

M-
This e-mail communication and any attachments may contain confidential and privileged information for the use of the 
designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its 
contents
----- Original Message ----- 
From: "bcochofel" <br...@gmail.com>
To: <us...@tomcat.apache.org>
Sent: Monday, October 30, 2006 10:19 AM
Subject: Re: mod_jk configuration


> 
> Well I've tried adding DirectoryIndex index.html index.htm index.jsp but no
> good...
> My Apache configuration has this and all the links work with or without the
> /
> Does jk.cong overrides my apache conf?
> 
> 
> Christopher Schultz-2 wrote:
>> 
>> Bruno,
>> 
>>> when I try
>>> http://localhost/jsp-examples http://localhost/jsp-examples  (without the
>>> /)
>>> I get this error:
>>> 
>>> Forbidden
>>> You don't have permission to access /jsp-examples on this server.
>>> Additionally, a 403 Forbidden error was encountered while trying to use
>>> an
>>> ErrorDocument to handle the request.
>> 
>> It looks like you have Indexes turned off for this directory/location in
>> httpd.conf, or you don't have an index.html (or whatever) file there to
>> display.
>> 
>> In that case, it's not surprising that Apache httpd is generating this
>> error (note that it's httpd, not Tomcat, that is generating the error).
>> 
>> If you want Tomcat to respond to requests for the URI with no trailing
>> slash, you'll have to map that explicitly.
>> 
>>> Here's my jk.conf (/etc/apache2/conf.d/jk.conf):
>>> 
>>> http://www.nabble.com/file/3907/jk.conf jk.conf 
>> 
>> I'm guessing that was a copy/paste error. Let me guess what you have in
>> jk.conf:
>> 
>> JkMount /jsp-examples/*       worker1
>> and/or
>> JkMount /jsp-examples/*.jsp   worker1
>> 
>> Since "/jsp-examples" does not match "/jsp-examples/*", your mappings
>> are failing. You'll need to add something like:
>> 
>> JkMount /jsp-examples         worker1
>> 
>> Hope that helps,
>> -chris
>> 
>> 
>>  
>> 
> 
> -- 
> View this message in context: http://www.nabble.com/mod_jk-configuration-tf2539505.html#a7076449
> Sent from the Tomcat - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
>

Re: mod_jk configuration

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Bruno,

> Well I've tried adding DirectoryIndex index.html index.htm index.jsp but no
> good...

Can you post the relevant portions of your httpd.conf?

> Does jk.cong overrides my apache conf?

jk.conf is just included in httpd.conf (right?), so it can certainly
override your httpd.conf.

-chris



Re: mod_jk configuration

Posted by bcochofel <br...@gmail.com>.
Well I've tried adding DirectoryIndex index.html index.htm index.jsp but no
good...
My Apache configuration has this and all the links work with or without the
/
Does jk.cong overrides my apache conf?


Christopher Schultz-2 wrote:
> 
> Bruno,
> 
>> when I try
>> http://localhost/jsp-examples http://localhost/jsp-examples  (without the
>> /)
>> I get this error:
>> 
>> Forbidden
>> You don't have permission to access /jsp-examples on this server.
>> Additionally, a 403 Forbidden error was encountered while trying to use
>> an
>> ErrorDocument to handle the request.
> 
> It looks like you have Indexes turned off for this directory/location in
> httpd.conf, or you don't have an index.html (or whatever) file there to
> display.
> 
> In that case, it's not surprising that Apache httpd is generating this
> error (note that it's httpd, not Tomcat, that is generating the error).
> 
> If you want Tomcat to respond to requests for the URI with no trailing
> slash, you'll have to map that explicitly.
> 
>> Here's my jk.conf (/etc/apache2/conf.d/jk.conf):
>> 
>> http://www.nabble.com/file/3907/jk.conf jk.conf 
> 
> I'm guessing that was a copy/paste error. Let me guess what you have in
> jk.conf:
> 
> JkMount /jsp-examples/*       worker1
> and/or
> JkMount /jsp-examples/*.jsp   worker1
> 
> Since "/jsp-examples" does not match "/jsp-examples/*", your mappings
> are failing. You'll need to add something like:
> 
> JkMount /jsp-examples         worker1
> 
> Hope that helps,
> -chris
> 
> 
>  
> 

-- 
View this message in context: http://www.nabble.com/mod_jk-configuration-tf2539505.html#a7076449
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: mod_jk configuration

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Bruno,

>> Hmm... I didn't know that one could "upload file" to an email...
>> consider using copy/paste in the future. It seems to have worked, here.
> 
> I'm using www.nabble.com...

Ah. I think the list will clip-out attachments. I'm not sure of the
rules, but copy/paste pretty much always works.

>>>     JkMount /cocoon/*  ajp13
> 
> This one works and all the others but tomcat does the job for all the files
> (static content and all)

That's because you said "anything that starts with "/cocoon/" should go
to Tomcat. If you don't want Tomcat to serve those files, then don't use
that kind of JkMount directive.

> What I wan't to do is let Apache serve static content and tomcat serve
> dynamic one...

Apache httpd can only test based upon URI... it has no idea if a
resource will be static or dynamic. You have to map your URIs appropriately.

> In the /jsp-examples everything works fine... I have images, index.html and
> I can run .jsp...
> This is the strange problem I've mentioned.

It's not strange at all: you told Tomcat to handle everything (for
example) for "/cocoon/*". That's /everything/, regardless of it's
static-ness. If you know that cocoon is required for 25 different URIs,
then simply list them all. Or, if you know that cocoon only serves
content for URIs more like this:

/cocoon/a/b/c/*.html

...then only map that portion of the URI space into Tomcat.

Apache httpd is doing /exactly/ what you've asked it to do. You just
need to configure it to do what you want it to do.

-chris


Re: mod_jk configuration

Posted by bcochofel <br...@gmail.com>.


Christopher Schultz-2 wrote:
> 
> Hmm... I didn't know that one could "upload file" to an email...
> consider using copy/paste in the future. It seems to have worked, here.
> 

I'm using www.nabble.com...


Christopher Schultz-2 wrote:
> 
>>     ################### jps-examples ######################
>>     Alias /jsp-examples "/srv/www/tomcat5/base/webapps/jsp-examples"
>>     JkMount /jsp-examples ajp13
>>     JkMount /jsp-examples/*.jsp  ajp13
>>     JkMount /jsp-examples/j_security_check ajp13
> 
> Note that the URI "/jsp-examples/" is not covered by these mappings.
> Apache httpd (and Tomcat) will do exactly what you ask of them, but no
> more. If the URI is off by a single character (in this case, a trailing
> '/'), then the request won't be forwarded to Tomcat.
> 

Well, this one works great, with or without the trailing "/"...


Christopher Schultz-2 wrote:
> 
>>     ################### cocoon ############################
>>     Alias /cocoon "/srv/www/tomcat5/base/webapps/cocoon"
>>     JkMount /cocoon ajp13
>>     JkMount /cocoon/*  ajp13
> 
> No, this one ought to work with a trailing /, since you have a mapping
> for "/cocoon/*". This includes "/cocoon/".
> 

This one works and all the others but tomcat does the job for all the files
(static content and all)
What I wan't to do is let Apache serve static content and tomcat serve
dynamic one...
In the /jsp-examples everything works fine... I have images, index.html and
I can run .jsp...
This is the strange problem I've mentioned.

-- 
View this message in context: http://www.nabble.com/mod_jk-configuration-tf2539505.html#a7098777
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: mod_jk configuration

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Bruno,

bcochofel wrote:
> Christopher Schultz-2 wrote:
>>> Here's my /etc/apache2/conf.d/jk.conf: 
>>> http://www.nabble.com/file/3921/jk.conf jk.conf 
>> (These are never coming through. How are you trying to attach files?)
>>
> 
> I'm using Upload File... option.

Hmm... I didn't know that one could "upload file" to an email...
consider using copy/paste in the future. It seems to have worked, here.

>     ################### jps-examples ######################
>     Alias /jsp-examples "/srv/www/tomcat5/base/webapps/jsp-examples"
>     JkMount /jsp-examples ajp13
>     JkMount /jsp-examples/*.jsp  ajp13
>     JkMount /jsp-examples/j_security_check ajp13

Note that the URI "/jsp-examples/" is not covered by these mappings.
Apache httpd (and Tomcat) will do exactly what you ask of them, but no
more. If the URI is off by a single character (in this case, a trailing
'/'), then the request won't be forwarded to Tomcat.

>     ################### cocoon ############################
>     Alias /cocoon "/srv/www/tomcat5/base/webapps/cocoon"
>     JkMount /cocoon ajp13
>     JkMount /cocoon/*  ajp13

No, this one ought to work with a trailing /, since you have a mapping
for "/cocoon/*". This includes "/cocoon/".

You seem to be missing this mapping for the "jsp-examples" webapp, but
the others have it.

Just be careful about what you do and do not map. You can usually find
the problem by reading your own configuration closely.

Hope that helps,
-chris



Re: mod_jk configuration

Posted by bcochofel <br...@gmail.com>.


Christopher Schultz-2 wrote:
> 
>> Here's my /etc/apache2/conf.d/jk.conf: 
>> http://www.nabble.com/file/3921/jk.conf jk.conf 
> 
> (These are never coming through. How are you trying to attach files?)
> 

I'm using Upload File... option. Here's a copy/paste:

# simple configuration for apache (for AJP connector, modul mod_jk.so)

<IfModule mod_jk.c>

    # workers file
    JkWorkersFile /etc/tomcat5/base/workers.properties
    # log file
    JkLogFile /usr/share/tomcat5/logs/mod_jk.log

    # Set the jk log level [debug/error/info]
    JkLogLevel    info
    # Select the log format
    JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
    # JkOptions indicate to send SSL KEY SIZE,
    JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories
    # JkRequestLogFormat set the request format
    JkRequestLogFormat     "%w %V %T"

    ############### servlets-examples ####################

    Alias /servlets-examples
"/srv/www/tomcat5/base/webapps/servlets-examples"
    JkMount /servlets-examples ajp13
    JkMount /servlets-examples/*  ajp13
    #JkMount /servlets-examples/j_security_check ajp13
    
    ################### jps-examples ######################

    Alias /jsp-examples "/srv/www/tomcat5/base/webapps/jsp-examples"
    JkMount /jsp-examples ajp13
    JkMount /jsp-examples/*.jsp  ajp13
    JkMount /jsp-examples/j_security_check ajp13

    ################### cocoon ############################

    Alias /cocoon "/srv/www/tomcat5/base/webapps/cocoon"
    JkMount /cocoon ajp13
    JkMount /cocoon/*  ajp13
    #JkMount /cocoon/j_security_check ajp13
    
    #################### tomcat-docs ######################

    Alias /tomcat-docs "/srv/www/tomcat5/base/webapps/tomcat-docs"
    JkMount /tomcat-docs ajp13
    JkMount /tomcat-docs/*  ajp13
    #JkMount /tomcat-docs/j_security_check ajp13

    #################### security ##########################

    # The following line prohibits users from directly accessing WEB-INF
    <Location "/jsp-examples/WEB-INF/">
	AllowOverride None
	deny from all
    </Location>
    <Location "/servlets-examples/WEB-INF/">
	AllowOverride None
	deny from all
    </Location>

</IfModule>

-- 
View this message in context: http://www.nabble.com/mod_jk-configuration-tf2539505.html#a7096982
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: mod_jk configuration

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Bruno,

> Now I have an even stranger behavior...
> 
> I can only JkMount /jsp-examples, I did the same to /tomcat-docs,
> /servlets-examples and /cocoon and I get :
> 
> Forbidden
> You don't have permission to access /tomcat-docs/ on this server.
> Additionally, a 403 Forbidden error was encountered while trying to use an
> ErrorDocument to handle the request.

Tomcat is probably redirecting (302) "/tomcat-docs" to "/tomcat-docs/"
(note the trailing slash). Then, Apache httpd gets the new request and
refuses to serve it for whatever reason (probably a missing "Allow"
directive).

You probably need to have:

JkMount /tomcat-docs   ajp13
JkMount /tomcat-docs/  ajp13

> Here's my /etc/apache2/conf.d/jk.conf: 
> http://www.nabble.com/file/3921/jk.conf jk.conf 

(These are never coming through. How are you trying to attach files?)

-chris



Re: mod_jk configuration

Posted by bcochofel <br...@gmail.com>.
Now I have an even stranger behavior...

I can only JkMount /jsp-examples, I did the same to /tomcat-docs,
/servlets-examples and /cocoon and I get :

Forbidden
You don't have permission to access /tomcat-docs/ on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an
ErrorDocument to handle the request.

Here's my /etc/apache2/conf.d/jk.conf: 
http://www.nabble.com/file/3921/jk.conf jk.conf 

My httpd.conf comes with SuSE and has several include options...
-- 
View this message in context: http://www.nabble.com/mod_jk-configuration-tf2539505.html#a7091397
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: mod_jk configuration

Posted by bcochofel <br...@gmail.com>.


Christopher Schultz-2 wrote:
> 
> Bruno,
> 
>>     Alias /jsp-examples "/srv/www/tomcat5/base/webapps/jsp-examples"
>>     JkMount /jsp-examples/*.jsp  ajp13
>>     JkMount /jsp-examples/j_security_check ajp13 
> 
> These three ought to do the trick. Which files aren't being served by
> Apache httpd?
> 

Well I add the line:

JkMount /jsp-examples ajp13

I now I can get  http://localhost/jsp-examples http://localhost/jsp-examples 
to work also...
Thanks
-- 
View this message in context: http://www.nabble.com/mod_jk-configuration-tf2539505.html#a7091265
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: mod_jk configuration

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Bruno,

>     Alias /jsp-examples "/srv/www/tomcat5/base/webapps/jsp-examples"
>     JkMount /jsp-examples/*.jsp  ajp13
>     JkMount /jsp-examples/j_security_check ajp13 

These three ought to do the trick. Which files aren't being served by
Apache httpd?

Can you give an example of a URI that should map successfully to a file
on the disk, but doesn't appear to do so? Can you confirm that it is
Tomcat or httpd that can't find the file?

-chris


Re: mod_jk configuration

Posted by bcochofel <br...@gmail.com>.
Well I tried that but no good... I'vre tried this and still nothing:

    # The following line makes apache aware of the location of
    # the /jsp-examples context
    Alias /jsp-examples "/srv/www/tomcat5/base/webapps/jsp-examples"
    <Directory "/srv/www/tomcat5/base/webapps/jsp-examples">
        Options Indexes FollowSymLinks
        AllowOverride AuthConfig
	
        DirectoryIndex index.html index.htm index.jsp
        Order allow,deny
        Allow from all
    </Directory>

    # Mount 'jsp-examples' directory inside webapps
    #JkMount /jsp-examples/* ajp13
    #JkMount /jsp-examples ajp13
    JkMount /jsp-examples/*.jsp  ajp13
    JkMount /jsp-examples/j_security_check ajp13 

I guess I have to tell tomcat to process all the things for now...


Christopher Schultz-2 wrote:
> 
> 
> But, since you want Apache httpd to handle all the static content,
> you'll have to decide what Tomcat /should/ handle. I would usually have
> something like this for each of my webapps:
> 
> JkMount /webappName/*.jsp  ajp13
> JkMount /webappName/j_security_check ajp13
> 
> This covers all JSPs as well as the built-in J2EE authentication system
> supported by Tomcat. If you have other URIs as well, then you should
> define them. There's nothing wrong with having a lot of JkMount
> directives:
> 

-- 
View this message in context: http://www.nabble.com/mod_jk-configuration-tf2539505.html#a7079096
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: mod_jk configuration

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Bruno,

> But when I use "JkMount /jsp-examples ajp13" doesn't this tell Apache that
> everything inside /jsp-examples "goes"  to Tomcat?

No, it doesn't. JkMount does two kinds of matching: exact and wildcard.

Exact:
JkMount /jsp-examples   ajp13

This will map the URI "/jsp-examples" to Tomcat, and NO OTHERS AT ALL.

Wildcard:
JkMount /jsp-examples/*.jsp ajp13

This will map any URI that looks like "/jsp-examples/ ..... .jsp".

Note that the first example and the second example are completely
separate. If you want Tomcat to handle "/jsp-examples" and everything
inside that URI space, you need to do this:

JkMount /jsp-examples    ajp13
JkMount /jsp-examples/*  ajp13

But, since you want Apache httpd to handle all the static content,
you'll have to decide what Tomcat /should/ handle. I would usually have
something like this for each of my webapps:

JkMount /webappName/*.jsp  ajp13
JkMount /webappName/j_security_check ajp13

This covers all JSPs as well as the built-in J2EE authentication system
supported by Tomcat. If you have other URIs as well, then you should
define them. There's nothing wrong with having a lot of JkMount directives:

JkMount /webappName/servlet/*             ajp13
JkMount /webappName/some/specific/servlet ajp13
JkMount /webappName/another/servlet/name  ajp13
.
.
.

Just list everything that you want Tomcat to handle, and everything else
will be served by Apache httpd.

-chris



Re: mod_jk configuration

Posted by bcochofel <br...@gmail.com>.
But when I use "JkMount /jsp-examples ajp13" doesn't this tell Apache that
everything inside /jsp-examples "goes"  to Tomcat?


Christopher Schultz-2 wrote:
> 
> Bruno,
> 
>> I have one more question, let's take /jsp-examples to explain...
>> I want *.jsp send to tomcat for processing but all static contents
>> processed
>> by apache, how can I do this?
> 
> This should be the default. Anything for which you do not explicitly
> have a "JkMount" directive will be served by Apache httpd and not Tomcat.
> 
> -chris
> 
> 
> 
>  
> 

-- 
View this message in context: http://www.nabble.com/mod_jk-configuration-tf2539505.html#a7078655
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: mod_jk configuration

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Bruno,

> I have one more question, let's take /jsp-examples to explain...
> I want *.jsp send to tomcat for processing but all static contents processed
> by apache, how can I do this?

This should be the default. Anything for which you do not explicitly
have a "JkMount" directive will be served by Apache httpd and not Tomcat.

-chris



Re: mod_jk configuration

Posted by bcochofel <br...@gmail.com>.
I had 
JkMount /jsp-examples         worker1

and now the problem is gone... Thanks

I have one more question, let's take /jsp-examples to explain...
I want *.jsp send to tomcat for processing but all static contents processed
by apache, how can I do this?
Sorry for all the question but I'm new to all this tomcat configuration and
I don't have much time to read all the docs... I need to get this to work by
Wednesday...

So, once more, thanks for the solutions...


Christopher Schultz-2 wrote:
> 
> Bruno,
> 
>> when I try
>> http://localhost/jsp-examples http://localhost/jsp-examples  (without the
>> /)
>> I get this error:
>> 
>> Forbidden
>> You don't have permission to access /jsp-examples on this server.
>> Additionally, a 403 Forbidden error was encountered while trying to use
>> an
>> ErrorDocument to handle the request.
> 
> It looks like you have Indexes turned off for this directory/location in
> httpd.conf, or you don't have an index.html (or whatever) file there to
> display.
> 
> In that case, it's not surprising that Apache httpd is generating this
> error (note that it's httpd, not Tomcat, that is generating the error).
> 
> If you want Tomcat to respond to requests for the URI with no trailing
> slash, you'll have to map that explicitly.
> 
>> Here's my jk.conf (/etc/apache2/conf.d/jk.conf):
>> 
>> http://www.nabble.com/file/3907/jk.conf jk.conf 
> 
> I'm guessing that was a copy/paste error. Let me guess what you have in
> jk.conf:
> 
> JkMount /jsp-examples/*       worker1
> and/or
> JkMount /jsp-examples/*.jsp   worker1
> 
> Since "/jsp-examples" does not match "/jsp-examples/*", your mappings
> are failing. You'll need to add something like:
> 
> JkMount /jsp-examples         worker1
> 
> Hope that helps,
> -chris
> 
> 
>  
> 

-- 
View this message in context: http://www.nabble.com/mod_jk-configuration-tf2539505.html#a7077657
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: mod_jk configuration

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Bruno,

> when I try
> http://localhost/jsp-examples http://localhost/jsp-examples  (without the /)
> I get this error:
> 
> Forbidden
> You don't have permission to access /jsp-examples on this server.
> Additionally, a 403 Forbidden error was encountered while trying to use an
> ErrorDocument to handle the request.

It looks like you have Indexes turned off for this directory/location in
httpd.conf, or you don't have an index.html (or whatever) file there to
display.

In that case, it's not surprising that Apache httpd is generating this
error (note that it's httpd, not Tomcat, that is generating the error).

If you want Tomcat to respond to requests for the URI with no trailing
slash, you'll have to map that explicitly.

> Here's my jk.conf (/etc/apache2/conf.d/jk.conf):
> 
> http://www.nabble.com/file/3907/jk.conf jk.conf 

I'm guessing that was a copy/paste error. Let me guess what you have in
jk.conf:

JkMount /jsp-examples/*       worker1
and/or
JkMount /jsp-examples/*.jsp   worker1

Since "/jsp-examples" does not match "/jsp-examples/*", your mappings
are failing. You'll need to add something like:

JkMount /jsp-examples         worker1

Hope that helps,
-chris