You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Greg Gamble <gr...@maths.uwa.edu.au> on 2006/06/01 09:14:04 UTC

Apache 2 + Tomcat 5.0.28

Dear fellow-tomcat-users,

I have Apache 2 (as part of a `LAMP' install) and TomCat 5.0.28 installed
on a Debian Linux: 2.6.12-1-686 system
and I want to make Apache and Tomcat listen/connect to the same port.

After a little searching I found:

  http://tomcat.apache.org/connectors-doc-archive/jk2/index.html

which describes how JK2 is a refactoring of JK which replaced JSERV,
but then I read else where that JK2 is no longer supported and all
the `useful' bits from JK2 are now in JK.

I ran into a lot of broken links at that page (including the `here'
link for getting the binaries). So I suspect there is better information,
elsewhere. If so, please tell me where to look.

I'll just ramble on for a bit ... though perhaps someone already knows
where I should be looking for the definitive info. ...

In trying to find the latest version of mod_jk to install, I came across
two files which I downloaded:

jakarta-tomcat-connectors-jk-1.2.14-linux-sles9-x86_64-prefork.so 
jakarta-tomcat-connectors-jk-1.2.14-linux-sles9-x86_64-worker.so 

... should I rename these? ... and if so, to what?

Looking at the install instructions for mod_jk it says to include a
line:

   Include /var/tomcat3/conf/jk/mod_jk.conf-auto

in the Apache httpd.conf file, where /var/tomcat3 should be adjusted
to the appropriate directory for my Tomcat. I have no problem finding
the Apache httpd.conf file but in my tomcat/conf directory there is no
subdirectory jk ... so I'm wondering where this will come from? ...
what do I need to have done before hand to create this directory. The
documentation I was reading said:

`This file is created by enabling the Apache auto-configuration as described
in the Tomcat documentation.'

... but then I could not seem to find mention of it in the Tomcat docs.

I'm sure I've just been looking in all the wrong places. Can someone please
point me in the right direction? ... provide any short-cuts that they may
know? ... or any other info. that may seem pertinent?

Apologies if this is a query that has been answered over and over on this
list, and apologies for the overall length of this email.

  Regards,
  Greg Gamble <gr...@maths.uwa.edu.au>


---------------------------------------------------------------------
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: Apache 2 + Tomcat 5.0.28

Posted by Greg Gamble <gr...@maths.uwa.edu.au>.
On Thu, Jun 01, 2006 at 10:23:35AM +0200, Ga??l Lams wrote:
> Hi
> 
> >I have Apache 2 (as part of a `LAMP' install) and TomCat 5.0.28 installed
> >on a Debian Linux: 2.6.12-1-686 system
> >and I want to make Apache and Tomcat listen/connect to the same port.
> 
> 2 services can not listen to the same port, you probably want Apache
> to listen to port 80 and Tomcat on another port and configure the
> mod_jk apache module + the Java-based Connector on the Tomcat end to
> passe the data between the two.

Thanks for clearing that up.
 
> >....
> 
> Yes, one or two pages contain wrong information, the situation is the 
> following:
> - if you can, use apache 2.2.x and mod_proxy_ajp

I'm going to try this. I've already downloaded, compiled and installed
apache 2.2.2 ... if I reach a brick wall I can't surmount I still
have apache 2.0.55 from a Debian install, that I can fall back on and try
your other suggestion.

Thanks a lot ;-)

Regards,
Greg Gamble

> - if you prefer, or have to, use apache 2.0, use mod_jk. In this case,
> I wouldn't use a connector build for another distribution: download
> the source from tomcat's web site and compile following the
> instructions.
> Then you need to setup working entities, i.e Workers, between the
> apache and Tomcat engines using the mandatory workers.properties file
> (A Tomcat worker is a Tomcat instance that is waiting to execute
> servlets or any other content on behalf of some web server).
> Concrete steps are:
> 1 Create a workers.properties file in your httpd's configuration folder
> 2 Add the module "jk" to the list of apache modules
> 3 modify your httpd.conf to point to the workers file, something like
> JkSet config.file /etc/httpd/workers2.properties
> 4 create the jk.properties file in your tomcat root.
> 5 (optional) Create an apache virtual host "dedicated" to tomcat,
> something like:
> <VirtualHost myhost:80>
>    ServerAdmin webmaster@myhost
>    ServerName myhost
> 
>    DocumentRoot "/opt/jakarta/tomcat/webapps"
> 
>    ErrorLog /var/log/httpd/myhost-error_log
>    CustomLog /var/log/httpd/myhost-access_log combined
> 
> <Location "/*">
>   JkUriSet worker ajp13:localhost:8009
> </Location>
> 
> </VirtualHost>


---------------------------------------------------------------------
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: Apache 2 + Tomcat 5.0.28

Posted by Gaël Lams <la...@gmail.com>.
Hi

> I have Apache 2 (as part of a `LAMP' install) and TomCat 5.0.28 installed
> on a Debian Linux: 2.6.12-1-686 system
> and I want to make Apache and Tomcat listen/connect to the same port.

2 services can not listen to the same port, you probably want Apache
to listen to port 80 and Tomcat on another port and configure the
mod_jk apache module + the Java-based Connector on the Tomcat end to
passe the data between the two.

> After a little searching I found:
>
>   http://tomcat.apache.org/connectors-doc-archive/jk2/index.html
>
> which describes how JK2 is a refactoring of JK which replaced JSERV,
> but then I read else where that JK2 is no longer supported and all
> the `useful' bits from JK2 are now in JK.
> ....
> jakarta-tomcat-connectors-jk-1.2.14-linux-sles9-x86_64-prefork.so
> jakarta-tomcat-connectors-jk-1.2.14-linux-sles9-x86_64-worker.so
>
> ... should I rename these? ... and if so, to what?

Yes, one or two pages contain wrong information, the situation is the following:
- if you can, use apache 2.2.x and mod_proxy_ajp
- if you prefer, or have to, use apache 2.0, use mod_jk. In this case,
I wouldn't use a connector build for another distribution: download
the source from tomcat's web site and compile following the
instructions.
Then you need to setup working entities, i.e Workers, between the
apache and Tomcat engines using the mandatory workers.properties file
(A Tomcat worker is a Tomcat instance that is waiting to execute
servlets or any other content on behalf of some web server).
Concrete steps are:
1 Create a workers.properties file in your httpd's configuration folder
2 Add the module "jk" to the list of apache modules
3 modify your httpd.conf to point to the workers file, something like
JkSet config.file /etc/httpd/workers2.properties
4 create the jk.properties file in your tomcat root.
5 (optional) Create an apache virtual host "dedicated" to tomcat,
something like:
<VirtualHost myhost:80>
    ServerAdmin webmaster@myhost
    ServerName myhost

    DocumentRoot "/opt/jakarta/tomcat/webapps"

    ErrorLog /var/log/httpd/myhost-error_log
    CustomLog /var/log/httpd/myhost-access_log combined

<Location "/*">
   JkUriSet worker ajp13:localhost:8009
</Location>

</VirtualHost>

Hope it helps

Regards,

Gaël