3

I want to know when the httpd server was restarted, how long it has been up etc.

Thanks Jean

4
  • 2
    Which httpd server and on what operating system?
    – squillman
    Mar 19, 2011 at 18:29
  • service httpd restart|stop|reload on linux
    – Jean
    Mar 19, 2011 at 18:30
  • Look in your error logs.
    – Lekensteyn
    Mar 19, 2011 at 18:59
  • is there direct command line, which is what I am looking for
    – Jean
    Mar 19, 2011 at 19:01

2 Answers 2

3

Apache on *nix? Then you probably want to take a look at the mod_status module: http://httpd.apache.org/docs/2.0/mod/mod_status.html

If you want to access that information from commandline, you can use apache2ctl:

srv107:/home/fab# /usr/sbin/apache2ctl fullstatus

                      Apache Server Status for localhost

Server Version: Apache/2.2.9 (Debian) DAV/2 SVN/1.5.1
       mod_python/3.2.10 Python/2.4.4 PHP/5.2.6-3 with Suhosin-Patch
       mod_ssl/2.2.9 OpenSSL/0.9.8g

Server Built: Oct 1 2008 09:59:40
  _________________________________________________________________

Current Time: Sunday, 20-Mar-2011 10:57:23 CET
Restart Time: Monday, 14-Mar-2011 19:28:12 CET
Parent Server Generation: 8
Server uptime: 5 days 15 hours 29 minutes 10 seconds
Total accesses: 1535825 - Total Traffic: 12.5 GB
CPU Usage: u67.72 s11.32 cu.01 cs0 - .0162% CPU load
3.15 requests/sec - 26.8 kB/second - 8.5 kB/request
20 requests currently being processed, 8 idle workers

mod_status must be enabled for that to work

1

The best way to do this is to properly use something like mod_status for the best accuracy.

I'm assuming this is a RHEL based distribution using Apache (httpd daemon).

You can call it by using

LoadModule status_module modules/mod_status.so

In your apache config.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .