how to check Apache, MySQL and general logs on CentOS

Hi,
On a CentOS 5.x Server

1. How do I check Apache logs for a particular date? e.g. what was the peak of concurrent web requests on this date?

2. MySQL logs for a particular date? i.e.  a list of queries that were running at the time that the load spiked.

3. On a particular date, The traffic was very high and server became non responsive, so to identify what was the bottle neck, how do I check what was the system condition before it became non responsive, using logs?

Thanks
rajoo_sharmaAsked:
Who is Participating?
 
wesly_chenConnect With a Mentor Commented:
1. /var/log/httpd/access_log*
But double check your httpd.conf
grep  CustomLog   /etc/httpd/conf/httpd.conf

2. check the start script for mysqld
egrep  '--log|general_log'   /etc/init.d/mysqld
Usually, by default, the query is not enabled for MySQL.

3. use sar (System Activity Reporter)
It is included in sysstat package
yum  install  sysstat
After a couple minutes or hours(to collect data), then
sar -n DEV   #gives network device stats
0
 
PapertripCommented:
0
 
boon86Commented:
cd /var/log

use: cat <filename>
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
boon86Commented:
here is you search some keyword inside the log:

use: cat abc.log | grep <my keyword>
0
 
rajoo_sharmaAuthor Commented:
Thanks guys, I'll check and get back.
0
 
wesly_chenCommented:
2. for log setting, also check /etc/my.cnf
grep  ^log  /etc/my.cnf


3. for more usage details, do
man sar
   sar can report certain period of time.
0
 
PapertripCommented:
Hi Rajoo,

Were we able to help resolve this question?
0
 
boon86Commented:
0
 
boon86Commented:
ops wrong post
0
 
rajoo_sharmaAuthor Commented:
Hey guys, apologies for such a delayed response, actually I couldn't check anything since we were terribly stuck in something else. I'll check in a day or two and get back to you again.

Thanks and Regards
0
 
rajoo_sharmaAuthor Commented:
sysstat gives me what I want, though there were issues and it could not generate the graphs.
So we finally installed Munin and its generating graphs.
0
All Courses

From novice to tech pro — start learning today.