Forum LAMS for Tech-Heads - General Forum: mod_jk broken after upgrade to 2.4


 
You may request notification for mod_jk broken after upgrade to 2.4.
Search: 

1: mod_jk broken after upgrade to 2.4
12/16/12 08:29 PM
[ Reply | Forward ]
Hi

We have just upgraded to 2.4 and the upgrade all seems to have run ok and we can get the login page on port 8080 ok, but the mod_jk setup that was running fine with 2.3.5 is giving "service temporarily unavailable" error on port 80 /lams

I have added jvmRoute="node1" attribute to Engine in $JBOSS_HOME/server/default/deploy/jbossweb.sar/server.xml

lams server loads with final message

2012-12-17 14:28:04,552 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (main) deploy, ctxPath=/lams/www
2012-12-17 14:28:04,692 INFO [org.apache.coyote.http11.Http11Protocol] (main) Starting Coyote HTTP/1.1 on http-210.48.33.60-8080
2012-12-17 14:28:04,897 INFO [org.apache.coyote.ajp.AjpProtocol] (main) Starting Coyote AJP/1.3 on ajp-210.48.33.60-8009
2012-12-17 14:28:05,123 INFO [org.jboss.bootstrap.microcontainer.ServerImpl] (main) JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)] Started in 2m:20s:447ms

Which indicates that Ajp is running on port 8009, but apache error log shows

[Mon Dec 17 14:39:53 2012][2330:3458803520] [info] jk_open_socket::jk_connect.c (594): connect to 127.0.0.1:8009 failed (errno=111)
[Mon Dec 17 14:39:53 2012][2330:3458803520] [info] ajp_connect_to_endpoint::jk_ajp_common.c (922): Failed opening socket to (127.0.0.1:8009) (errno=111)
[Mon Dec 17 14:39:53 2012][2330:3458803520] [error] ajp_send_request::jk_ajp_common.c (1507): (node1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)
[Mon Dec 17 14:39:53 2012][2330:3458803520] [info] ajp_service::jk_ajp_common.c (2447): (node1) sending request to tomcat failed (recoverable), because of error during request sending (attempt=2)
[Mon Dec 17 14:39:53 2012][2330:3458803520] [error] ajp_service::jk_ajp_common.c (2466): (node1) connecting to tomcat failed.
[Mon Dec 17 14:39:53 2012]node1 lams.vln.school.nz 0.101693
[Mon Dec 17 14:39:53 2012][2330:3458803520] [info] jk_handler::mod_jk.c (2615): Service error=-3 for worker=node1

Are there some other changes we need to make to apache conf files or jboss config files to get mod_jk running for 2.4? Any help/pointers gratefully received.

workers.properties is
####################################
# Define 1 real worker named ajp13
worker.list=node1

# Set properties for worker named ajp13 to use ajp13 protocol,
# and run on port 8009
worker.ajp13.type=ajp13
worker.ajp13.host=localhost
worker.ajp13.port=8009
worker.ajp13.lbfactor=50
worker.ajp13.cachesize=10
worker.ajp13.cache_timeout=600
worker.ajp13.socket_keepalive=1
worker.ajp13.socket_timeout=300
####################################

jk.conf is
####################################
# Where to find workers.properties
# Update this path to match your conf directory location
JkWorkersFile /etc/apache2/jk_workers.properties

# Where to put jk logs
# Update this path to match your logs directory location
JkLogFile /var/log/apache2/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevel info

# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

# JkOptions indicate to send SSL KEY SIZE,
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"

# Shm log file
JkShmFile /var/log/apache2/jk-runtime-status
##########################################

Virtual host setting

############################
JkMount /lams/ node1
JkMount /lams/* node1
############################

Thanks
Glen

Posted by Glen Davies

2: Re: mod_jk broken after upgrade to 2.4
In response to 1 12/17/12 02:43 PM
[ Reply | Forward ]
Hi Glen,

I think the error is that LAMS is bound to IP 210.48.33.60 and mod_jk is trying to connect to IP 127.0.0.1

For your server.log:


2012-12-17 14:28:04,692 INFO [org.apache.coyote.http11.Http11Protocol] (main) Starting Coyote HTTP/1.1 on http-210.48.33.60-8080
2012-12-17 14:28:04,897 INFO [org.apache.coyote.ajp.AjpProtocol] (main) Starting Coyote AJP/1.3 on ajp-210.48.33.60-8009

So LAMS has started as "run.sh -b 210.48.33.60", right?

And mod_jk is configured to talk to LAMS on port 127.0.0.1/localhost:


...
worker.ajp13.host=localhost
...

So you can either start LAMS as run.sh -b 127.0.0.1 and that will ensure that mod_jk can talk via ajp to LAMS and you can do your apache proxying.

Thanks

Ernie

Posted by Ernie Ghiglione

3: Re: Re: mod_jk broken after upgrade to 2.4
In response to 2 12/17/12 03:20 PM
[ Reply | Forward ]
Doh! - that is blindingly obvious! Must have been a long day yesterday - roll on xmas hols. Thanks Ernie, all sorted now.

Perhaps it could do with a line adding to the "Start Lams" section at http://wiki.lamsfoundation.org/display/lamsdocs/Upgrading+LAMS+2.3.5+to+2.4+Linux given that the -b option is shown here, eg.

"If you use the -b option to bind Lams to a specific IP address and you are using mod_jk then make sure you use the same address that mod_jk is set to listen to. For example mod_jk is usually set to connect to localhost (127.0.0.1) so use -b 127.0.0.1 when starting Lams" - just in case there are others as stupid as me :-)

Thanks for your help
Glen

Posted by Glen Davies

4: Re: Re: Re: mod_jk broken after upgrade to 2.4
In response to 3 12/17/12 04:09 PM
[ Reply | Forward ]
Hi Glen,

I've just added a "Start on boot" section that was probably what this document was missing.

In there there's a script on how to start/stop LAMS on linux as a service:

http://wiki.lamsfoundation.org/display/lamsdocs/Start+up+on+boot

Thanks,

Ernie

Posted by Ernie Ghiglione

Reply to first post on this page
Back to LAMS for Tech-Heads - General Forum