Home > CentOS > Configure Apache

Basic Configuration

vim /etc/php.ini
Few useful parameters: upload_max_filesize, memory_limit and post_max_size

/etc/init.d/httpd restart

Compress the log file

vim /etc/logrotate.d/httpd
missingok
notifempty
compress   <== Add This
sharedscripts
delaycompress
postrotate
/sbin/service httpd reload > /dev/null 2>/dev/null || true
endscript

Setup logrotate for custom log file

vim /etc/logrotate.d/httpd
/var/www/vhosts/my-helper/logs/*log {
weekly
size=10M
rotate 4
compress
sharedscripts
postrotate
/sbin/service httpd reload > /dev/null 2>/dev/null || true
endscript
}

logrotate -v /etc/logrotate.d/httpd

Reference:
http://linux.vbird.org/linux_server/0360apache.php#other_pkg_syslog
http://linux.vbird.org/linux_basic/0570syslog.php#rotate



Flag Counter