Best way to program a server status feature
<p>Some background information.
- Running a java server on localhost
- Running a webserver on localhost</p>

<p>I would like a webpage to have a 'server status' feature which lets me know whether the server is running or not. My question, what is the best way to do this?</p>

<ol>
<li>When I launch the java server, I write a flag in the database to signify that it is running.</li>
<li>Javascript/PHP sockets to try and bind on the same port. (Not sure if possible yet)</li>
<li>Shell script to locate the program in the task list.</li>
</ol>

<p>Thanks!</p>
