« Return to Thread: Mod_JK on OSX server 10.5

Re: Mod_JK on OSX server 10.5

by Rainer Jung-3 :: Rate this Message:

Reply to Author | View in Thread

CommonGround Softworks/Phil McNamara schrieb:
> Hi Folks,
> Wondered if someone could help me with ideas on this?
>
> Have a configuration where a separate tomcat instance is installed (So
> apple can't break it :)). Apple's copy of tomcat provided with the
> machine in not running. The new Tomcat (5.5.7) plays fine on port 8080.
> i.e.

As mentioned by others: 5.5.7 is *very old*.

> http://localhost:8080/index.jsp
>
> We want to  move to using apache 2.2 with mod_jk to hand off URI's
> appropriately to tomcat.  
> Have worked through the material in
> http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html
>
> The mod_jk apache module provided with Apple's 10.5 server is enabled.
>
> Added listener to the engine element of server.xml
>
> <Listener className="org.apache.jk.config.ApacheConfig"
> modJK="/usr/libexec/apache2/mod_jk.so" />

Once you have your final configuration, this isn't needed any more. It's
only used to produce a simple basic mod_jk configuration. Tomcat doesn't
use the file by itself, instead the generated file needs to be put into
the httpd configuration. The generated file is only a very simple default.

> The default workers properties file was looked over and edited....
>
> I tweaked the default workers.properties.  Here is some of the file
> content:
>
> # Normaly all you will need to do is un-comment and modify the first three
> # properties, i.e. workers.tomcat_home, workers.java_home and ps.
> # Most of the configuration is derived from these.
> #
> # When you are done updating workers.tomcat_home, workers.java_home and ps
> # you should have 3 workers configured:
> #
> # - An ajp12 worker that connects to localhost:8007
> # - An ajp13 worker that connects to localhost:8009
> # - A jni inprocess worker.
> # - A load balancer worker
> #
> # However by default the plugins will only use the ajp12 worker. To have
> # the plugins use other workers you should modify the worker.list
> property.
> #
> #

These are only comments.

> I did this:
>
>
> workers.tomcat_home=/Applications/Qilan\ 3/Tomcat_Qilan
> #note below is the symlink recommended by Apple in technical QA1170 pgm
> workers.java_home=/Library/Java/Home

Those two don't do anything useful any more. The auto-generation is very
outdated, it produces several non-functional configuration lines
(although they don't technically harm)

>
> but it was not clear to me what should be changed on worker.list.  Left
> as is, to wit
>
> #------ DEFAULT worket list ------------------------------------------
> #---------------------------------------------------------------------
> #
> #
> # The workers that your plugins should create and work with
> #
> # Add 'inprocess' if you want JNI connector
> worker.list=ajp12, ajp13

The worker.list contains a comma-separated list of your worker names.
Worker names can be freely chosen (no special chars allowed). I would
suggest for a simple configuration remove "ajp12" and keep "ajp13".

If your worker is not defined in workers.properties (lines of the form
worker.ajp13.XXX=YYY), then it defaults to localhost port 8009 and
protocol ajp13. This might be fine in your case, but I would suggest to
do an explicit definition of the worker.

> # , inprocess
>
> ---
>
>
> Added listener to the engine element of server.xml
> <Listener className="org.apache.jk.config.ApacheConfig"
> modJK="/usr/libexec/apache2/mod_jk.so" />

Once again?

> Restarted Tomcat and mod_jk.conf was generated along with the auto
> directory and so on.

And so on?
What are the contents of the mod_jk.conf???

> Got the Include in Apache 2.2 httpd.conf pointing to mod_jk.conf squared
> away enough so that Apache starts OK. The include originally errored
> apache when I tried to backslash to escape the space between Qilan and 3.
>  The below seems to work without an error
>
> Include "/Applications/Qilan 3/Tomcat_Qilan/conf/auto/mod_jk.conf"

Yes, path with spaces ...

> The mod_jk apache module provided with 10.5 server is enabled.

Which version of mod_jk?

> I port scanned the machine to check that there is a response from port
> 8009.
> This would appear to indicate that the ajp13 worker is playing correctly
> as defined in workers properties.
>
> I just can't seem to get the handoff to happen for URI's that should
> parse out to be  
> handed to tomcat.
>  All the other tutorial info I have located seems way too dated.
>
> Specifically what I see when I test http://localhost/index.jsp:
>
> Forbidden
> You don't have permission to access /index.jsp on this server.
> Additionally, a 403 Forbidden error was encountered while trying to use
> an ErrorDocument to handle the request.
>
> Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.7l PHP/5.2.5 mod_jk/1.2.23
> Server at localhost Port 80

Aha, so it's mod_jk 1.2.23.

> I do see one console error when I start Apache:
>
> 4/8/08 10:35:36 PM org.apache.httpd[84287] [Tue Apr 08 22:35:36 2008]
> [warn] VirtualHost localhost:0 overlaps with VirtualHost localhost:0, the
> first has precedence, perhaps you need a NameVirtualHost directive
>
> I keep thinking my httpd.conf include is not working properly, but I ran
> out of ideas on how to modify it without an Apache error.
>
> Would appreciate any thoughts...

Not without the contents of mod_jk.conf :(

You can get a little more info by setting JkLogfLevel to debug and then
start httpd and do a single request, which should get forwarded to
Tomcat, but which does not work.

Regards,

Rainer

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

 « Return to Thread: Mod_JK on OSX server 10.5