Apache Tips

Apache ServerPrevent directory listing

Add following line in .htaccess

Options -Indexes

Apache Commands

These commands are for centOS which might work on other Linux versions but you will have to check the path if it doesn’t work.

Check Apache Status /etc/init.d/httpd status

Restart Apache in /sbin/service httpd restart

Start Apache in /sbin/service httpd start

Stop Apache /sbin/service httpd stop

Apache Log Rotation Configuration

This will allow logs to be archived once they exceed the threshold.

From WHM >> Service Configuration >> Apache Configuration >> Log Rotation you can specify which logs to be archived.

Apache Log Threshold

The threshold settings can be changed from WHM >> Server Configuration >> Tweak Settings

search for rotatelogs_size_threshhold_in_megabytes variable

By default this value is 300MB.

Disable Apache Auto Restart after every 2 hours (or so)

By default Apache restarts every 2 hours (or so) and every 24 hours. This is done automatically in order for Apache to grab new file handles for logs.

The auto restart can be disabled by enabling piped logging from WHP->Apache Configuration->Enable Piped Apache Logs

More details on this thread http://forums.cpanel.net/f5/why-apache-restarting-every-two-hours-254022.html


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *