cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: Can I use curl for Apache AJP/1.3 status check?

From: Niels Heyvaert <nielsheyvaert_at_hotmail.com>
Date: Tue, 17 Apr 2007 15:20:24 +0000

Hi Ralph,
 
I think you're making this complicated, but it depends a bit on the goal you're trying to achieve.
 
If it's a matter of getting a correct sequence and only starting Apache when Tomcat is there, you could use another method.
 
The way I did that was by checking if the file called "mod_jk.conf-auto" that Tomcat generated when starting. Once the file is there, you are sure you can start Apache.
 
I'm not sure if this mechanism still stands with the latest versions of Tomcat, though.
 
Anyway, the way I did this was create a script starting both servers. It's a DOS syntax, but the similar can be done on a UNIX system:
 
 
set JAVA_HOME=c:\your\java\home
set TOMCAT_HOME=c:\your\tomcat\home
set APACHE_HOME=c:\your\apache\home
call "%TOMCAT_HOME%\bin\startup.bat"
 
:loop
if not exist "%TOMCAT_HOME%\conf\mod_jk.conf-auto" goto loop
 
start "Apache" "%APACHE_HOME%\Apache.exe" -d "%APACHE_HOME%" -s -k start
 
That did the trick for me.
 
Hope this helps you a bit.
 
N.
-- Microsoft gives you windows, Linux gives you the whole house.> Date: Tue, 17 Apr 2007 08:57:34 -0500> From: ralphmitchell@gmail.com> To: curl-users@cool.haxx.se> Subject: Re: Can I use curl for Apache AJP/1.3 status check?> > On 4/17/07, Saberhagen Nathan <dualspace@gmail.com> wrote:> > I'm using Apache web server(2.0.47) & Apache Tomcat (5.5.20).> > They are tied with mod_jk, AJP/1.3.> >> > Restarting the server as follows:> > 1. stop apache> > 2. stop tomcat> > 3. deploy fixed/updated web application> > 4. startup tomcat> > 5. (Not now)> > 6. startup apache> >> > between 4 and 6, before starting apache, I want to check tomcat properly> > started via AJP;> > if not, do not start apache.> >> > - Can I use curl on process 5?> > - And how can it be?> > (assume AJP port is 8102)> >> > How about:> > curl -o /dev/null http://localhost:8102> > then check the return code. If it's non-zero, tomcat probably isn't> talking. Or you could save the output and check it for specific> content.> > Ralph Mitchell
_________________________________________________________________
Ontdek Windows Live Hotmail, het ultieme online mailprogramma!
http://get.live.com/mail/overview
Received on 2007-04-17