FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 06-17-2008, 02:55 PM
"Sean Carolan"
 
Default Apache jserv monitoring?

>>> Sounds similar to the mod_jk connector in apache to connect to
>>> tomcat. When I had to deal with this I setup a dedicated apache
>>> instance on each system running tomcat whose sole purpose for
>>> existence was for testing that connector.

We have decided to take this tactic and set up a dedicated apache
instance on each server simply for monitoring the local java process.
I have run into a snag, however and I'm not sure what to do next. At
first I attempted to install the mod_jserv rpm but that didn't work:

[scarolan@pstest-app13:~]$ sudo rpm -ivh ApacheJServ-1.1.2-1.i386.rpm
error: Failed dependencies:
apache >= 1.3.6 is needed by ApacheJServ-1.1.2-1

Ok, so next thing I tried was compiling the module from source code:

[scarolan@pstest-app13:~/ApacheJServ-1.1.2]$ ./configure
--with-jdk-home=/usr/local/mercury/Sun/jdk1.5.0_01
--with-JSDK=/usr/local/mercury/Sun/JSDK2.0/lib/jsdk.jar
--with-apache-src=/usr/include/httpd/

[bunch of automake stuff removed]
checking for Apache source directory (assume static build)...
configure: error: Directory is not a valid Apache source distribution

I have installed both the httpd-devel rpm and the httpd src rpm, and
tried directing --with-apache-src at each directory but no dice. What
am I doing wrong here?
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-17-2008, 03:06 PM
"Sean Carolan"
 
Default Apache jserv monitoring?

> [scarolan@pstest-app13:~/ApacheJServ-1.1.2]$ ./configure
> --with-jdk-home=/usr/local/mercury/Sun/jdk1.5.0_01
> --with-JSDK=/usr/local/mercury/Sun/JSDK2.0/lib/jsdk.jar
> --with-apache-src=/usr/include/httpd/

If I run the configure command without --with-apache-src here is what I get:

configure: error: Could not locate one or more of the necessary Apache
header files.
Please check that you have passed the correct location for the Apache
directory. Note that you must run either Apache's 'Configure' or
'configure' program at least once if you have never compiled Apache before;
this generates certain necessary headers files based on your platform.

This seems to indicate that it wants the apache header files, which
are installed in /usr/include/httpd. Anyway if someone has an idea
how I can get a working mod_jserv module for CentOS3 let me know.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-17-2008, 04:33 PM
"Sean Carolan"
 
Default Apache jserv monitoring?

> This seems to indicate that it wants the apache header files, which
> are installed in /usr/include/httpd. Anyway if someone has an idea
> how I can get a working mod_jserv module for CentOS3 let me know.

Ok, so after doing some more reading it appears that you can simply
build the mod_jserv.so module with a command like this:

apxs -c mod_jserv.c -o mod_jserv.so

However when I run the command I get another error:

[root@pstest-app13 c]# /usr/sbin/apxs -c mod_jserv.c -o mod_jserv.so
/usr/bin/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -pipe
-march=i386 -mcpu=i686 -DSSL_EXPERIMENTAL_ENGINE
-I/usr/kerberos/include -DAP_HAVE_DESIGNATED_INITIALIZER -DLINUX=2
-D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE
-D_GNU_SOURCE -pthread -I/usr/include/httpd -c -o mod_jserv.lo
mod_jserv.c && touch mod_jserv.slo
mod_jserv.c:63:19: jserv.h: No such file or directory

I think I'm getting closer to building mod_jserv.so, but this really
is feeling like a wild goose chase. We try as much as possible to
stick with RPM/yum for our package management but unfortunately the
previous sysadmin liked to build a lot from source. Can someone help?
Where do I find this jserv.h, and how do I tell apxs where it lives?
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-17-2008, 04:51 PM
"Andrea Dell'Amico"
 
Default Apache jserv monitoring?

On Tue, 2008-06-17 at 11:33 -0500, Sean Carolan wrote:

> I think I'm getting closer to building mod_jserv.so, but this really
> is feeling like a wild goose chase. We try as much as possible to
> stick with RPM/yum for our package management but unfortunately the
> previous sysadmin liked to build a lot from source. Can someone help?
> Where do I find this jserv.h, and how do I tell apxs where it lives?

mod_jserv is really old, are you sure it can be compiled against apache
2?
If you need a jk connector, use mod_jk. You can find the source rpm in
the RHWAS repository (I didn't check if CentOS has a binary version
somewhere).

ciao
ad
--
No matter what side of the argument you are on, you always find people
on your side that you wish were on the other.
- Jascha Heifetz

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-17-2008, 05:00 PM
"Sean Carolan"
 
Default Apache jserv monitoring?

> mod_jserv is really old, are you sure it can be compiled against apache
> 2?
> If you need a jk connector, use mod_jk. You can find the source rpm in
> the RHWAS repository (I didn't check if CentOS has a binary version
> somewhere).
>
> ciao
> ad

Hi Andrea, thanks for your reply. I know mod_jserv is ancient, but we
have to support it because it's still being used on production
machines. Will mod_jk connect in the same way that mod_jserv does?
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-17-2008, 05:20 PM
"Sean Carolan"
 
Default Apache jserv monitoring?

> Hi Andrea, thanks for your reply. I know mod_jserv is ancient, but we
> have to support it because it's still being used on production
> machines. Will mod_jk connect in the same way that mod_jserv does?

I have mod_jk module properly loaded now, how would I duplicate this
function of jserv with mod_jk?

<IfModule mod_jserv.c>
ApJServMount /servlets ajpv12://servername.com:8008/root
ApjServAction .html /servlets/gnujsp
</IfModule>
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-17-2008, 05:30 PM
"Sean Carolan"
 
Default Apache jserv monitoring?

> I have mod_jk module properly loaded now, how would I duplicate this
> function of jserv with mod_jk?
>
> <IfModule mod_jserv.c>
> ApJServMount /servlets ajpv12://servername.com:8008/root
> ApjServAction .html /servlets/gnujsp
> </IfModule>
>

I should add that "servername.com" is localhost, so this could
certainly be a local file path rather than a URL.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-17-2008, 06:09 PM
"Sean Carolan"
 
Default Apache jserv monitoring?

I found this on the mod_jk howto from the apache site:

*********************
For example the following directives will send all requests ending in
.jsp or beginning with /servlet to the "ajp13" worker, but jsp
requests to files located in /otherworker will go to "remoteworker".

JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /otherworker/*.jsp remoteworker

You can use the JkMount directive at the top level or inside
<VirtualHost> sections of your httpd.conf file.
*********************

I just need to figure out how to get the equivalent JkMount command to
replace the old ApJServMount from before. If anyone has an idea how
this is done please let me know. Most of the documentation I have
read is tomcat-specific, whereas I am not actually using this to
connect to a modern Tomcat server.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-17-2008, 06:20 PM
"Andrea Dell'Amico"
 
Default Apache jserv monitoring?

On Tue, 2008-06-17 at 13:09 -0500, Sean Carolan wrote:
> I found this on the mod_jk howto from the apache site:
>
> *********************
> For example the following directives will send all requests ending in
> .jsp or beginning with /servlet to the "ajp13" worker, but jsp
> requests to files located in /otherworker will go to "remoteworker".
>
> JkMount /*.jsp ajp13
> JkMount /servlet/* ajp13
> JkMount /otherworker/*.jsp remoteworker
>
> You can use the JkMount directive at the top level or inside
> <VirtualHost> sections of your httpd.conf file.
> *********************
>
> I just need to figure out how to get the equivalent JkMount command to
> replace the old ApJServMount from before. If anyone has an idea how
> this is done please let me know. Most of the documentation I have
> read is tomcat-specific, whereas I am not actually using this to
> connect to a modern Tomcat server.

It doesn't matter. You can use the ajp12 connector if your application
server doesn't support ajp13.

The server URL (remoteworker in the above example) has to be configured
in a different file.
You'll find two example files attached. mod_jk.conf has to be included
by httpd.conf, workers.properties is referred by mod_jk.

ciao
andrea
--
To err is human; to forgive, infrequent.
- Franklin P. Adams

JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile /var/log/httpd/openspcoop-mod_jk.log
JkLogLevel error
#JkLogLevel debug

#
# Public services
#
JkMount /* ajp12
JkMount /servlets ajp12

#
#------ DEFAULT worket list ------------------------------------------
#---------------------------------------------------------------------
#
#
# The workers that your plugins should create and work with
#
# Add 'inprocess' if you want JNI connector
worker.list=ajp12, ajp13
# , inprocess

#
#------ DEFAULT ajp12 WORKER DEFINITION ------------------------------
#---------------------------------------------------------------------
#

#
# Defining a worker named ajp12 and of type ajp12
# Note that the name and the type do not have to match.
#
worker.ajp12.port=8007
worker.ajp12.host=localhost
worker.ajp12.type=ajp12
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
worker.ajp12.lbfactor=1

#
#------ DEFAULT ajp13 WORKER DEFINITIONS -----------------------------
#---------------------------------------------------------------------
#

#
# Defining a worker named ajp13 and of type ajp13
# Note that the name and the type do not have to match.
#
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
worker.ajp13.lbfactor=1

#
# Specify the size of the open connection cache.
#worker.ajp13.cachesize

# The loadbalancer (type lb) workers perform wighted round-robin
# load balancing with sticky sessions.
# Note:
# ----> If a worker dies, the load balancer will check its state
# once in a while. Until then all work is redirected to peer
# workers.
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=ajp12, ajp13

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 06-17-2008, 07:03 PM
"Sean Carolan"
 
Default Apache jserv monitoring?

Andrea thank you again for your help. I think I have almost got this
set up right. I copied your workers.properties file and the
appropriate entries from mod_jk.conf and now I can connect, but get a
400 error. I only have the default Apache site configured on this
box, and my mod_jk.conf file inside of /etc/httpd/conf.d/. Any idea
how to correct the "No body with status=400"? All i really need is a
simple page that we can check to see whether it's up or down. Sorry
for this long post, I want to make sure you have all the info. Here
are my config files:

mod_jk.conf:

************
<IfModule !mod_jk.c>
LoadModule jk_module modules/mod_jk.so
</IfModule>

<IfModule mod_jk.c>
JkWorkersFile "/etc/httpd/conf/workers.properties"
JkLogFile "/var/log/httpd/mod_jk.log"
JkLogLevel debug
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
</IfModule>

JkMount /* ajp12
JkMount /servlets ajp12
*************

workers.properties - exactly the same as yours except that our java
runs on port 8008

Main apache config file - unchanged from the way it comes
out-of-the-box. It was working fine as the default CentOS page until
I added mod_jk to the mix.

Debug log output:

[Tue Jun 17 13:55:43 2008][7336:47264] [debug]
ajpv12_handle_request::jk_ajp12_worker.c (367): Into
ajpv12_handle_request
[Tue Jun 17 13:55:43 2008][7336:47264] [debug]
ajpv12_handle_request::jk_ajp12_worker.c (371): ajpv12_handle_request,
sending the ajp12 start sequence
[Tue Jun 17 13:55:43 2008][7336:47264] [debug]
ajpv12_handle_request::jk_ajp12_worker.c (429): ajpv12_handle_request,
sending the headers
[Tue Jun 17 13:55:43 2008][7336:47264] [debug]
ajpv12_handle_request::jk_ajp12_worker.c (447): ajpv12_handle_request,
sending the terminating mark
[Tue Jun 17 13:55:43 2008][7336:47264] [debug]
ajpv12_handle_request::jk_ajp12_worker.c (497): ajpv12_handle_request
done
[Tue Jun 17 13:55:43 2008][7336:47264] [debug]
service::jk_ajp12_worker.c (123): In jk_endpoint_t::service, sent
request
[Tue Jun 17 13:55:43 2008][7336:47264] [debug]
ajpv12_handle_response::jk_ajp12_worker.c (512): Into
ajpv12_handle_response
[Tue Jun 17 13:55:43 2008][7336:47264] [debug]
ajpv12_handle_response::jk_ajp12_worker.c (533):
ajpv12_handle_response, read Status: 400 Bad Request
[Tue Jun 17 13:55:43 2008][7336:47264] [debug]
ajpv12_handle_response::jk_ajp12_worker.c (565):
ajpv12_handle_response, read Status=400 Bad Request
[Tue Jun 17 13:55:43 2008][7336:47264] [debug]
ajpv12_handle_response::jk_ajp12_worker.c (533):
ajpv12_handle_response, read Servlet-Error: Received empty servlet
name
[Tue Jun 17 13:55:43 2008][7336:47264] [debug]
ajpv12_handle_response::jk_ajp12_worker.c (565):
ajpv12_handle_response, read Servlet-Error=Received empty servlet name
[Tue Jun 17 13:55:43 2008][7336:47264] [debug]
ajpv12_handle_response::jk_ajp12_worker.c (588):
ajpv12_handle_response, allocating header arrays
[Tue Jun 17 13:55:43 2008][7336:47264] [debug]
ajpv12_handle_response::jk_ajp12_worker.c (533):
ajpv12_handle_response, read
[Tue Jun 17 13:55:43 2008][7336:47264] [debug]
ajpv12_handle_response::jk_ajp12_worker.c (535):
ajpv12_handle_response, headers are done
[Tue Jun 17 13:55:43 2008][7336:47264] [debug]
ajpv12_handle_response::jk_ajp12_worker.c (615):
ajpv12_handle_response, starting response
[Tue Jun 17 13:55:43 2008][7336:47264] [debug]
ajpv12_handle_response::jk_ajp12_worker.c (626):
ajpv12_handle_response, reading response body
[Tue Jun 17 13:55:43 2008][7336:47264] [debug]
ajpv12_handle_response::jk_ajp12_worker.c (644):
ajpv12_handle_response, response body is done
[Tue Jun 17 13:55:43 2008][7336:47264] [debug]
ajpv12_handle_response::jk_ajp12_worker.c (658):
ajpv12_handle_response done
[Tue Jun 17 13:55:43 2008][7336:47264] [debug] done::jk_ajp12_worker.c
(139): Into jk_endpoint_t::done
[Tue Jun 17 13:55:43 2008][7336:47264] [info] jk_handler::mod_jk.c
(2040): No body with status=400 for worker=ajp12
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 07:07 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org