service httpd start/stop/restart)/etc/init.d/httpd configtest o apachectl configtest )<VirtualHost *:80> DocumentRoot "/var/www/systemadmin.es/htdocs" DirectoryIndex index.php ServerName systemadmin.es ServerAlias foro.systemadmin.es <Directory /var/www/systemadmin.es/htdocs> Options FollowSymLinks AllowOverride all Order deny,allow Allow from all </Directory> ErrorLog "| /usr/local/sbin/cronolog -S /var/www/systemadmin.es/logs/current.error.log /var/www/systemadmin.es/logs/%Y/%m/%d/error.log" CustomLog "| /usr/local/sbin/cronolog -S /var/www/systemadmin.es/logs/current.custom.log /var/www/systemadmin.es/logs/%Y/%m/%d/custom.log" combined </VirtualHost>
#!/bin/bash for i in $(find /var/www/ -maxdepth 2 -iname logs); do #eliminacion de los mas antiguos de 10 dias find $i -mtime +10 -type f -exec rm {} \; #eliminacion de directios vacios find $i -empty -type d -exec rmdir {} \; 2>/dev/null #compresión de logs ya rotados find $i -type f -iname \*\.log -mtime +2 -exec gzip {} \; done
ExtendedStatus On, da más información de este módulo:http://systemadmin.es/2011/11/guia-de-supervivencia-con-apache