You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Eugene Poole <et...@adelphia.net> on 2007/12/17 01:05:17 UTC

Simple Howto

I'm looking for some reasonably simple instructions on gettting Tomcat 
and Apache working together.

Here's whare I'm at now:

   1. Ever since I learned how to do LVM, that's what I use.
   2. I've always installed the Sun Java at the completion of the
      standard install, and I've installed it at /usr/java with a 4-GB
      file system
   3. I always have installed Tomcat in /usr/tomcat with a 2-GB file system
   4. I always installed Apache HTTPD in /usr/apache
   5. I have always let Apache and Tomcat place their docroots on
      /usr/apache
   6. I run Oracle 10g on this machine as the standard DBMS.

I want to add Fedora DS, Eclipse, and JBoss to my environment - AFTER I 
get my original question solved.  I'm open to altering where the above 
mentioned pieces of software are located.  I am open to doing a fresh 
install on this machine of Fedora 8.

What are some ideas?

TIA,
Gene



---------------------------------------------------------------------
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: Simple Howto

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

Gene,

Eugene Poole wrote:
> I'm looking for some reasonably simple instructions on getting Tomcat
> and Apache working together.

Well, there's always
http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html but
if that's too complex, there's this (off the top of my head):

Once Tomcat and Apache are installed and working independently of each
other, connecting them is simple:

1. If you are using Apache 2.2 or later, you can choose between mod_jk
   (a separate download) and mod_proxy_ajp (ships with Apache 2.2).

If you choose mod_proxy_ajp:

1.  read http://httpd.apache.org/docs/2.0/mod/mod_proxy.html, get
    frustrated because there's no mention of AJP13 in there, and then,
    on a whim, just try:

    ProxyPass /myapp ajp13://localhost:8009/myapp
    PRoxyPassReverse /myapp ajp13://localhost:8009/myapp

    I'm not sure if you need the "reverse" line. I gave up on
    mod_proxy_ajp because I had a configuration I felt was too complex
    to express using it's capabilities, and I opted for mod_jk.

If you choose mod_jk:

1.  Download mod_jk from
    http://tomcat.apache.org/download-connectors.cgi, compile it
    per the instructions in the BUILDINGN file included, and
    install it into your Apache installation (easy: one .so file
    goes alongside all the others).

    Don't forget to enable it in Apache using:

    LoadModule jk_module /path/to/mod_jk-x.y.z.so

2.  Enable the AJP connector in Tomcat's server.xml. Usually, it's the
    one that comes by default as 8009, and I believe it is enabled by
    default through Tomcat 5.5 and perhaps later.

3.  Set up a workers.properties file according to
    http://tomcat.apache.org/connectors-doc/reference/workers.html
    A simple workers.properties file might be:

    workers.list=myOnlyWorker
    myOnlyWorker.type=ajp13
    myOnlyWorker.host=localhost
    myOnlyWorker.port=8009

    Enable this in your Apache configuration using this line:

    JkWorkersFile /path/to/workers.properties

4.  Start with a simple configuration in your Apache config like:

    JkMount /myapp/* myOnlyWorker

    mod_jk supports /much/ more complex configuration. You should
    definitely read
    http://tomcat.apache.org/connectors-doc/reference/apache.html

Reload the Apache configuration and you should be ready to go.

> I want to add Fedora DS, Eclipse, and JBoss to my environment - AFTER I
> get my original question solved.

When you switch to JBoss, you'll technically be switching away from
Tomcat. Since JBoss uses Tomcat internally, everything should work on
the Apache side with no changes. You may need to poke around in the
JBoss configuration to accomplish the same things I outlined above, but
it shouldn't be too bad.

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

iD8DBQFHZcRp9CaO5/Lv0PARAg2jAJsGA5CizW3epbNqVdkYHHhYyPpAkwCgrciH
kylAb0XqIRNnAyfZuXebblI=
=4/HP
-----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