You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Przemys³aw Korona <pr...@ckzeto.com.pl> on 2003/07/01 17:52:18 UTC

mod jk2 problem, segmetation fault

Hi there,
I have a problem with integrating tomcat and apache using jk2.

System configuration: suse 8.1
			apache 1.3.26
			  tomcat 4.1.24

Correct me if I am wrong, but to establish link bw. apache and tomcat I 
need to:
- add a connector in server.xml
     <Connector acceptCount="10" bufferSize="2048" 
className="org.apache.ajp.tomcat4.Ajp13Connector" 
port="8009"      minProcessors="5" maxProcessors="75" debug="0" 
enableLookups="true">
         <Factory 
className="org.apache.catalina.net.DefaultServerSocketFactory"/>
     </Connector>

- load jk2 module in httpd.conf

- configure workers2.properties
[shm]
file=/srv/www/logs/jk2.shm

[channel.socket:192.168.230.14:8009]
info=Ajp13 forwarding over socket
tomcatId=192.168.230.14:8009

[uri:/examples/*]
info=Map the whole webapp

- configure jk2.properties
# Set the desired handler list
# handler.list=apr,request,channelJni
#
# Override the default port for the socketChannel
# channelSocket.port=8009
# Default:
# channelUnix.file=${jkHome}/work/jk2.socket
# Just to check if the the config  is working
  shm.file=/srv/www/logs/jk2.shm

# In order to enable jni use any channelJni directive
# channelJni.disabled = 0
# And one of the following directives:

# apr.jniModeSo=/opt/apache2/modules/mod_jk2.so

# If set to inprocess the mod_jk2 will Register natives itself
# This will enable the starting of the Tomcat from mod_jk2
# apr.jniModeSo=inprocess


It seems that in tomcat everything is fine (catalina.out after starting 
tomcat ends with:
2003-07-01 17:24:33 HttpConnector[8443] Starting background thread
2003-07-01 17:24:34 HttpProcessor[8443][0] Starting background thread
2003-07-01 17:24:34 HttpProcessor[8443][1] Starting background thread
2003-07-01 17:24:34 HttpProcessor[8443][2] Starting background thread
2003-07-01 17:24:34 HttpProcessor[8443][3] Starting background thread
2003-07-01 17:24:34 HttpProcessor[8443][4] Starting background thread
2003-07-01 17:24:34 Ajp13Connector[8009] Opening server socket on all host 
IP addresses
2003-07-01 17:24:34 Ajp13Connector[8009] Starting background thread
2003-07-01 17:24:34 Ajp13Processor[8009][0] Starting background thread
2003-07-01 17:24:34 Ajp13Processor[8009][1] Starting background thread
2003-07-01 17:24:34 Ajp13Processor[8009][2] Starting background thread
2003-07-01 17:24:34 Ajp13Processor[8009][3] Starting background thread
2003-07-01 17:24:34 Ajp13Processor[8009][4] Starting background thread


However in apache, there are some errors after restart:
[Tue Jul 01 14:47:08 2003]  ( info) [mod_jk2.c (284)]: mod_jk child init
[Tue Jul 01 14:47:08 2003]  ( info) [mod_jk2.c (292)]: mod_jk.post_config() 
init worker env
[Tue Jul 01 14:47:08 2003]  (error) [jk_logger_file.c (171)]: Can't open 
log file ${serverRoot}/logs/mod_jk.log
[Tue Jul 01 14:47:08 2003]  ( info) [jk_config_file.c (320)]: cfg.update() 
Updating config /srv/www//conf/workers2.properties
[Tue Jul 01 14:47:08 2003]  ( info) [jk_config_file.c (331)]: 
config.setConfig():  Reading properties /srv/www//conf/workers2.
[Tue Jul 01 14:47:08 2003]  (error) [jk_logger_file.c (171)]: Can't open 
log file ${serverRoot}/logs/mod_jk.log
[Tue Jul 01 14:47:08 2003]  (debug) [jk_uriMap.c (315)]: uriMap.init() 
Fixing Host *
[Tue Jul 01 14:47:08 2003]  ( info) [jk_workerEnv.c (403)]: 
workerEnv.init() ok /srv/www//conf/workers2.properties
Create config for main host
[Tue Jul 01 14:47:09 2003]  ( info) [mod_jk2.c (284)]: mod_jk child init
[Tue Jul 01 14:47:09 2003]  ( info) [mod_jk2.c (292)]: mod_jk.post_config() 
init worker env
[Tue Jul 01 14:47:09 2003]  (error) [jk_logger_file.c (171)]: Can't open 
log file ${serverRoot}/logs/mod_jk.log
[Tue Jul 01 14:47:09 2003]  ( info) [jk_config_file.c (320)]: cfg.update() 
Updating config /srv/www//conf/workers2.properties
[Tue Jul 01 14:47:09 2003]  ( info) [jk_config_file.c (331)]: 
config.setConfig():  Reading properties /srv/www//conf/workers2.
[Tue Jul 01 14:47:09 2003]  (error) [jk_logger_file.c (171)]: Can't open 
log file ${serverRoot}/logs/mod_jk.log
[Tue Jul 01 14:47:09 2003]  (debug) [jk_uriMap.c (315)]: uriMap.init() 
Fixing Host *
[Tue Jul 01 14:47:09 2003]  ( info) [jk_workerEnv.c (403)]: 
workerEnv.init() ok /srv/www//conf/workers2.properties
[Tue Jul  1 16:47:10 2003] [notice] Apache/1.3.26 (Linux/SuSE) 
mod_jk2/2.0.0 configured -- resuming normal operations
[Tue Jul  1 16:47:10 2003] [notice] suEXEC mechanism enabled (wrapper: 
/usr/sbin/suexec)
[Tue Jul  1 16:47:10 2003] [notice] Accept mutex: sysvsem (Default: sysvsem)

Finally when I try to open a page from tomcat without specifying port 8080 
in apache a following error is added:
[Tue Jul  1 16:47:49 2003] [notice] child pid 16282 exit signal 
Segmentation fault (11)

While in tomcat there is no information, that some page was requested.
Does anyone have any idea what is causing this Segmentation fault?

Regards,
Przemek


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: mod jk2 problem, segmetation fault

Posted by "Eric J. Pinnell" <er...@iCky.org>.
Hi,


> >
> > I guess I have this part ok, because on port 8080 it works fine.
>
> Right on...just make sure that there is a CoyoteConnector listening on 8009
> (default) or any other port that you wish to use.  When you are in
> production, you can disable the connector on 8080.
>

Actually I have found this not to be true (the part about you can use any
port).  There is some kind of limitation on how high the port you use can
be.  For example:

8009 works
14009 works
48009 doesn't.  The apache error log says that it can't connect.
According to tomcat the Connector is listening and a netstat shows the
port in a LISTEN state.

I don't know why it does this.  Port 48009 is a legit port.  I haven't
experimented with it enough to figure out where the magic port is where it
won't connect beyond that.  It has been entered in the bug database.

Seems to be a jk2 thing as well since it worked with mod_jk.

-e

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: mod jk2 problem, segmetation fault

Posted by John Turner <to...@johnturner.com>.
On Tue, 01 Jul 2003 18:27:47 +0200, Przemys³aw Korona 
<pr...@ckzeto.com.pl> wrote:

> Thank you all, for your quick responses.
>
>> Tomcat comes with a JK2 compatible connector enabled by default on port 
>> 8009.  The class name for this connector is CoyoteConnector.
>
> You mean: org.apache.coyote.tomcat4.CoyoteConnector ?

Right on.

>> If you need to use JK2, you don't need to do anything to server.xml 
>> except make sure your Hosts and your Contexts are correct, everything 
>> else is done on the Apache configuration side.
>
> I guess I have this part ok, because on port 8080 it works fine.

Right on...just make sure that there is a CoyoteConnector listening on 8009 
(default) or any other port that you wish to use.  When you are in 
production, you can disable the connector on 8080.

> It seems that I just have chosen a wrong tool. I just hope, this mod_jk 
> works with ssl (documentation says it should ;-))
> Thanks again
> Przemek

JK should work fine with SSL...in an Apache + Connector + Tomcat 
environment, Apache does all of the SSL heavy-lifting.  Communications 
between Apache and Tomcat via mod_jk and mod_jk2 are done without SSL.  So, 
you just need to focus on getting Apache doing your SSL.

If you need a HOWTO, check out mine:  http://www.johnturner.com/howto

They're for Red Hat, and Apache 2, but the steps are the same.  The only 
differences would be which mod_jk.so file you use for Apache 1.3 on SuSE.

John



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: mod jk2 problem, segmetation fault

Posted by Przemys³aw Korona <pr...@ckzeto.com.pl>.
Thank you all, for your quick responses.

>Tomcat comes with a JK2 compatible connector enabled by default on port 
>8009.  The class name for this connector is CoyoteConnector.

You mean: org.apache.coyote.tomcat4.CoyoteConnector ?

>If you need to use JK2, you don't need to do anything to server.xml except 
>make sure your Hosts and your Contexts are correct, everything else is 
>done on the Apache configuration side.

I guess I have this part ok, because on port 8080 it works fine.

>I don't know of any JK2 binaries for SuSe, so unless you built your own, I 
>would say your problem is a combination of an incompatible Apache module 
>and the configuration of Ajp13Connector.
This apache module is jk2_mod.so?  Should I compile it from the source?

>Also, I am still not clear on the compatibility of JK2 (mod_jk2) with 
>Apache 1.x.  My guess is you would be better off with mod_jk (JK).
John

It seems that I just have chosen a wrong tool. I just hope, this mod_jk 
works with ssl (documentation says it should ;-))
Thanks again
Przemek



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: mod jk2 problem, segmetation fault

Posted by John Turner <to...@johnturner.com>.
Step 1 is unnecessary.

Tomcat comes with a JK2 compatible connector enabled by default on port 
8009.  The class name for this connector is CoyoteConnector.  
Ajp13Connector is for JK and is incompatible with JK2...it will never work.

If you need to use JK2, you don't need to do anything to server.xml except 
make sure your Hosts and your Contexts are correct, everything else is done 
on the Apache configuration side.

I don't know of any JK2 binaries for SuSe, so unless you built your own, I 
would say your problem is a combination of an incompatible Apache module 
and the configuration of Ajp13Connector.

Also, I am still not clear on the compatibility of JK2 (mod_jk2) with 
Apache 1.x.  My guess is you would be better off with mod_jk (JK).

John

On Tue, 01 Jul 2003 17:52:18 +0200, Przemys³aw Korona 
<pr...@ckzeto.com.pl> wrote:

> Hi there,
> I have a problem with integrating tomcat and apache using jk2.
>
> System configuration: suse 8.1
> 			apache 1.3.26
> 			  tomcat 4.1.24
>
> Correct me if I am wrong, but to establish link bw. apache and tomcat I 
> need to:
> - add a connector in server.xml
> <Connector acceptCount="10" bufferSize="2048" 
> className="org.apache.ajp.tomcat4.Ajp13Connector" port="8009"      
> minProcessors="5" maxProcessors="75" debug="0" enableLookups="true">
> <Factory className="org.apache.catalina.net.DefaultServerSocketFactory"/>
> </Connector>
>
> - load jk2 module in httpd.conf
>
> - configure workers2.properties
> [shm]
> file=/srv/www/logs/jk2.shm
>
> [channel.socket:192.168.230.14:8009]
> info=Ajp13 forwarding over socket
> tomcatId=192.168.230.14:8009
>
> [uri:/examples/*]
> info=Map the whole webapp
>
> - configure jk2.properties
> # Set the desired handler list
> # handler.list=apr,request,channelJni
> #
> # Override the default port for the socketChannel
> # channelSocket.port=8009
> # Default:
> # channelUnix.file=${jkHome}/work/jk2.socket
> # Just to check if the the config  is working
> shm.file=/srv/www/logs/jk2.shm
>
> # In order to enable jni use any channelJni directive
> # channelJni.disabled = 0
> # And one of the following directives:
>
> # apr.jniModeSo=/opt/apache2/modules/mod_jk2.so
>
> # If set to inprocess the mod_jk2 will Register natives itself
> # This will enable the starting of the Tomcat from mod_jk2
> # apr.jniModeSo=inprocess
>
>
> It seems that in tomcat everything is fine (catalina.out after starting 
> tomcat ends with:
> 2003-07-01 17:24:33 HttpConnector[8443] Starting background thread
> 2003-07-01 17:24:34 HttpProcessor[8443][0] Starting background thread
> 2003-07-01 17:24:34 HttpProcessor[8443][1] Starting background thread
> 2003-07-01 17:24:34 HttpProcessor[8443][2] Starting background thread
> 2003-07-01 17:24:34 HttpProcessor[8443][3] Starting background thread
> 2003-07-01 17:24:34 HttpProcessor[8443][4] Starting background thread
> 2003-07-01 17:24:34 Ajp13Connector[8009] Opening server socket on all 
> host IP addresses
> 2003-07-01 17:24:34 Ajp13Connector[8009] Starting background thread
> 2003-07-01 17:24:34 Ajp13Processor[8009][0] Starting background thread
> 2003-07-01 17:24:34 Ajp13Processor[8009][1] Starting background thread
> 2003-07-01 17:24:34 Ajp13Processor[8009][2] Starting background thread
> 2003-07-01 17:24:34 Ajp13Processor[8009][3] Starting background thread
> 2003-07-01 17:24:34 Ajp13Processor[8009][4] Starting background thread
>
>
> However in apache, there are some errors after restart:
> [Tue Jul 01 14:47:08 2003]  ( info) [mod_jk2.c (284)]: mod_jk child init
> [Tue Jul 01 14:47:08 2003]  ( info) [mod_jk2.c (292)]: 
> mod_jk.post_config() init worker env
> [Tue Jul 01 14:47:08 2003]  (error) [jk_logger_file.c (171)]: Can't open 
> log file ${serverRoot}/logs/mod_jk.log
> [Tue Jul 01 14:47:08 2003]  ( info) [jk_config_file.c (320)]: 
> cfg.update() Updating config /srv/www//conf/workers2.properties
> [Tue Jul 01 14:47:08 2003]  ( info) [jk_config_file.c (331)]: 
> config.setConfig():  Reading properties /srv/www//conf/workers2.
> [Tue Jul 01 14:47:08 2003]  (error) [jk_logger_file.c (171)]: Can't open 
> log file ${serverRoot}/logs/mod_jk.log
> [Tue Jul 01 14:47:08 2003]  (debug) [jk_uriMap.c (315)]: uriMap.init() 
> Fixing Host *
> [Tue Jul 01 14:47:08 2003]  ( info) [jk_workerEnv.c (403)]: 
> workerEnv.init() ok /srv/www//conf/workers2.properties
> Create config for main host
> [Tue Jul 01 14:47:09 2003]  ( info) [mod_jk2.c (284)]: mod_jk child init
> [Tue Jul 01 14:47:09 2003]  ( info) [mod_jk2.c (292)]: 
> mod_jk.post_config() init worker env
> [Tue Jul 01 14:47:09 2003]  (error) [jk_logger_file.c (171)]: Can't open 
> log file ${serverRoot}/logs/mod_jk.log
> [Tue Jul 01 14:47:09 2003]  ( info) [jk_config_file.c (320)]: 
> cfg.update() Updating config /srv/www//conf/workers2.properties
> [Tue Jul 01 14:47:09 2003]  ( info) [jk_config_file.c (331)]: 
> config.setConfig():  Reading properties /srv/www//conf/workers2.
> [Tue Jul 01 14:47:09 2003]  (error) [jk_logger_file.c (171)]: Can't open 
> log file ${serverRoot}/logs/mod_jk.log
> [Tue Jul 01 14:47:09 2003]  (debug) [jk_uriMap.c (315)]: uriMap.init() 
> Fixing Host *
> [Tue Jul 01 14:47:09 2003]  ( info) [jk_workerEnv.c (403)]: 
> workerEnv.init() ok /srv/www//conf/workers2.properties
> [Tue Jul  1 16:47:10 2003] [notice] Apache/1.3.26 (Linux/SuSE) 
> mod_jk2/2.0.0 configured -- resuming normal operations
> [Tue Jul  1 16:47:10 2003] [notice] suEXEC mechanism enabled (wrapper: 
> /usr/sbin/suexec)
> [Tue Jul  1 16:47:10 2003] [notice] Accept mutex: sysvsem (Default: 
> sysvsem)
>
> Finally when I try to open a page from tomcat without specifying port 
> 8080 in apache a following error is added:
> [Tue Jul  1 16:47:49 2003] [notice] child pid 16282 exit signal 
> Segmentation fault (11)
>
> While in tomcat there is no information, that some page was requested.
> Does anyone have any idea what is causing this Segmentation fault?
>
> Regards,
> Przemek
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org