You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Edd Dawson <ed...@gmail.com> on 2007/09/06 17:23:35 UTC

Integration with Apache

Hi

New to the list here :)

I have a server setup as follows:

Apache -> mod_jk2 -> tomcat

There are a number of webapps served by tomcat:

/ROOT -> available on http://www.mydomainname.com/

/webapp2 ->available on http://www.mydomainname.com/webapp2

/webapp3 -> available on http://www.mydomainame.com/webapp3


Now this all works fine, but now I need to add a php forum site onto the
server on the same domain name and have it served on
http://www.mydomainname.com/forum

Trouble is that I cannot for the life of me figure out how to configure this
without moving my /ROOT webapp off the URL http://www.mydomainname.com/ and
into a subdirectory.


Can anyone confirm whether what I want to do is at all possible, and if so
give any pointers as to where i need to be looking to configure it?

Thanks
Ed

Re: Integration with Apache

Posted by Edd Dawson <ed...@gmail.com>.
Ahh, I realise now that JkMount is only available using mod_jk ...

I really would like to keep mod_jk2, is there any way of configuring mod_jk2
as i described in my earlier posting?

On 9/7/07, Edd Dawson <ed...@gmail.com> wrote:
>
> Thanks for the reply Chris.
>
> Should add that I'm coming at this not as the person who set it up, also
> configuring this is not my area of expertise (if you hadn't noticed!).
>
> within the httpd.conf and workers2.properties there are no references to
> JkMount, which i guess may be the issue, am i right in assuming that apache
> will be passing everything to tomcat?
>
> I've done some digging but i'm not all that clear on how or where JkMount
> should be fitted in to the config, can anyone give any pointers?
>
> cheers
> Ed
>
> On 9/6/07, Christopher Schultz <ch...@christopherschultz.net> wrote:
> >
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Ed,
> >
> > Edd Dawson wrote:
> > > I have a server setup as follows:
> > >
> > > Apache [httpd] -> mod_jk2 -> tomcat
> >
> > Stop right there. Delete mod_jk2. Forget it ever existed (everyone else
> > has). Install mod_jk. Okay, now go:
> >
> > > There are a number of webapps served by tomcat:
> > >
> > > /ROOT -> available on http://www.mydomainname.com/
> > >
> > > /webapp2 ->available on http://www.mydomainname.com/webapp2
> > >
> > > /webapp3 -> available on http://www.mydomainame.com/webapp3
> > >
> > >
> > > Now this all works fine, but now I need to add a php forum site onto
> > the
> > > server on the same domain name and have it served on
> > > http://www.mydomainname.com/forum
> > >
> > > Trouble is that I cannot for the life of me figure out how to
> > configure this
> > > without moving my /ROOT webapp off the URL
> > http://www.mydomainname.com/ and
> > > into a subdirectory.
> >
> > Why? Just don't map /forum/*.php to mod_jk. What do your JkMount
> > directives look like?
> >
> > > Can anyone confirm whether what I want to do is at all possible, and
> > if so
> > > give any pointers as to where i need to be looking to configure it?
> >
> > I have all kinds of things happening with Apache httpd -> mod_jk ->
> > Tomcat. You can map anything you want. Static content served by Apache
> > httpd while dynamic stuff comes from TC? Of course. Multiple TC
> > instances within the same URL space? Done. Some TC, some PHP, some CGI?
> > Why not? It's all easy.
> >
> > - -chris
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.7 (MingW32)
> > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> >
> > iD8DBQFG4HWW9CaO5/Lv0PARAnvAAKCH7DLvm4JOWCMSqXyPvIf/PKUMjACgxC3A
> > kHIVn0Uj2z+MEc0m8xDlnc8=
> > =dTQG
> > -----END PGP SIGNATURE-----
> >
> > ---------------------------------------------------------------------
> > 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: Integration with Apache

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Edd,

Edd Dawson wrote:
> Should add that I'm coming at this not as the person who set it up, also
> configuring this is not my area of expertise (if you hadn't noticed!).

You'll do fine ;)

> within the httpd.conf and workers2.properties there are no references to
> JkMount, which i guess may be the issue, am i right in assuming that apache
> will be passing everything to tomcat?

It looks like mod_jk2 uses directives in workers2.properties like this:
[uri:/examples/*]

In mod_jk, this would be:

JkMount /examples/* worker1

If you were using 'worker1' as the configured worker.

Look for [uri:] lines in your workers2.properties file and post them.
I'm guessing it's something like [uri:/*]. You probably want something
like this:

[uri:/yourapp/*.jsp]
[uri:/yourapp/*/j_security_check] (if you're using container auth)
[uri:/yourapp/servlet/*]   (if you're using the 'default' servlet)
[uri:/yourapp/*.do]                       (if you're using struts)

You may need to map other things individually if you are having Tomcat
serve things like static content. If you are using Apache httpd, I'd
recommend having Apache httpd serve that static content for you.

> I've done some digging but i'm not all that clear on how or where JkMount
> should be fitted in to the config, can anyone give any pointers?

As you've discovered, JkMount is appropriate only for mod_jk. I would
highly recommend upgrading to mod_jk... it's not hard, and if your
configuration is as simple as it sounds (send all requests to Tomcat),
migration should be fairly easy. I'd be glad to help.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG4XFC9CaO5/Lv0PARAqzNAJ9830GRFgOi8oHDNeX/JzJBxg/OFgCdEMqK
v1ZgKBqj10bvrDkc4CedW5I=
=7LgX
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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: Integration with Apache

Posted by Edd Dawson <ed...@gmail.com>.
Thanks for the reply Chris.

Should add that I'm coming at this not as the person who set it up, also
configuring this is not my area of expertise (if you hadn't noticed!).

within the httpd.conf and workers2.properties there are no references to
JkMount, which i guess may be the issue, am i right in assuming that apache
will be passing everything to tomcat?

I've done some digging but i'm not all that clear on how or where JkMount
should be fitted in to the config, can anyone give any pointers?

cheers
Ed

On 9/6/07, Christopher Schultz <ch...@christopherschultz.net> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Ed,
>
> Edd Dawson wrote:
> > I have a server setup as follows:
> >
> > Apache [httpd] -> mod_jk2 -> tomcat
>
> Stop right there. Delete mod_jk2. Forget it ever existed (everyone else
> has). Install mod_jk. Okay, now go:
>
> > There are a number of webapps served by tomcat:
> >
> > /ROOT -> available on http://www.mydomainname.com/
> >
> > /webapp2 ->available on http://www.mydomainname.com/webapp2
> >
> > /webapp3 -> available on http://www.mydomainame.com/webapp3
> >
> >
> > Now this all works fine, but now I need to add a php forum site onto the
> > server on the same domain name and have it served on
> > http://www.mydomainname.com/forum
> >
> > Trouble is that I cannot for the life of me figure out how to configure
> this
> > without moving my /ROOT webapp off the URL http://www.mydomainname.com/and
> > into a subdirectory.
>
> Why? Just don't map /forum/*.php to mod_jk. What do your JkMount
> directives look like?
>
> > Can anyone confirm whether what I want to do is at all possible, and if
> so
> > give any pointers as to where i need to be looking to configure it?
>
> I have all kinds of things happening with Apache httpd -> mod_jk ->
> Tomcat. You can map anything you want. Static content served by Apache
> httpd while dynamic stuff comes from TC? Of course. Multiple TC
> instances within the same URL space? Done. Some TC, some PHP, some CGI?
> Why not? It's all easy.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFG4HWW9CaO5/Lv0PARAnvAAKCH7DLvm4JOWCMSqXyPvIf/PKUMjACgxC3A
> kHIVn0Uj2z+MEc0m8xDlnc8=
> =dTQG
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> 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: Integration with Apache

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ed,

Edd Dawson wrote:
> I have a server setup as follows:
> 
> Apache [httpd] -> mod_jk2 -> tomcat

Stop right there. Delete mod_jk2. Forget it ever existed (everyone else
has). Install mod_jk. Okay, now go:

> There are a number of webapps served by tomcat:
> 
> /ROOT -> available on http://www.mydomainname.com/
> 
> /webapp2 ->available on http://www.mydomainname.com/webapp2
> 
> /webapp3 -> available on http://www.mydomainame.com/webapp3
> 
> 
> Now this all works fine, but now I need to add a php forum site onto the
> server on the same domain name and have it served on
> http://www.mydomainname.com/forum
> 
> Trouble is that I cannot for the life of me figure out how to configure this
> without moving my /ROOT webapp off the URL http://www.mydomainname.com/ and
> into a subdirectory.

Why? Just don't map /forum/*.php to mod_jk. What do your JkMount
directives look like?

> Can anyone confirm whether what I want to do is at all possible, and if so
> give any pointers as to where i need to be looking to configure it?

I have all kinds of things happening with Apache httpd -> mod_jk ->
Tomcat. You can map anything you want. Static content served by Apache
httpd while dynamic stuff comes from TC? Of course. Multiple TC
instances within the same URL space? Done. Some TC, some PHP, some CGI?
Why not? It's all easy.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG4HWW9CaO5/Lv0PARAnvAAKCH7DLvm4JOWCMSqXyPvIf/PKUMjACgxC3A
kHIVn0Uj2z+MEc0m8xDlnc8=
=dTQG
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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