You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Stephen Jones <st...@qwest.net> on 2001/03/01 05:08:48 UTC

Bugzilla #512 is Bunk

The following bug is not a bug:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=512

In httpd.conf, you cannot do this:

<VirtualHost .... blah>
     .... normal config for VirtualHost ...
     Include /usr/local/jakarta-tomcat/conf/mod_jk.conf-auto
</VirtualHost>

There are three main purposes of including mod_jk.conf-auto:

(1) To get the mod_jk Apache Module loaded, as follows:
      LoadModule jk_module libexec/mod_jk.so

(2) To configure Apache for your Tomcat Contexts using Alias, Location,
and Directory Apache Directives

(3) To configure mod_jk itself using all the directives starting with Jk
(JkWorkersFile, JkLogFile, JkMount, etc).

The first (1) Apache directive is the problem: the LoadModule directive
is illegal within the VirtualHost context.
(See http://httpd.apache.org/docs/mod/mod_so.html#loadmodule )

The directives in (2) are definitely legal, but I don't know about those
in (3) since they are custom. Does anyone know whether these would work
within the VirtualHost context?

The bug was reported by someone using Apache 1.3.14; they recieved a
core dump dereferencing a null pointer to something that was supposed to
contain Apache configuration info (a jk_server_conf_t).
I am using Apache 1.3.17; I recieved this polite and informative (wow,
from open source software?) error message:

sudo /usr/local/apache/bin/apachectl startssl
Syntax error on line 8 of /usr/local/tomcat/conf/mod_jk.conf-auto:
LoadModule cannot occur within <VirtualHost> section
/usr/local/apache/bin/apachectl startssl: httpd could not be started

Provided that the custom directives (3) will work within a VirtualHost
context, the solution to this problem is to create a custom
configuration file based on mod_jk.conf-auto, move the LoadModule
directive into it, and then Include it from within your VirtualHost
context.

If the directives (3) do work, another option would be for Tomcat to
change the code to not generate the LoadModule directive, which prevents
this level of configurability, and just make people type it in.

Hope this is helpful,
Steve Jones


Re: Bugzilla #512 is Bunk

Posted by Dan Milstein <da...@shore.net>.
Steve,

Thanks so much!  This is very, very helpful -- I am not master of Apache
configuration, and the virtual host thing is important.

I'll try to work this into the docs some time soonish...

-Dan

Stephen Jones wrote:
> 
> The following bug is not a bug:
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=512
> 
> In httpd.conf, you cannot do this:
> 
> <VirtualHost .... blah>
>      .... normal config for VirtualHost ...
>      Include /usr/local/jakarta-tomcat/conf/mod_jk.conf-auto
> </VirtualHost>
> 
> There are three main purposes of including mod_jk.conf-auto:
> 
> (1) To get the mod_jk Apache Module loaded, as follows:
>       LoadModule jk_module libexec/mod_jk.so
> 
> (2) To configure Apache for your Tomcat Contexts using Alias, Location,
> and Directory Apache Directives
> 
> (3) To configure mod_jk itself using all the directives starting with Jk
> (JkWorkersFile, JkLogFile, JkMount, etc).
> 
> The first (1) Apache directive is the problem: the LoadModule directive
> is illegal within the VirtualHost context.
> (See http://httpd.apache.org/docs/mod/mod_so.html#loadmodule )
> 
> The directives in (2) are definitely legal, but I don't know about those
> in (3) since they are custom. Does anyone know whether these would work
> within the VirtualHost context?
> 
> The bug was reported by someone using Apache 1.3.14; they recieved a
> core dump dereferencing a null pointer to something that was supposed to
> contain Apache configuration info (a jk_server_conf_t).
> I am using Apache 1.3.17; I recieved this polite and informative (wow,
> from open source software?) error message:
> 
> sudo /usr/local/apache/bin/apachectl startssl
> Syntax error on line 8 of /usr/local/tomcat/conf/mod_jk.conf-auto:
> LoadModule cannot occur within <VirtualHost> section
> /usr/local/apache/bin/apachectl startssl: httpd could not be started
> 
> Provided that the custom directives (3) will work within a VirtualHost
> context, the solution to this problem is to create a custom
> configuration file based on mod_jk.conf-auto, move the LoadModule
> directive into it, and then Include it from within your VirtualHost
> context.
> 
> If the directives (3) do work, another option would be for Tomcat to
> change the code to not generate the LoadModule directive, which prevents
> this level of configurability, and just make people type it in.
> 
> Hope this is helpful,
> Steve Jones
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-dev-help@jakarta.apache.org

-- 

Dan Milstein // danmil@shore.net

Re: Bugzilla #512 is Bunk

Posted by William Barker <wb...@wilshire.com>.
JkWorkersFiles is the main problem inside of a VirtualHost.  I don't know
about JkLogFile. JkMount is legal inside of a VirtualHost.
----- Original Message -----
From: "Stephen Jones" <st...@qwest.net>
To: <da...@shore.net>; <to...@jakarta.apache.org>;
<je...@phoenix.com>
Sent: Wednesday, February 28, 2001 8:08 PM
Subject: Bugzilla #512 is Bunk


> The following bug is not a bug:
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=512
>
> In httpd.conf, you cannot do this:
>
> <VirtualHost .... blah>
>      .... normal config for VirtualHost ...
>      Include /usr/local/jakarta-tomcat/conf/mod_jk.conf-auto
> </VirtualHost>
>
> There are three main purposes of including mod_jk.conf-auto:
>
> (1) To get the mod_jk Apache Module loaded, as follows:
>       LoadModule jk_module libexec/mod_jk.so
>
> (2) To configure Apache for your Tomcat Contexts using Alias, Location,
> and Directory Apache Directives
>
> (3) To configure mod_jk itself using all the directives starting with Jk
> (JkWorkersFile, JkLogFile, JkMount, etc).
>
> The first (1) Apache directive is the problem: the LoadModule directive
> is illegal within the VirtualHost context.
> (See http://httpd.apache.org/docs/mod/mod_so.html#loadmodule )
>
> The directives in (2) are definitely legal, but I don't know about those
> in (3) since they are custom. Does anyone know whether these would work
> within the VirtualHost context?
>
> The bug was reported by someone using Apache 1.3.14; they recieved a
> core dump dereferencing a null pointer to something that was supposed to
> contain Apache configuration info (a jk_server_conf_t).
> I am using Apache 1.3.17; I recieved this polite and informative (wow,
> from open source software?) error message:
>
> sudo /usr/local/apache/bin/apachectl startssl
> Syntax error on line 8 of /usr/local/tomcat/conf/mod_jk.conf-auto:
> LoadModule cannot occur within <VirtualHost> section
> /usr/local/apache/bin/apachectl startssl: httpd could not be started
>
> Provided that the custom directives (3) will work within a VirtualHost
> context, the solution to this problem is to create a custom
> configuration file based on mod_jk.conf-auto, move the LoadModule
> directive into it, and then Include it from within your VirtualHost
> context.
>
> If the directives (3) do work, another option would be for Tomcat to
> change the code to not generate the LoadModule directive, which prevents
> this level of configurability, and just make people type it in.
>
> Hope this is helpful,
> Steve Jones
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-dev-help@jakarta.apache.org
>
>


Proposed ApacheConfig tweak:Re: Bugzilla #512 is Bunk

Posted by Mel Martinez <me...@yahoo.com>.
--- Stephen Jones <st...@qwest.net> wrote:
> 
> In httpd.conf, you cannot do this:
> 
> <VirtualHost .... blah>
>      .... normal config for VirtualHost ...
>      Include
> /usr/local/jakarta-tomcat/conf/mod_jk.conf-auto
> </VirtualHost>
> 
> There are three main purposes of including
> mod_jk.conf-auto:
> 
> (1) To get the mod_jk Apache Module loaded, as
> follows:
>       LoadModule jk_module libexec/mod_jk.so
> 
> 
> The first (1) Apache directive is the problem: the
> LoadModule directive
> is illegal within the VirtualHost context.
> (See
>
http://httpd.apache.org/docs/mod/mod_so.html#loadmodule
> )

Without trying to change the fact that the LoadModule
call should not be inside a virtual host definition, a
simple patch that should fix this as a side benefit
(the main benefit is improved flexibility in deploying
tomcat and apache) would be to make a simple change to
ApacheConfig.java. 

Specifically, ApacheConfig currently generates (based
on operating system type and other conditions) a line
similar to:

LoadModule jk_module modules/mod_jk.dll   or

LoadModule jk_module modules/mod_jk.so

and so on.  It should not be too difficult to modify
ApacheConfig.java to generate the following
declaration format instead:

<IfModule !mod_jk.c>
LoadModule jk_module modules/mod_jk.so
</IfModule>

This would serve two purposes.  Obviously, if the
module is already loaded, then LoadModule would not be
called. Thus, if you simply make sure to use
LoadModule to load mod_jk prior to the VirtualHost
definition, then I believe that if you include the
mod_jk.conf-auto file it should not cause a problem.
I.E. step (1) would be ignored.

The more important benefit would be to allow the
deployment engineer freedom to put the mod_jk.so (or
mod_jk.dll) module elsewhere than inside
${TOMCAT_HOME}/modules/.  Inside httpd.conf, you would
simply specify where you want to load mod_jk.so/.dll
from prior to including mod_jk.conf-auto.  

Some examples:

#...inside a solaris version of httpd.conf...
LoadModule jk_module /path/modules/solaris/mod_jk.so
Include
/usr/local/jakarta-tomcat/conf/mod_jk.conf-auto

#...while inside a linux version of httpd.conf:
LoadModule jk_module /path/modules/linux/mod_jk.so
Include
/usr/local/jakarta-tomcat/conf/mod_jk.conf-auto

and so on.  This would make it easier to deploy the
same apache/tomcat configuration from CVS to multiple
platforms since you don't have to maintain a custom
mod_jk.conf for each platform.

The same fix should be applied to the other LoadModule
calls (such as for jserv).

I will try to put some time into creating this patch
later today.  I don't think I can get it done for a
day or two though.  Too busy with other things.  I do
need this patch for my own purposes, though, so I will
definitely pursue it.

Does anybody see a problem with this proposal?

If I don't hear any nay-saying I'll proceed.  I'll
post it first as a [PATCH] as I'll need folks using
jserv to test it out as well, but this looks pretty
straight forward.


Cheers,

Mel


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/