Archive for the 'cpanel' Category

Identifying MySQL slow queries

Thursday, December 6th, 2007

Identifying slow db queries is critical for the optimal operation of the db server. There is an excellent guide that helps to accomplish this task: http://www.ducea.com/2006/11/06/identifying-mysql-slow-queries/

Apache logs are not rotated in cpanel

Wednesday, November 21st, 2007

use this code to rotate the apache logs in /etc/httpd/logs/ The logs in /etc/httpd/domlogs are rotated according to setting in WHM -> Tweak settings

CODE:
  1. /etc/httpd/logs/*log {
  2. missingok
  3. notifempty
  4. sharedscripts
  5. compress
  6. postrotate
  7. /bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null` 2> /dev/null || true
  8. endscript
  9. }

Error reloading bind

Wednesday, September 20th, 2006

Today I encountered an error, whenever I tried to create a new cpanel account, or tried to edit a dns zone.

The error was:

CODE:
  1. Bind reloading on server using rndc zone: [testdomain.com]
  2. Error reloading bind<a /> on server: rndc: connection to remote host closed
  3. This may indicate that the remote server is using an older version of
  4. the command protocol, this host is not authorized to connect,
  5. or the key is invalid.

After some digging, I found the solution. I run:

CODE:
  1. /scripts/fixrndc
  2.  
  3. /scripts/fixnamed

and everything start working again.