railo installer / mod_jk - "JkMount can not have a path when defined in a location"

1,452 views
Skip to first unread message

Peter Boughton

unread,
May 23, 2012, 1:09:32 PM5/23/12
to ra...@googlegroups.com
I recompiled Apache to add a module, forgetting it would disconnect mod_jk in the process.

So I tried running the Railo installer as the simplest way to fix things, but when the installer completes and tries to restart apache it results in:

    /etc/rc.d/init.d/httpd restart
    Syntax error on line 2390 of /usr/local/apache/conf/httpd.conf:
    JkMount can not have a path when defined in a location


Line 2390 is the first line of JkMounts:

    JkMount /*.cfm ajp13


The server is running cPanel, so probably something to do with the wacky configs cPanel uses, but it's too hot and my brain is fried, so I can't think straight. :(


Closest thing I found was this message from Jordan:
http://groups.google.com/group/railo/msg/0e27392bb43b8e45

I don't have an /etc/httpd/conf.d directory (just a conf) and I had no mod_jk.conf file.

I created the mod_jk.conf and put the settings from the end of the httpd.conf into that (same as that message except with different paths for LoadModule and JkLogFile lines).

Restarting apache works with no error, but still not working and I'm guessing mod_jk.conf isn't being applied.

Hopefully someone can identify what's gone wrong and how to fix it?

Jordan Michaels

unread,
May 23, 2012, 3:18:58 PM5/23/12
to ra...@googlegroups.com
Hey Peter,

First thing I'd check is to make sure that mod_jk is getting loaded
alright. If you didn't have the mod_jk.conf file it might not be getting
loaded.

You can check it with the following command:

# httpd -M

This will give you a list of apache modules that are currently loaded in
Apache. Hopefully mod_jk will be among them.

Warm Regards,
Jordan Michaels

Peter Boughton

unread,
May 23, 2012, 6:08:42 PM5/23/12
to ra...@googlegroups.com
Thanks Jordan,

Just noticed I forgot to give my Apache version earlier, which is 2.0 - I tried the -M and it didn't work, since it looks like it's a 2.2 option.

Looking at the available options, there's "httpd -l" which gives "Compiled in modules" - I'm not sure if mod_jk would be expected in that list, but it's not there.

Doing "httpd -G | grep Jk" brings up a bunch of related directives, which suggests the module is being loaded?

I don't remember for sure, but I think I manually added the "LoadModule jk_module mod_jk.so" line to httpd.conf - if I comment out that line then the above -G command returns nothing.


Something I realised earlier is that there's no setting to point Apache at Tomcat - there should be a JkWorkersFile somewhere?
(I did try adding that earlier, but got an error so removed it again.)



Thanks,

Peter

Jordan Michaels

unread,
May 23, 2012, 7:42:30 PM5/23/12
to ra...@googlegroups.com
I assume this is CentOS 4 / Apache 2.0 then?

The mod_jk config utilizes the mod_jk default worker of "ajp13" and
connects to the default Tomcat port of 8009. That is why the mapping
configs point to "ajp13". The reason I went this route was an effort to
keep things simple.

So, I did some googling and I came across this bit of code where the
error you mention is displayed:

http://mail-archives.apache.org/mod_mbox/tomcat-dev/200411.mbox/%3C200411300822...@minotaur.apache.org%3E

Looks like it's triggered by a NULL worker, so perhaps setting up the
workers file may be the answer here. I don't know why the system you're
working on is different then other systems. Perhaps something about
cPanel on CentOS 4 negates the default ajp13 worker or something along
those lines?

If I were you, I'd attempt one of the following:

1) Add a workers file and attempt to work out whatever errors are thrown
(maybe allow me to assist you by telling me what errors you're getting?)

2) Toss out mod_jk and attempt a mod_proxy connection.

Either one should get you there!

Sean Corfield has repeatedly and effectively convinced me of the
simplicity of mod_proxy, and making mod_proxy the default connection
method is on my to do list, but it involves some heavy scripting and I
just haven't gotten around to it yet. I admit I haven't prioritised it
yet either since mod_jk works fine in most situations.


Warm Regards,
Jordan Michaels

On 05/23/2012 03:08 PM, Peter Boughton wrote:
> Thanks Jordan,
>
> Just noticed I forgot to give my Apache version earlier, which is 2.0 -
> I tried the -M and it didn't work, since it looks like it's a 2.2 option.
>
> Looking at the available options, there's "httpd -l" which gives
> "Compiled in modules" - I'm not sure if mod_jk would be expected in that
> list, but it's not there.
>
> Doing "httpd -G | grep Jk" brings up a bunch of related directives,
> which suggests the module is being loaded?
>
> I don't remember for sure, but I think I manually added the "LoadModule
> jk_module mod_jk.so" line to httpd.conf - if I comment out that line
> then the above -G command returns nothing.
>
>
> Something I realised earlier is that there's no setting to point Apache
> at Tomcat - there should be a JkWorkersFile somewhere?
> (I did try adding that earlier, but got an error so removed it again.)
>
>
>
> Thanks,
>
> Peter
>
>
>
> On 23 May 2012 20:18, Jordan Michaels <jor...@viviotech.net
> <mailto:jor...@viviotech.net>> wrote:
>
> Hey Peter,
>
> First thing I'd check is to make sure that mod_jk is getting loaded
> alright. If you didn't have the mod_jk.conf file it might not be
> getting loaded.
>
> You can check it with the following command:
>
> # httpd -M
>
> This will give you a list of apache modules that are currently
> loaded in Apache. Hopefully mod_jk will be among them.
>
> Warm Regards,
> Jordan Michaels
>
>
> On 05/23/2012 10:09 AM, Peter Boughton wrote:
>
> I recompiled Apache to add a module, forgetting it would disconnect
> mod_jk in the process.
>
> So I tried running the Railo installer as the simplest way to fix
> things, but when the installer completes and tries to restart
> apache it
> results in:
>
> /etc/rc.d/init.d/httpd restart
> Syntax error on line 2390 of
> /usr/local/apache/conf/httpd.__conf:
> JkMount can not have a path when defined in a location
>
>
> Line 2390 is the first line of JkMounts:
>
> JkMount /*.cfm ajp13
>
>
> The server is running cPanel, so probably something to do with
> the wacky
> configs cPanel uses, but it's too hot and my brain is fried, so
> I can't
> think straight. :(
>
>
> Closest thing I found was this message from Jordan:
> http://groups.google.com/__group/railo/msg/__0e27392bb43b8e45

Peter Boughton

unread,
May 23, 2012, 8:26:43 PM5/23/12
to ra...@googlegroups.com
It's actually CentOS 5.8 - I thought it was an older version, but I guess it auto-updated.

The machine was setup about a year and a half ago, so certainly an older version when the installer ran before (with no problems back then).

I've got Apache 2.2 available, but it's been running v2.0 since it was setup and I simply didn't change it when I modified things earlier, since it still said it was supported. However, I'm now thinking I might as well upgrade to Apache 2.2

I'm going to sleep on it for tonight though - don't want to do stuff whilst tired.

I'll see if I can get workers to do anything in the morning, and report back what I do and any results/errors.

If I don't make progress with that, I'll go with Apache 2.2 and re-run the installer, and if that also doesn't work I'll give mod_proxy a go.

Thanks.



On 24 May 2012 00:42, Jordan Michaels <jor...@viviotech.net> wrote:
I assume this is CentOS 4 / Apache 2.0 then?

The mod_jk config utilizes the mod_jk default worker of "ajp13" and connects to the default Tomcat port of 8009. That is why the mapping configs point to "ajp13". The reason I went this route was an effort to keep things simple.

So, I did some googling and I came across this bit of code where the error you mention is displayed:

Peter Boughton

unread,
May 24, 2012, 8:35:57 AM5/24/12
to ra...@googlegroups.com
(( NOTE: this is an informational post in case it helps others in future - no real questions - and short summary is I'm going to try Apache 2.2 next ))


Ok, so I started with this, and no other jk-related settings applied:
    LoadModule jk_module modules/mod_jk.so

Apache restarts with no errors using:
    /etc/rc.d/init.d/httpd restart

Added this on line below:
    JkWorkersFile /opt/railo331/tomcat/conf/workers.properties

Restart Apache results in error:
    /etc/rc.d/init.d/httpd: line 97: 29383 Segmentation fault      $HTTPD -k $ARGV -DSSL

Comment out JkWorkersFile line and restart again - no errors.

Line 97 is the blank line in between Deny and Satisfy:
    <Files ~ "^error_log$">
        Order allow,deny
        Deny from all

        Satisfy All
    </Files>

Pretty sure that's a red herring. (FWIW I've checked /usr/local/apache/logs/error_log and there's nothing new in there.)

The JkWorkersFile was at line 30 - moving it down to line 372 gives same error message (except the five digit 29383 number, which is a pid?)

Moved JkWorkersFile inside of a <VirtualHost> section to see what would happen* and get:
    Syntax error on line 393 of /usr/local/apache/conf/httpd.conf:
    JkWorkersFile cannot occur within <VirtualHost> section

* (the Tomcat docs state that it should be in the global config; this was just an experiment to see if I could get a different error.)

So, invalid config throws errors, but [what I think is] valid causes a seg fault. Hmph.


Not finding much on search engines, but I found a comment relating to someone else with similar mod_jk problems on apache 2.0 (but on Solaris, not CentOS):
> Segmentation fault usually happens when trying to use a binary that does
> not match the platform.
( http://tomcat.10.n6.nabble.com/Solaris-10-mod-jk-problems-td2149373.html )

( At this point Apache went down, and didn't seem to want to come back until I'd removed even the mod_jk LoadModule line. :/ )

I'm not sure about wrong binary/platform - the machine is 32-bit, Apache is 32-bit, and the installer is 32-bit (which I assume means mod_jk is 32-bit) - so I guess I'm either misunderstanding something or what they say isn't relevant for Linux.


Anyway, I'm going to see if using Apache 2.2 makes everything better. :)

Peter Boughton

unread,
May 24, 2012, 11:55:04 AM5/24/12
to ra...@googlegroups.com

Compiled+installed Apache 2.2, then installed Railo to fresh directory.

It worked fine. :)


Had to copy old Hosts entries into server.xml a handful at a time - if I tried to do all of them together, it seemed to just keep loading and loading.

Seems Tomcat 7 takes quite a while after "startup" before being able to serve pages - Tomcat 6 used to be under 30 seconds (well, never measured it, but about that), whilst v7 takes at least a minute.

*shrug*

Anyway, just some WEB-INF stuff to sort out and I'll be fully up and running again.

Guess I'll leave looking into mod_proxy stuff until another time.

Jordan Michaels

unread,
May 24, 2012, 2:26:35 PM5/24/12
to ra...@googlegroups.com
Was Apache 2.0 detected properly by the installer when you did the
install? I wonder if that's misbehaving somehow and installing the 2.2
connector into a 2.0 version of Apache?

Thank you for the detailed report!

Warm Regards,
Jordan Michaels

Jordan Michaels

unread,
May 24, 2012, 2:28:16 PM5/24/12
to ra...@googlegroups.com
Nice.

If you're using mod_cfml, the delay could be the context creation
process and not the startup process. The first time you hit a domain
using mod_cfml it takes several seconds to create the context, after
that all requests are quick because the context is created.

Nice to hear things are working for you!

Warm Regards,
Jordan Michaels

Peter Boughton

unread,
May 24, 2012, 5:55:35 PM5/24/12
to ra...@googlegroups.com
> Was Apache 2.0 detected properly by the installer when you did the
> install? I wonder if that's misbehaving somehow and installing the 2.2
> connector into a 2.0 version of Apache?

It asked whether it was 2.2 or 2.0 (with 2.2 being the default) - I
definitely entered an option, but I can't guarantee that my brain last
night didn't get the numbers 1 and 2 mixed up, so maybe that was it.
Reply all
Reply to author
Forward
0 new messages