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?
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 be read from bottom to top as the last entries contains the last (error) data
don't post everything 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 )