Category: Apache

Apache 1.3 and 2.x Tips and tricks

Apache

Logging Apache Access logs through syslogd

Error logs can be logged very easyly to syslig using the following ErrorLog syslog:local1 Access logs must use a pipe-to-script trick as follows: In Apache config: CustomLog |/usr/local/apache/bin/apache_syslog combined As script in system: Content of /usr/local/apache/bin/apache_syslog ——————————————— logger -i -p local3.info -t TEST-APACHE ——————————————— chmod 755 /usr/local/apache/bin/apache_syslog

Apache

Running mod_gzip, mod_rewrite, and mod_proxy together in Apache 1.3.x

When using RewriteRule ….[P] with mod_gzip there are often problems To resolve this add the following directive to mod_gzip ———————————————– mod_gzip_item_include handler proxy-server ———————————————– mod_gzip_item_include mime “application/x-httpd-php.*” mod_gzip_item_include mime httpd/unix-directory mod_gzip_item_include handler ^server-status$ mod_gzip_item_exclude file \.css$ mod_gzip_item_exclude file \.js$ mod_gzip_item_exclude reqheader “Via:.*1\.0 PROXY” mod_gzip_item_exclude reqheader “Via:.*1\.0 lavoisier \(NetCache NetApp\/5\.0\.1R2\)”

Apache

Examples of mod_security diretives

SecFilterEngine On SecFilterScanPOST On SecFilterSelective “POST_PAYLOAD” “BoesesWort” “deny,log,status:412” # Ersetze BoesesWort durch das Wort, welches du sperren willst. # Speichere die Textdatei unter dem Namen .htaccess (den führenden Punkt nicht vergessen) SecFilterSelective “POST_PAYLOAD” “AnderesBoesesWort” “deny,log,status:412” # Alternative SecFilterSelective “POST_PAYLOAD” “BoesesWort” “deny,log,redirect:http.//www.deinedomain.de/seite.html”

Apache

MOD_JK configuration directives

see: http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html The following directives are normally inserted in workers.properties file connection_pool_minsize (default 0) defines, how many idle connections remain when the pool gets shrinked. By default this is half of the maximum pool size. connection_pool_size (default 0) We generally do not recommend to use this attribute in combination with Apache httpd. For Apache httpd …

Apache

Logging gzip compression factor of files

LogFormat “%h %l %u %t \”%r\” %>s %b mod_gzip:%{mod_gzip_result}n In:%{mod_gzip_input_size}nOut:%{mod_gzip_output_size}n:%{mod_gzip_compression_ratio}npct.” full_plus_gzip [17:29:14] CustomLog /var/log/httpd/mod_gzip.log full_plus_gzip Example of log entry: /reviews/cooling/HSR2_4.html HTTP/1.1″ 200 6289 mod_gzip: DECHUNK:OK In:23352 Out:6289:74pct.

Apache

Logformat code list

%…a: Remote IP-address %…A: Local IP-address %…B: Bytes sent, excluding HTTP headers. %…b: Bytes sent, excluding HTTP headers. In CLF format i.e. a ‘-‘ rather than a 0 when no bytes are sent. %…c: Connection status when response was completed. ‘X’ = connection aborted before the response completed. ‘+’ = connection may be kept alive …