Another problem with cPanel servers is the log files and logrotate. By default, logrotate looks for the wrong log files in the wrong place (in addition, it can't even send a signal to apache because its looking at the wrong PID file).
As a result, you'll notice your "/etc/httpd/logs/suexec_log" growing to several gigs (after several months on a busy site). Once suexec_log reaches 2GB then your entire server will not be able to execute any CGI scripts (due to a size limit in the libraries). Here is how to make logrotate work with Jag's specific server configuration:
STEP 1: Edit your "/etc/logrotate.d/httpd" file and remove everything, then copy/paste this in it:
Code:/etc/httpd/logs/*log { missingok notifempty sharedscripts postrotate /bin/kill -HUP `cat /usr/local/apache/logs/httpd.pid 2>/dev/null` 2> /dev/null || true endscript }
STEP 2: If you are using the jag-specific custom BFD rules i've created (see my signature), then you may also create the file "/etc/logrotate.d/bfd" and add this in it: (make sure the bfd_log if the correct log file for BFD, for example i've renamed it as bfd.log in the BFD config file)
Code:/var/log/bfd_log { missingok postrotate endscript }
STEP 3: SSL-enabled domains create {domain address}-ssl_data_log files under /etc/httpd/domlogs/ which are useless SSL data logs. Unfortunately these logs are never rotated. In addition, they aren't used for any statistic purposes and they serve no real purpose.
Since these files aren't used for anything, you may delete them entirely and
remove the SSLLogFile entry from the apache template. Here is how to do it:
That should take care of all future domains, now all you need to do is editCode:Edit your: /usr/local/cpanel/etc/httptemplates/apache1/ssldefault Find the line: SSLLogFile %logdir%/%logname%-ssl_data_log and remove it!
your /etc/httpd/conf/httpd.conf and remove all SSLLogFile lines from there.
Then restart your apache and remove all ssl log files with "rm -rf
/etc/httpd/domlogs/*ssl_data_log
Remember that a cPanel/WHM automatic update may overwrite your "ssldefault" template and revert the changes. There is already a bug report in cPanel's bugzilla to fix this.
STEP 4: Clean your exim statistics. These are located in a mysql database called "eximstats" which corresponds to the /var/log/exim* log files. Its a good idea to clean the database once it becomes too big, which in practice is good only for high-volume servers.
Code:First check the size of your eximstats database: du -s -h /var/lib/mysql/eximstats If you want to clean it then connect to mysql as root and run: use eximstats; delete from sends; delte from smtp;


LinkBack URL
About LinkBacks



Reply With Quote


Bookmarks