Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 164838 - www-apache/mod_jk-1.2.20 wrong paths in 88_mod_jk.conf
Summary: www-apache/mod_jk-1.2.20 wrong paths in 88_mod_jk.conf
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: William L. Thomson Jr. (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-01 13:49 UTC by Timo Gurr (RETIRED)
Modified: 2007-03-11 18:20 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timo Gurr (RETIRED) gentoo-dev 2007-02-01 13:49:44 UTC
Today I emerged mod_jk-1.2.20 with the apache2 USE-flag. On restarting apache2 after installation it prints out following error message:

# /etc/init.d/apache2 restart
 * Apache2 has detected a syntax error in your configuration files:
Syntax error on line 9 of /etc/apache2/modules.d/88_mod_jk.conf:
Can't find the workers file specified

A ls -la /etc/apache2/ gives me:
drwxr-xr-x  5 root root   153  1. Feb 14:10 .
drwxr-xr-x 71 root root  4096  1. Feb 14:10 ..
-rw-r--r--  1 root root  2596 25. Jan 15:30 apache2-builtin-mods-2.2
-rw-r--r--  1 root root 17759 25. Jan 15:30 httpd.conf
-rw-r--r--  1 root root  1034  1. Feb 14:10 jk-workers.properties
-rw-r--r--  1 root root 12958 25. Jan 15:30 magic
drwxr-xr-x  2 root root  4096  1. Feb 14:10 modules.d
drwxr-xr-x  2 root root    69  4. Dez 12:58 ssl
-rw-r--r--  1 root root   287 25. Jan 15:30 suexec-conf
drwxr-xr-x  2 root root  4096 25. Jan 15:38 vhosts.d

Manually changing the path in /etc/apache2/modules.d/88_mod_jk.conf however worked:
-JkWorkersFile   conf/jk-workers.properties
+JkWorkersFile   /etc/apache2/jk-workers.properties


Reproducible: Always
Comment 1 Timo Gurr (RETIRED) gentoo-dev 2007-02-01 13:58:27 UTC
There also seems to be a problem with the path of the log file:

tail -f /var/log/apache2/error_log
[Thu Feb 01 14:54:14 2007] [error] (2)No such file or directory: mod_jk: could not open JkLog file /usr/lib/apache2/logs/mod_jk.log
Configuration Failed

The directory /usr/lib/apache2/logs/ doesn't exist on my system.

Again manually changing the paths in the configuration file worked:
-JkLogFile       logs/mod_jk.log
+JkLogFile       /var/log/apache2/mod_jk.log
Comment 2 Timo Gurr (RETIRED) gentoo-dev 2007-02-01 14:20:52 UTC
More problems:
tail -f /var/log/apache2/mod_jk.log
[Thu Feb 01 14:58:30 2007] [27306:59056] [error] init_jk::mod_jk.c (2567): Initializing shm:/usr/lib/apache2/logs/jk-runtime-status errno=2
[Thu Feb 01 14:58:30 2007] [27306:59056] [warn]  jk_map_read_property::jk_map.c (386): The attribute worker.ajp13.cachesize is deprecated - please check the documentation for the correct replacement.
[Thu Feb 01 14:58:31 2007] [27314:59056] [error] jk_child_init::mod_jk.c (2523): Attaching shm:/usr/lib/apache2/logs/jk-runtime-status errno=2

Solved by adding:
###
### Where to put mod_jk logs
###
# specify the location where mod_jk is going to place its log file.
JkLogFile       /var/log/apache2/mod_jk.log
+JkShmFile       /var/log/apache2/jk-runtime-status
Comment 3 Timo Gurr (RETIRED) gentoo-dev 2007-02-01 14:31:37 UTC
To solve the last remaining issue:
tail -f /var/log/apache2/mod_jk.log
[Thu Feb 01 15:21:30 2007] [27573:42672] [warn]  jk_map_read_property::jk_map.c (386): The attribute worker.ajp13.cachesize is deprecated - please check the documentation for the correct replacement.

I simply commented out the cache section in /etc/apache2/jk-workers.properties
-worker.ajp13.cachesize=10
+#worker.ajp13.cachesize=10
since i couldn't find any information on what the replacement is called and it doesn't appear in /etc/tomcat-5.5/workers.properties at all, too.
Comment 4 Timo Gurr (RETIRED) gentoo-dev 2007-02-02 11:38:57 UTC
After getting into Tomcat a bit I realised my path's were not very smart. IMHO the right way to set the paths in 88_mod_jk.conf would be:

JkWorkersFile   /var/lib/tomcat-5.5/conf/jk-workers.properties
JkLogFile       /var/lib/tomcat-5.5/logs/mod_jk.log
JkShmFile       /var/lib/tomcat-5.5/logs/jk-runtime-status

So the problems with the ebuild after all would be:
1.) install the jk-workers.properties file into /var/lib/tomcat-5.5/conf/
2.) set the right paths in 88_mod_jk.conf (like mentioned above)
3.) remove worker.ajp13.cachesize=10 from jk-workers.properties since it's deprecated (and not needed?)
Comment 5 Krzysztof Pawlik (RETIRED) gentoo-dev 2007-02-02 12:01:46 UTC
(In reply to comment #4)
> JkWorkersFile   /var/lib/tomcat-5.5/conf/jk-workers.properties

mod_jk is an Apache module, so all its configuration should be stored under /etc/apache2/, I have several hosts running Apache + mod_jk but without tomcat installed (it's installed on other servers).

> JkLogFile       /var/lib/tomcat-5.5/logs/mod_jk.log

Same thing but under /var/log/apache2/

> JkShmFile       /var/lib/tomcat-5.5/logs/jk-runtime-status

Again same thing.

William - what's your opinion?
Comment 6 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-02-02 13:55:54 UTC
Well the jk-workers.properties goes with the apache side of mod_jk. So it's location, and log paths should be in apache conf/log dirs. Respectively. At the moment the file is just copied. I will see about adding some sed to correct paths. Likely do that later today as time permits.
Comment 7 Timo Gurr (RETIRED) gentoo-dev 2007-02-02 19:35:37 UTC
/var/lib/tomcat-5.5/logs/ and /var/lib/tomcat-5.5/conf/ are symlinks. I'll report back on monday where they actually point to. But I'm nearly sure /var/lib/tomcat-5.5/logs/ points to somewhere in /var/log already. Sorry for that vague answer but I don't have access to the box running tomcat at the moment.

For /var/lib/tomcat-5.5/conf/jk-workers.properties, I'll post an ls for this direcotry then, there are already other workers in this directory so it seemed the right location to store them for me.
Comment 8 Timo Gurr (RETIRED) gentoo-dev 2007-02-06 13:18:08 UTC
Testet again with

JkWorkersFile   /etc/apache2/jk-workers.properties
JkLogFile       /var/log/apache2/mod_jk.log
JkShmFile       /var/log/apache2/jk-runtime-status

and in /etc/apache2/jk-workers.properties
#worker.ajp13.cachesize=10

and it works fine so far. I didn't consider the fact that you can have tomcat on another machine so your solution seems to be far better. :)
Comment 9 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-02-26 19:49:06 UTC
Committed fix a bit ago. Will take some time before it hits mirrors. It's still kinda borked for apache users not apache2 users. There is a fix for that in 1.2.21, which I just committed, but it's a dev snapshot of an upcoming 1.2.21 release. Should be safe to emerge and use, and if not, file a bug here or with upstream. Thanks, and closing bug.
Comment 10 Martin von Gagern 2007-02-28 00:26:28 UTC
Right now apache fails to start for me because the log dir does not exist.
88_mod_jk.conf specifies "JkLogFile /etc/apache2/logs/mod_jk.log",
but there is no /etc/apache2/logs in my net-www/apache-2.0.59-r2 setup.

For me it seems those modifications should not have been necessary in the first place, as my /usr/lib/apache2 looks like this:

drwxr-xr-x 2 root root 4096  4. Apr 2005  build
lrwxrwxrwx 1 root root   12  6. Nov 16:01 conf -> /etc/apache2
lrwxrwxrwx 1 root root   29 26. Jan 2005  extramodules ->
                                          /usr/lib/apache2-extramodules
lrwxrwxrwx 1 root root    8  6. Nov 16:01 lib -> /usr/lib
lrwxrwxrwx 1 root root   16  6. Nov 16:01 logs -> /var/log/apache2
drwxr-xr-x 2 root root 4096 22. Dez 18:43 modules

So I reverted my 88_mod_jk.conf to 1.2 except for the jkAutoAlias. Now my apache starts up. My tomcat has been unconfigured for some time now, so I can't tell if mod_jk is working properly, but chances are good I'd say.

Can it be that the reporter used the (package.masked) apache 2.2, and that this has a different layout? If that should be the case, maybe some way should be found to to provide backwards compatibility, e.g. by manually introducing those symlinks in /usr/lib/apache2. Until then I'd rather have the package support the unmasked apache 2.0 instead of the masked 2.2, if that's the choice I have.

Another alternative might be to hardcode all paths, without relying on any symlinks. This would in my opinion reduce flexibility a bit.

Please fix immediately or reopen until this gets fixed.
Comment 11 Timo Gurr (RETIRED) gentoo-dev 2007-03-06 11:28:49 UTC
The current version mod_jk-1.2.21-r1 won't work here either. Like #10 assumed I do use the currently still masked 2.2 version of apache.
JkShmFile is completely missing in the 88_mod_jk.conf and JkLogFile points to a non existent (at least on my setup) directory. This is what etc-update offers me after the upgrade.

-JkLogFile      /var/log/apache2/mod_jk.log
-JkShmFile      /var/log/apache2/jk-runtime-status
+JkLogFile      /etc/apache2/log/mod_jk.log

Sorry if this is the wrong place to post but I wasn't sure what's better, opening a new bug report or reopening this one.
Comment 12 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-03-06 16:15:46 UTC
(In reply to comment #10)
> Right now apache fails to start for me because the log dir does not exist.
> 88_mod_jk.conf specifies "JkLogFile /etc/apache2/logs/mod_jk.log",
> but there is no /etc/apache2/logs in my net-www/apache-2.0.59-r2 setup.

Yes, I accidentally called it logs when it was log.

> For me it seems those modifications should not have been necessary in the first
> place, as my /usr/lib/apache2 looks like this:

Yes I questioned it a bit myself since things were working for me. But they might not with future apaches or etc no clue. So I switched to hard coded paths.
 
> Until then I'd rather have the package support
> the unmasked apache 2.0 instead of the masked 2.2, if that's the choice I have.
>

The paths currently are only hard coded to support Apache and Apache2, I assume 2.2. Is in another slot. Of which the ebuild does not take into consideration.

Either way, I addressed problem and bumped package the other day. Should be able to emerge, and really need to. However FYI, you do not have to use the default mod_jk.conf file. I don't :) Nor do you have to replace it when upgrading versions.


(In reply to comment #11)
>
> -JkLogFile      /var/log/apache2/mod_jk.log
> -JkShmFile      /var/log/apache2/jk-runtime-status
> +JkLogFile      /etc/apache2/log/mod_jk.log

Logs do not, and will never go in /etc. Given the problems created since trying to address it in the first place for you specifically. I will be leaving as is. If it does not work properly with apache 2.2, then I will address that closer to the time Apache 2.2 is unmasked, and/or when it is unmasked.

Because updating that file, no only did I break ~arch, but I broke arch as well. Which is not acceptable. Not to mention it's questionable if I needed to do anything in the first place.
Comment 13 Timo Gurr (RETIRED) gentoo-dev 2007-03-07 11:19:16 UTC
>Logs do not, and will never go in /etc.

Yes sorry I think you got me wrong. I posted the etc-update output which I got when updating to mod_jk-1.2.21-r1. So in the current apache 2.0 /etc/apache2/log is a symlink to /var/log/apache2 right? And that's the problem I tried to explain since in apache 2.2 there isn't such a symlink in /etc/apache2 named log, hence apache2 won't start:

[Wed Mar 07 12:06:59 2007] [error] (2)No such file or directory: mod_jk: could not open JkLog file /etc/apache2/log/mod_jk.log
Configuration Failed

And that's why I had to change the paths in 88_mod_jk.conf to:
 
JkLogFile      /var/log/apache2/mod_jk.log
JkShmFile      /var/log/apache2/jk-runtime-status

>I will be leaving as is.
>If it does not work properly with apache 2.2, then I will address that closer
>to the time Apache 2.2 is unmasked, and/or when it is unmasked.

That's what I wanted to know, thanks for the clarification. So there's no need in bugging you further with my problem and/or creating a new bug report or reopening this one.
Comment 14 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-03-11 18:20:07 UTC
(In reply to comment #13)
> 
> So in the current apache 2.0
> /etc/apache2/log is a symlink to /var/log/apache2 right? And that's the problem
> I tried to explain since in apache 2.2 there isn't such a symlink in
> /etc/apache2 named log, hence apache2 won't start:

A fix for this has already been committed.

> >I will be leaving as is.

That was implying leaving the paths that were requested and recently hard coded. Which should allow things to work with Apache 2.2. If they do not, then I will address that once Apache 2.2 is unmasked.

Hope that clears things up a bit.