You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tore Skogly <to...@c2i.net> on 2002/05/10 20:17:17 UTC

Tomcat, mod_jk and Apache...again!

I'll give it another try, and hope someone can help me in sorting this problem 
out...

Due to access restrictions my jsp files are located with my static pages under 
the /var/www/html directory. I will use Apache 1.3.23 to serv my static 
pages.
As I will not be deploying any webapps - only a few jsp pages - i would prefer 
to use mod_jk instead of mod_webapp.

When I browse jsp pages located in /var/www/html they are displayed as pure 
text pages and not as html....

Please anyone - I have struggeled with this for several days - can anyone 
help??


This is what I have added in my httpd.conf file:

LoadModule jk_module modules/mod_jk.so
AddModule mod_jk.c

Include /var/tomcat4/conf/auto/mod_jk.conf

# Configure mod_jk
#
JkWorkersFile /var/tomcat4/conf/workers.properties
JkLogFile /var/log/httpd/mod_jk.log
JkLogLevel info

JkMount /*.jsp ajp13

===========================

This is my server.xml file:
<Server port="8005" shutdown="SHUTDOWN" debug="0">

	<Listener className="org.apache.ajp.tomcat4.config.ApacheConfig" 
			modJk="/etc/httpd/modules/mod_jk.so"/>

  <!-- Define the Tomcat Stand-Alone Service -->
  <Service name="Tomcat-Apache">

    <!-- Define a non-SSL HTTP/1.1 Connector on port 8180 -->
    <Connector className="org.apache.catalina.connector.http.HttpConnector"
               port="8180" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8543"
               acceptCount="10" debug="0" connectionTimeout="60000"/>

    <!-- Define an AJP 1.3 Connector on port 8109 -->
    <Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
               port="8009" minProcessors="5" maxProcessors="75"
               acceptCount="10" debug="0"/>

    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Standalone" defaultHost="localhost" debug="0">

       <!-- Global logger unless overridden at lower levels -->
      <Logger className="org.apache.catalina.logger.FileLogger"
              prefix="catalina_log." suffix=".txt"
              timestamp="true"/>

      <!-- Because this Realm is here, an instance will be shared globally -->

      <Realm className="org.apache.catalina.realm.MemoryRealm" />

        <!-- Define the default virtual host -->
      <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true">

	<Listener className="org.apache.ajp.tomcat4.config.ApacheConfig" 
			modJk="/etc/httpd/modules/mod_jk.so"/>
w are you today? 
        <Valve className="org.apache.catalina.valves.AccessLogValve"
                 directory="w are you today? logs"  
prefix="localhost_access_log." suffix=".txt"
                 pattern="common"/>

        <!-- Logger shared by all Contexts related to this virtual host.  By
             default (when using FileLogger), log files are created in the 
"logs"
             directory relative to $CATALINA_HOME.  If you wish, you can 
specify
             a different directory with the "directory" attribute.  Specify 
either a
             relative (to $CATALINA_HOME) or absolute path to the desired
             directory.-->
        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="/var/log/httpd"  prefix="tomcat_localhost_log." 
suffix=".txt"
	        timestamp="true"/>

 
        <!-- Tomcat Manager Context -->
        <Context path="/manager" docBase="manager" 
         debug="0" privileged="true"/>

      </Host>
    </Engine>
  </Service>
</Server>

-- 
regards,
Tore Skogly

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat, mod_jk and Apache...again!

Posted by Tore Skogly <to...@c2i.net>.
Thanks for your help. It made things clearer to me.

I am using ldap to allow only some users to access webpages in different
directories.
Therefore it would be easier for me to keep the jsp pages with my html
stuff.
I guess I could try to edit the server.xml file and set /var/www/html as my
webapp directory,
but I might have to settle with what you suggests - put them in the
$TOMCAT_HOME/webapps directory.

Thanks again for your assistance!

ToreS

----- Original Message -----
From: "Zachary Kuhn" <zk...@pricegrabber.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Friday, May 10, 2002 8:36 PM
Subject: RE: Tomcat, mod_jk and Apache...again!


> Tore,
>     In order to help, please be more descriptive about your access
> restrictions, and the way you have set up your directories. Based on the
> things you have said so far, this may be your problem:
> Tomcat looks in its webapp directory for webapps to deploy. Even a single
> jsp page constitutes a webapp(albeit a simple one).
> I think you are missing this fundamental point of tomcat. Tomcat needs to
> look for your jsp pages, then compile them, and
> put them in a working directory where they can be served. It has no idea
> that there is such a place as /var/www/html, only a
> $TOMCAT_HOME/webapps directory. The only way you could let it know about
> /var/www/html would be to modify the xml config file. But it is much
easier
> to just put your jsp pages in $TOMCAT_HOME/webapps, the way the system was
> designed. Sorry for any errors, but that is my understanding of it.
> Zak






--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Tomcat, mod_jk and Apache...again!

Posted by Zachary Kuhn <zk...@pricegrabber.com>.
Tore,
    In order to help, please be more descriptive about your access
restrictions, and the way you have set up your directories. Based on the
things you have said so far, this may be your problem:
Tomcat looks in its webapp directory for webapps to deploy. Even a single
jsp page constitutes a webapp(albeit a simple one).
I think you are missing this fundamental point of tomcat. Tomcat needs to
look for your jsp pages, then compile them, and
put them in a working directory where they can be served. It has no idea
that there is such a place as /var/www/html, only a
$TOMCAT_HOME/webapps directory. The only way you could let it know about
/var/www/html would be to modify the xml config file. But it is much easier
to just put your jsp pages in $TOMCAT_HOME/webapps, the way the system was
designed. Sorry for any errors, but that is my understanding of it.
Zak
-----Original Message-----
From: Tore Skogly [mailto:tore.skogly@c2i.net]
Sent: Friday, May 10, 2002 11:17 AM
To: tomcat-user@jakarta.apache.org
Subject: Tomcat, mod_jk and Apache...again!


I'll give it another try, and hope someone can help me in sorting this
problem
out...

Due to access restrictions my jsp files are located with my static pages
under
the /var/www/html directory. I will use Apache 1.3.23 to serv my static
pages.
As I will not be deploying any webapps - only a few jsp pages - i would
prefer
to use mod_jk instead of mod_webapp.

When I browse jsp pages located in /var/www/html they are displayed as pure
text pages and not as html....

Please anyone - I have struggeled with this for several days - can anyone
help??


This is what I have added in my httpd.conf file:

LoadModule jk_module modules/mod_jk.so
AddModule mod_jk.c

Include /var/tomcat4/conf/auto/mod_jk.conf

# Configure mod_jk
#
JkWorkersFile /var/tomcat4/conf/workers.properties
JkLogFile /var/log/httpd/mod_jk.log
JkLogLevel info

JkMount /*.jsp ajp13

===========================

This is my server.xml file:
<Server port="8005" shutdown="SHUTDOWN" debug="0">

	<Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"
			modJk="/etc/httpd/modules/mod_jk.so"/>

  <!-- Define the Tomcat Stand-Alone Service -->
  <Service name="Tomcat-Apache">

    <!-- Define a non-SSL HTTP/1.1 Connector on port 8180 -->
    <Connector className="org.apache.catalina.connector.http.HttpConnector"
               port="8180" minProcessors="5" maxProcessors="75"
               enableLookups="true" redirectPort="8543"
               acceptCount="10" debug="0" connectionTimeout="60000"/>

    <!-- Define an AJP 1.3 Connector on port 8109 -->
    <Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
               port="8009" minProcessors="5" maxProcessors="75"
               acceptCount="10" debug="0"/>

    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Standalone" defaultHost="localhost" debug="0">

       <!-- Global logger unless overridden at lower levels -->
      <Logger className="org.apache.catalina.logger.FileLogger"
              prefix="catalina_log." suffix=".txt"
              timestamp="true"/>

      <!-- Because this Realm is here, an instance will be shared
globally -->

      <Realm className="org.apache.catalina.realm.MemoryRealm" />

        <!-- Define the default virtual host -->
      <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true">

	<Listener className="org.apache.ajp.tomcat4.config.ApacheConfig"
			modJk="/etc/httpd/modules/mod_jk.so"/>
w are you today?
        <Valve className="org.apache.catalina.valves.AccessLogValve"
                 directory="w are you today? logs"
prefix="localhost_access_log." suffix=".txt"
                 pattern="common"/>

        <!-- Logger shared by all Contexts related to this virtual host.  By
             default (when using FileLogger), log files are created in the
"logs"
             directory relative to $CATALINA_HOME.  If you wish, you can
specify
             a different directory with the "directory" attribute.  Specify
either a
             relative (to $CATALINA_HOME) or absolute path to the desired
             directory.-->
        <Logger className="org.apache.catalina.logger.FileLogger"
                 directory="/var/log/httpd"  prefix="tomcat_localhost_log."
suffix=".txt"
	        timestamp="true"/>


        <!-- Tomcat Manager Context -->
        <Context path="/manager" docBase="manager"
         debug="0" privileged="true"/>

      </Host>
    </Engine>
  </Service>
</Server>

--
regards,
Tore Skogly

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>