Table of Contents

Apache

utils

optimization

Order Deny, Allow
Deny from all
Allow from 192.168.1.0/16
ServerSignature Off
ServerTokens Prod
TraceEnable Off

in ssl.conf

 SSLProtocol -ALL +SSLv3 +TLSv1
 SSLCipherSuite ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM

in vhost

 Include conf/ssl.conf
 RewriteEngine on
 RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
 RewriteRule .* - [F]
allow_call_time_pass_reference = Off
magic_quotes_gpc = Off
register_long_arrays = Off
register_argc_argv = Off
allow_url_fopen = Off
expose_php = Off
disable_functions = symlink,shell_exec,proc_close,proc_open,dl,passthru,escapeshellarg,escapeshellcmd,openlog, apache_child_terminate,apache_get_modules,apache_get_version,apache_getenv,apache_note,apache_setenv,virtual, phpinfo

mod_deflate (Apache2)

also see: HowtoForce - ModDeflate, mod_deflate

<Location />
 # Insert filter
 SetOutputFilter DEFLATE

 #DeflateFilterNote ratio
 #DeflateCompressionLevel 9
 # Netscape 4.x has some problems...
 BrowserMatch ^Mozilla/4 gzip-only-text/html

 # Netscape 4.06-4.08 have some more problems
 BrowserMatch ^Mozilla/4\.0[678] no-gzip

 # MSIE masquerades as Netscape, but it is fine
 # BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

 # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
 # the above regex won't work. You can use the following
 # workaround to get the desired effect:
 BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

 # Don't compress images
 SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
 SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
 SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary

 # Make sure proxies don't deliver the wrong content
  Header append Vary User-Agent env=!dont-vary
</Location>

This configuration will compress everything except for images. Of course, you can’t test this with curl, but you can test it with Firefox and LiveHTTPHeaders. If you don’t have Firefox handy, you can try a very handy web application that will give you the statistics about the compression of your site’s data.

deflate.load header.load

= SSL = http://www.mail-archive.com/modssl-users@modssl.org/msg10790.html

ssl.conf
#SSLSessionCache shmcb:/var/run/apache2/ssl_scache(512000)
SSLSessionCache dbm:/var/run/apache2/ssl_scache
SSLSessionCacheTimeout 300