Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find out the time apache was last restarted? [closed]

I have a VPS with kloxo control panel installed. I am using CentOS 5.8 32-bit.

I restarted Apache today but forgot the time when I did. It is very important to know the exact time.

Can I find it out using the log files or SSH command?

like image 831
Enn Fenn Avatar asked Apr 09 '13 12:04

Enn Fenn


People also ask

How do I know if Apache restarted?

Depending on how Apache and syslog are configured on your machine, it may vary, however with a stock Debian or Ubuntu Apache 2 installation, you'd find the logs in /var/log/apache2/error. log . If it's restarting you should clearly see it in the logs.

How can I tell when a service was rebooted Linux?

Your script could look something along: journalctl --since=<date> --until=<another data> UNIT=<service name> SYSLOG_IDENTIFIER=systemd | awk ' /Started/{ started = 1 } /Stopped/{ if (started) { started = 0; restarted++; } } END { print "It was restarted " restarted "times." } ' The regex here are just an example.

How long does Apache take to restart?

virtual machines - exactly 90 seconds to restart apache httpd - Server Fault.

How long has Apache been running?

Apache has been around since 1995 and is responsible as a core technology that helped spur the initial growth of the internet in its infancy. One of the pros of Apache is its ability to handle large amounts of traffic with minimal configuration.


2 Answers

Log in into your VPS via SSH and type in the command:

grep resuming /var/log/httpd/error_log
like image 55
rasho Avatar answered Oct 04 '22 19:10

rasho


You can find out this from the Apache logs. You will need to log into your VPS via ssh and check the error_log for your apache instance.

You should find something like the following:

[Tue Apr 09 11:43:23 2013] [notice] Apache/2.2.15 (Unix) DAV/2 configured -- resuming normal operations

That will tell you exactly when you apache instance was last started successfully

like image 34
mostlyh Avatar answered Oct 04 '22 19:10

mostlyh