Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 699
  • Last Modified:

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
0
rajoo_sharma
Asked:
rajoo_sharma
  • 4
  • 3
  • 2
  • +1
1 Solution
 
PapertripCommented:
0
 
wesly_chenCommented:
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
 
boon86Commented:
cd /var/log

use: cat <filename>
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help 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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now