Re: MOD_JK2 Error (shm.fil 13 Permission Denied)

2003-07-19 Thread Simon Pabst
Just put touch and chown shm.file in Apache control script (either 
apachectl or /etc/init.d/apache), and if you want in catalina.sh too

At 16:11 18.07.2003 -0700, you wrote:
My Apache HTTPD and Tomcat installation cosists for following version:

1. RedHat 8.0
2. Apache HTTPD 2.0.47 (from source)
3. Tomcat 4.1.24 (binary)
4. JK2 Connector (jakarta-tomcat-connector-4.1.24-src)
I followed all the setup instructions to install JK2 connector.
I am running HTTPD and Tomcat as same user (not as root ofcourse) [point 
to note here is that HTTPD is started as root but later switched to 
different user defined in httpd.conf file]

A part of workers2.properties looks like:
--
[shm:]
info=Scoreboard. Required for reconfiguration and status with multiprocess 
servers
file=/usr/local/apache/httpd/logs/shm.file
size=100
debug=0
disabled=0
-

I start HTTPD first, wait, and then Tomcat. Tomcat (MOD_JK2) reports 
errors as seen in the following log.  I could the reason, why permission 
denied, since HTTPD starts up as root first and then switch to other user, 
in meantime shm.file gets created as root and so is not accessible by 
tomcat (which is started as other user and not root).

INFO: Starting Coyote HTTP/1.1 on port 8080
[Fri Jul 18 15:16:27 2003] ( info ) [jk_config_file.c (320)]  cfg.update() 
Updating config /usr/local/apache/httpd/conf/workers2.properties 0 1058551783
[Fri Jul 18 15:16:27 2003] ( info ) [jk_config_file.c 
(331)]  config.setConfig():  Reading properties 
/usr/local/apache/httpd/conf/workers2.properties 7
[Fri Jul 18 15:16:27 2003] ( info ) [jk_logger_file.c (184)]  Initializing 
log file stderr
[Fri Jul 18 15:16:27 2003] (error ) [jk_shm.c (150)]  shm.create(): error 
opening file /usr/local/apache/httpd/logs/shm.file 13 Permission denied
[Fri Jul 18 15:16:27 2003] (error ) [jk_shm.c (358)]  shm.create(): error 
mmapping /usr/local/apache/httpd/logs/shm.file
[Fri Jul 18 15:16:27 2003] ( info ) [jk_workerEnv.c 
(403)]  workerEnv.init() ok /usr/local/apache/httpd/conf/workers2.properties
Jul 18, 2003 3:16:27 PM org.apache.jk.apr.AprImpl init
INFO: JK2: Initialized apr
Jul 18, 2003 3:16:27 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Jul 18, 2003 3:16:27 PM org.apache.jk.common.ChannelUn init
INFO: JK: listening on unix socket: 
/usr/local/apache/jakarta/tomcat/work/jk2.socket
[Fri Jul 18 15:16:27 2003] ( info ) [jk_jni_aprImpl.c (472)]  jkInvoke() 
invoke 593e1450
Jul 18, 2003 3:16:27 PM org.apache.jk.common.ChannelJni init
INFO: JK2: listening on channel.jni:jni
Jul 18, 2003 3:16:27 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 
time=11/174  config=/usr/local/apache/jakarta/tomcat/conf/jk2.properties

Consider other senario, assuming there is no such file like shm.file 
(since I started HTTPD before, so I shut it down and delete the shm.file), 
start Tomcat first it runs fine and does not log any error (see the log), 
I assume here that this is not a serious problem.

Comments !!!

INFO: Initializing Coyote HTTP/1.1 on port 8080
GlobalResourcesLifecycleListener: Naming exception processing jdbc: 
org.apache.naming.NamingContext:[EMAIL PROTECTED] 
javax.naming.NamingException: Could not create resource factory, 
ClassNotFoundException:org.apache.commons.dbcp.BasicDataSourceFactory
Starting service Tomcat-Standalone
Apache Tomcat/4.1.24-LE-jdk14
Jul 18, 2003 3:31:20 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8080
[Fri Jul 18 15:31:20 2003] ( info ) [jk_config_file.c (320)]  cfg.update() 
Updating config /usr/local/apache/httpd/conf/workers2.properties 
-2130427774 1058551783
[Fri Jul 18 15:31:20 2003] ( info ) [jk_config_file.c 
(331)]  config.setConfig():  Reading properties 
/usr/local/apache/httpd/conf/workers2.properties 7
[Fri Jul 18 15:31:20 2003] ( info ) [jk_logger_file.c (184)]  Initializing 
log file stderr
[Fri Jul 18 15:31:20 2003] ( info ) [jk_workerEnv.c 
(403)]  workerEnv.init() ok /usr/local/apache/httpd/conf/workers2.properties
Jul 18, 2003 3:31:20 PM org.apache.jk.apr.AprImpl init
INFO: JK2: Initialized apr
Jul 18, 2003 3:31:20 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Jul 18, 2003 3:31:20 PM org.apache.jk.common.ChannelUn init
INFO: JK: listening on unix socket: 
/usr/local/apache/jakarta/tomcat/work/jk2.socket
[Fri Jul 18 15:31:20 2003] ( info ) [jk_jni_aprImpl.c (472)]  jkInvoke() 
invoke 5990f450
Jul 18, 2003 3:31:20 PM org.apache.jk.common.ChannelJni init
INFO: JK2: listening on channel.jni:jni
Jul 18, 2003 3:31:20 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 
time=2/209  config=/usr/local/apache/jakarta/tomcat/conf/jk2.properties


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


MOD_JK2 Error (shm.fil 13 Permission Denied)

2003-07-18 Thread ykp_java
My Apache HTTPD and Tomcat installation cosists for following version:

1. RedHat 8.0
2. Apache HTTPD 2.0.47 (from source)
3. Tomcat 4.1.24 (binary)
4. JK2 Connector (jakarta-tomcat-connector-4.1.24-src)

I followed all the setup instructions to install JK2 connector.
I am running HTTPD and Tomcat as same user (not as root ofcourse) [point to note here 
is that HTTPD is started as root but later switched to different user defined in 
httpd.conf file]

A part of workers2.properties looks like:
--
[shm:]
info=Scoreboard. Required for reconfiguration and status with multiprocess servers
file=/usr/local/apache/httpd/logs/shm.file
size=100
debug=0
disabled=0
-

I start HTTPD first, wait, and then Tomcat. Tomcat (MOD_JK2) reports errors as seen in 
the following log.  I could the reason, why permission denied, since HTTPD starts up 
as root first and then switch to other user, in meantime shm.file gets created as 
root and so is not accessible by tomcat (which is started as other user and not root).

INFO: Starting Coyote HTTP/1.1 on port 8080
[Fri Jul 18 15:16:27 2003] ( info ) [jk_config_file.c (320)]  cfg.update() Updating 
config /usr/local/apache/httpd/conf/workers2.properties 0 1058551783
[Fri Jul 18 15:16:27 2003] ( info ) [jk_config_file.c (331)]  config.setConfig():  
Reading properties /usr/local/apache/httpd/conf/workers2.properties 7
[Fri Jul 18 15:16:27 2003] ( info ) [jk_logger_file.c (184)]  Initializing log file 
stderr
[Fri Jul 18 15:16:27 2003] (error ) [jk_shm.c (150)]  shm.create(): error opening file 
/usr/local/apache/httpd/logs/shm.file 13 Permission denied
[Fri Jul 18 15:16:27 2003] (error ) [jk_shm.c (358)]  shm.create(): error mmapping 
/usr/local/apache/httpd/logs/shm.file
[Fri Jul 18 15:16:27 2003] ( info ) [jk_workerEnv.c (403)]  workerEnv.init() ok 
/usr/local/apache/httpd/conf/workers2.properties
Jul 18, 2003 3:16:27 PM org.apache.jk.apr.AprImpl init
INFO: JK2: Initialized apr
Jul 18, 2003 3:16:27 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Jul 18, 2003 3:16:27 PM org.apache.jk.common.ChannelUn init
INFO: JK: listening on unix socket: /usr/local/apache/jakarta/tomcat/work/jk2.socket
[Fri Jul 18 15:16:27 2003] ( info ) [jk_jni_aprImpl.c (472)]  jkInvoke() invoke 
593e1450 
Jul 18, 2003 3:16:27 PM org.apache.jk.common.ChannelJni init
INFO: JK2: listening on channel.jni:jni
Jul 18, 2003 3:16:27 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=11/174  
config=/usr/local/apache/jakarta/tomcat/conf/jk2.properties

Consider other senario, assuming there is no such file like shm.file (since I 
started HTTPD before, so I shut it down and delete the shm.file), start Tomcat first 
it runs fine and does not log any error (see the log), I assume here that this is not 
a serious problem.

Comments !!!

INFO: Initializing Coyote HTTP/1.1 on port 8080
GlobalResourcesLifecycleListener: Naming exception processing jdbc: 
org.apache.naming.NamingContext:[EMAIL PROTECTED] javax.naming.NamingException: Could 
not create resource factory, 
ClassNotFoundException:org.apache.commons.dbcp.BasicDataSourceFactory
Starting service Tomcat-Standalone
Apache Tomcat/4.1.24-LE-jdk14
Jul 18, 2003 3:31:20 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8080
[Fri Jul 18 15:31:20 2003] ( info ) [jk_config_file.c (320)]  cfg.update() Updating 
config /usr/local/apache/httpd/conf/workers2.properties -2130427774 1058551783
[Fri Jul 18 15:31:20 2003] ( info ) [jk_config_file.c (331)]  config.setConfig():  
Reading properties /usr/local/apache/httpd/conf/workers2.properties 7
[Fri Jul 18 15:31:20 2003] ( info ) [jk_logger_file.c (184)]  Initializing log file 
stderr
[Fri Jul 18 15:31:20 2003] ( info ) [jk_workerEnv.c (403)]  workerEnv.init() ok 
/usr/local/apache/httpd/conf/workers2.properties
Jul 18, 2003 3:31:20 PM org.apache.jk.apr.AprImpl init
INFO: JK2: Initialized apr
Jul 18, 2003 3:31:20 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Jul 18, 2003 3:31:20 PM org.apache.jk.common.ChannelUn init
INFO: JK: listening on unix socket: /usr/local/apache/jakarta/tomcat/work/jk2.socket
[Fri Jul 18 15:31:20 2003] ( info ) [jk_jni_aprImpl.c (472)]  jkInvoke() invoke 
5990f450 
Jul 18, 2003 3:31:20 PM org.apache.jk.common.ChannelJni init
INFO: JK2: listening on channel.jni:jni
Jul 18, 2003 3:31:20 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=2/209  
config=/usr/local/apache/jakarta/tomcat/conf/jk2.properties