You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Wojciech Wasowicz <ww...@softgroup.net.pl> on 2000/12/13 19:10:08 UTC

How to configure Tomcat-Apache connection

I have configured apache and tomcat so they communicate:
apache - http://testlinux.softgroup.net.pl:8080/examples/jsp
    - apache communicating with tomcat
tomcat - http://testlinux.softgroup.net.pl:8085/examples/jsp/index.html
    - tomcat own port
- both are working - but if you will try to run any .jsp example through

apache
it won't run - tomcat runs .jsp ok

Do someone know what to do so that apache support jsp?

TIA
Wojtek




Re: How to configure Tomcat-Apache connection (long)

Posted by Wojciech Wasowicz <ww...@softgroup.net.pl>.
Dave Newton wrote:

> > If I open .jsp file through tomcat - it runs
> > If I open .jsp file through apache - tomcat communication - it displays
> > text of file
>
> I think w/o seeing actual files it'll be tough to help. If you're including
> the conf-auto file and have all your ports etc. set up correctly there's
> nothing in what you've said that would lead me to think there's a problem.
>
> Dave

Ok - here is my conf-auto file.

Wojtek

###################################################################
# Auto generated configuration. Dated: Wed Dec 13 09:54:55 CET 2000
###################################################################

#changes to apache conf so it run jsp pages



#
# The following line instructs Apache to load the jk module
#
LoadModule jk_module libexec/mod_jk.so

JkWorkersFile /home/ww/tomcat/conf/workers.properties
JkLogFile /home/ww/tomcat/logs/mod_jk.log

#
# Log level to be used by mod_jk
#
JkLogLevel error

###################################################################
#                     SSL configuration                           #
#
# By default mod_jk is configured to collect SSL information from
# the apache environment and send it to the Tomcat workers. The
# problem is that there are many SSL solutions for Apache and as
# a result the environment variable names may change.
#
# The following (commented out) JK related SSL configureation
# can be used to customize mod_jk's SSL behaviour.
#
# Should mod_jk send SSL information to Tomact (default is On)
# JkExtractSSL Off
#
# What is the indicator for SSL (default is HTTPS)
# JkHTTPSIndicator HTTPS
#
# What is the indicator for SSL session (default is SSL_SESSION_ID)
# JkSESSIONIndicator SSL_SESSION_ID
#
# What is the indicator for client SSL cipher suit (default is SSL_CIPHER)
# JkCIPHERIndicator SSL_CIPHER
#
# What is the indicator for the client SSL certificated (default is
SSL_CLIENT_CERT)
# JkCERTSIndicator SSL_CLIENT_CERT
#
#                                                                 #
###################################################################

#
# Root context mounts for Tomcat
#
JkMount /*.jsp ajp12
JkMount /servlet/* ajp12

#########################################################
# Auto configuration for the /examples context starts.
#########################################################

#
# The following line makes apache aware of the location of the /examples
context
#
Alias /examples "/home/ww/tomcat/webapps/examples"
<Directory "/home/ww/tomcat/webapps/examples">
    Options Indexes FollowSymLinks
</Directory>

#
# The following line mounts all JSP files and the /servlet/ uri to tomcat
#
JkMount /examples/servlet/* ajp12
JkMount /examples/*.jsp ajp12

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

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

#######################################################
# Auto configuration for the /examples context ends.
#######################################################

#########################################################
# Auto configuration for the /admin context starts.
#########################################################

#
# The following line makes apache aware of the location of the /admin context
#
Alias /admin "/home/ww/tomcat/webapps/admin"
<Directory "/home/ww/tomcat/webapps/admin">
    Options Indexes FollowSymLinks
</Directory>

#
# The following line mounts all JSP files and the /servlet/ uri to tomcat
#
JkMount /admin/servlet/* ajp12
JkMount /admin/*.jsp ajp12

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

#
# The following line prohibits users from directly accessing META-INF
#
<Location "/admin/META-INF/">
    AllowOverride None
    deny from all
</Location>

#######################################################
# Auto configuration for the /admin context ends.
#######################################################

#########################################################
# Auto configuration for the /test context starts.
#########################################################

#
# The following line makes apache aware of the location of the /test context
#
Alias /test "/home/ww/tomcat/webapps/test"
<Directory "/home/ww/tomcat/webapps/test">
    Options Indexes FollowSymLinks
</Directory>

#
# The following line mounts all JSP files and the /servlet/ uri to tomcat
#
JkMount /test/servlet/* ajp12
JkMount /test/*.jsp ajp12

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

#
# The following line prohibits users from directly accessing META-INF
#
<Location "/test/META-INF/">
    AllowOverride None
    deny from all
</Location>

#######################################################
# Auto configuration for the /test context ends.
#######################################################




RE: How to configure Tomcat-Apache connection

Posted by Dave Newton <da...@solaraccess.com>.
> > > I just can't accomplish jsp programs through apache.
> >
> > But what _happens_ when you try?
> >
> > Dave
> 
> If I open .jsp file through tomcat - it runs
> If I open .jsp file through apache - tomcat communication - it displays
> text of file

I think w/o seeing actual files it'll be tough to help. If you're including
the conf-auto file and have all your ports etc. set up correctly there's
nothing in what you've said that would lead me to think there's a problem.

Dave



Re: How to configure Tomcat-Apache connection

Posted by Wojciech Wasowicz <ww...@softgroup.net.pl>.
Dave Newton wrote:

> > I just can't accomplish jsp programs through apache.
>
> But what _happens_ when you try?
>
> Dave

If I open .jsp file through tomcat - it runs
If I open .jsp file through apache - tomcat communication - it displays
text of
file

You can see it in links I've sent earlier

regards
Wojtek



RE: How to configure Tomcat-Apache connection

Posted by Dave Newton <da...@solaraccess.com>.
> I just can't accomplish jsp programs through apache.

But what _happens_ when you try?

Dave


Re: How to configure Tomcat-Apache connection

Posted by Wojciech Wasowicz <ww...@softgroup.net.pl>.
Mike La Budde wrote:

> Please read the mod_jk-howto.html file in your tomcat/doc directory.
>
> NOTES:
> 1) You should be using Tomcat 3.2 (or, perhaps 4.0)

I use 3.2

>
> 2) You should use mod_jk (and not the older mod_jserv)

I use it - I compiletd it from sources and

>
> 3) Make sure you included the autogenerated mod_jk.conf-auto file into
> Apache's httpd.conf file.

I've included it (exactly that file)

>
> 4) Are you really using port 8080 on your Apache server??
>

Yes - because we have many instances of Apache, and this one I've set to port
8080.

>
> good luck, post again if you're unable to get it working (and be more
> specific about your environment, OS vendor/version, tomcat version, jdk
> vendor/version, etc) ....
>

RedHat Linux
jdk 1.2.2

If you will look at links I.ve included - it runs:

http://testlinux.softgroup.net.pl:8085/examples/
- here is directory content with apache footing

I just can't accomplish jsp programs through apache.

> Mike
>
> At 12/13/2000 07:10 PM +0100, you wrote:
> >I have configured apache and tomcat so they communicate:
> >apache - http://testlinux.softgroup.net.pl:8080/examples/jsp
> >     - apache communicating with tomcat
> >tomcat - http://testlinux.softgroup.net.pl:8085/examples/jsp/index.html
> >     - tomcat own port
> >- both are working - but if you will try to run any .jsp example through
> >
> >apache
> >it won't run - tomcat runs .jsp ok
> >
> >Do someone know what to do so that apache support jsp?
> >
> >TIA
> >Wojtek
>

Wojtek


Re: How to configure Tomcat-Apache connection

Posted by Mike La Budde <mi...@irista.com>.
Please read the mod_jk-howto.html file in your tomcat/doc directory.

NOTES:
1) You should be using Tomcat 3.2 (or, perhaps 4.0)
2) You should use mod_jk (and not the older mod_jserv)
3) Make sure you included the autogenerated mod_jk.conf-auto file into 
Apache's httpd.conf file.
4) Are you really using port 8080 on your Apache server??

good luck, post again if you're unable to get it working (and be more 
specific about your environment, OS vendor/version, tomcat version, jdk 
vendor/version, etc) ....

Mike


At 12/13/2000 07:10 PM +0100, you wrote:
>I have configured apache and tomcat so they communicate:
>apache - http://testlinux.softgroup.net.pl:8080/examples/jsp
>     - apache communicating with tomcat
>tomcat - http://testlinux.softgroup.net.pl:8085/examples/jsp/index.html
>     - tomcat own port
>- both are working - but if you will try to run any .jsp example through
>
>apache
>it won't run - tomcat runs .jsp ok
>
>Do someone know what to do so that apache support jsp?
>
>TIA
>Wojtek

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
- - - - - - - - - - - - - - - - - */
  Michael H. La Budde                    email:  mike.labudde@irista.com
  Prosoft, Inc.                                  phone:  414-860-6509
  mike@prosoft-inc.com           fax:    414-860-7014
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
- - - - - - - - - - - - - - - - - */