Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a CentOS 5.8-based VPS and for 4 months I have been facing random system hangs every 2 or 3 days; then I need to reset the VPS through its control panel. How and where can I start debugging those hangs?

share|improve this question
    
You should start by looking in your logs at a time immediately before the server hangs. –  Iain Sep 1 '12 at 6:53
    
I have no idea when exactly the server is going to hang, it just happens and when it does,I can not even get into the control panel of my vps,I only can reset - reboot or power off-on the vps from a simple panel from hwhere i bought my VPS. –  Hossein Sep 1 '12 at 7:41
    
So look in your logs immediately before you restarted the system. –  Iain Sep 1 '12 at 7:49
    
@lain: I am saying i can not log in to the servers control panel when it hangs!The only way to manipulate server is by using a simple (reset-power off-on switch panel that the company from which i bought my vps gave me).This is the panel im talking about : upload.ustmb.ir/uploads/… –  Hossein Sep 1 '12 at 8:05
    
When you have restarted your system, go to your logs and examine them. You'll notice the entries have timestamps. Look for entries timestamped prior to the time that you restarted your system ... –  Iain Sep 1 '12 at 8:08
show 1 more comment

1 Answer

up vote 1 down vote accepted

this link is usefull concerning logs on centos : http://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch-logfiles.html

35.1. Locating Log Files

Most log files are located in the /var/log/ directory. Some applications such as httpd and samba have a directory within /var/log/ for their log files.

You may notice multiple files in the log file directory with numbers after them. These are created when the log files are rotated. Log files are rotated so their file sizes do not become too large. The logrotate package contains a cron task that automatically rotates log files according to the /etc/logrotate.conf configuration file and the configuration files in the /etc/logrotate.d/ directory. By default, it is configured to rotate every week and keep four weeks worth of previous log files.

read /var/logs/messages for general stuff look for access_log / error_log in apache directory / virtualhost for your website

you should read them all and try to get a clue to what is going wrong look in /var/log/messages and do some research on what you found and add it to your question so people may have more info to help you

note that logs have to read from bottom to top as the last entries contains the last (error) data dont post everyting if the file is too big , just the last 20 lines for example will be a good start (ex. tail -n 20 /var/log/messages )

share|improve this answer
    
Thank you ,But which one should i look into? there are error in httpd but im not sure what they are.Such as: [Sun Aug 19 14:00:41 2012] [error] [client 94.75.209.131] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) [Sun Aug 19 22:31:27 2012] [error] [client 94.100.24.68] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /w00tw00t.at.ISC.SANS.DFind:) –  Hossein Sep 1 '12 at 12:15
    
edited , see above –  maazza Sep 1 '12 at 12:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.