File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to check web server is running properly

 
lily zou
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, there

I need to create a heartbeat program to periodicly check if a web server and a servlet engine ( Apache & tomcat) is running properly . The two way I thought is
1. to send HTTPRequest through command line and check if it can be handled properly. ( but how to issue this command and how to delete the sessions created by this kind of process ? )
2. to check pid contends to see if those two processes are running ( is it possible that a stale process could be detected and reported ? )
Any advice would be great appreciated.
Lily
 
Sean MacLean
author
Ranch Hand
Posts: 621
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put a test servlet somewhere on the site. Write a stand alone application that connects to the servlet using a URLConnection (i.e. checks to see if the server is listening on port 80, for instance) and see it the servlet responds. The various statuses, 500 errors, etc that you'll get back should tell you what you need to know. Checking to see if the server process is running doesn't tell you if actual requests are getting processed (which is the bottom line really).
 
lily zou
Ranch Hand
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much,Sean.
By the way, I am wondering if a process died, its process id would be gone. Is it correct ? Is there any possiblity that a process id hangs around even after the process it represents has died ?
Thanks again.
Lily
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic