Category: Apache

Apache 1.3 and 2.x Tips and tricks

Apache

Apache Log format codes

Extracted from: http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#logformat Format String Description ============= ============================================================================================================ %% The percent sign %a Remote IP-address %A Local IP-address %B Size of response in bytes, excluding HTTP headers. %b Size of response in bytes, excluding HTTP headers. In CLF format, i.e. a ‘-‘ rather than a 0 when no bytes are sent. %{Foobar}C The contents of …

Apache

Apache mod_deflate controls

Ive been looking for a way to set the DEFLATE globally and then disable it individually as needed either in vhosts or in containers. There are two way to configure the DEFLATE: – INCLUDE-ALL-with-Exceptions : Compress all content except the exceptions defined – EXCLUDE-ALL-with-Exceptions : Compress none of the contents except the exceptions defined The …

Apache, Linux

IP List of China and Korea for IPTABLES

Just download: http://www.okean.com/antispam/iptables/rc.firewall.sinokorea This script that can be downloaded regularly needs to be converted before it can be used. In this list the destination ports is 25 (SMTP). For web access blocking, the port needs to be changed to 80,443,25,110,22,995 etc. . A small script can be used to get the list, convert it before …

Apache

Compile Apache 2 in Debian/Ubuntu/Mint/..

Introduction: Steps to compile Apache: – Installation of needed development packages – Prepare the directories needed – copy the config file and script below – Run the script below Installation of needed development packages Needed for Apache mod_deflate libzip-dev (sources) libzip1 (bin libs.) zlib1g-dev (sources) Needed for Mod_security libpcre3-dev libpcrecpp0 libxml2-dev Compiling script Configuration file …

Apache

Compiling a new standard Apache DSO module

# Build and install a distributed Apache module, say mod_foo.c, into its own DSO mod_foo.so: * Build and install via configure (preferred): $ ./configure –prefix=/path/to/install –enable-shared=foo $ make install * Build and install manually: – Edit src/Configuration: > SharedModule modules/xxxx/mod_foo.so $ make $ cp src/xxxx/mod_foo.so /path/to/install/libexec – Edit /path/to/install/etc/httpd.conf >> LoadModule foo_module /path/to/install/libexec/mod_foo.so # Build …

Apache

Mod_jk shared file size in Apache 1.3.x

It can occur that a new worker set prevents apache to start, although correct configured. Possible cause: Mod_JK shared file is too small Size must be at least: Header: 84 Bytes Per Worker: 400 Bytes Extra at the end: 800 Bytes Any type worker uses the same amount of memory(400 bytes): loadBalancers and hosts Configuration: …

Apache

MOD GZIP Configuration in Apache 1.3.x

NOTE: The size of the zipped content(not header) is about 1/3 of original size. mod_gzip_command_version ‘/mod_gzip_status’ mod_gzip_temp_dir /tmp/mod_gzip_httpd mod_gzip_keep_workfiles No mod_gzip_minimum_file_size 1000 mod_gzip_maximum_file_size 100000 mod_gzip_maximum_inmem_size 60000 mod_gzip_min_http 1000 mod_gzip_handle_methods GET mod_gzip_item_include file \.html$ mod_gzip_item_include file \.jsp$ mod_gzip_item_include file \.do$ mod_gzip_item_include mime text/html mod_gzip_item_include mime text/plain mod_gzip_item_include mime application/x-javascript mod_gzip_item_include mime text/css mod_gzip_item_include mime text/xml mod_gzip_item_include …

Apache

Problem with openssl and Compiling Apache 2.2.11

Ursache ist, dass die Pfade richtig gesetzt werden müssen, damit ld den Parameter -lssl kennt. export LD_LIBRARY_PATH=”/www/hans/src/openssl-0.9.8j/” export LIBS=”-L/www/hans/src/openssl-0.9.8j” export CPPFLAGS=”-I/www/hans/src/openssl-0.9.8j/include/openssl” echo $LD_LIBRARY_PATH /www/jamba/src/openssl-0.9.8j/:/usr/lib/ echo $LIBS -L/www/jamba/src/openssl-0.9.8j echo $CPPFLAGS -I/www/jamba/src/openssl-0.9.8j/include/openssl

Apache

Issues on MaxClients Directive

WARNING: MaxClients of 3000 exceeds compile time limit of 2048 servers, lowering MaxClients to 2048. To increase, please see the HARD_SERVER_LIMIT define in src/include/httpd.h. Why increase MaxClients to 2048? Apache 1.x is non-threaded, so increasing MaxClients beyond 256 usually results in lower performance; often dramatically lower performance. At a prior job I worked with a …

Apache

GZIP Log Format

LogFormat “\”%h\” \”%{HOST}i\” \”%u\” \”%t\” \”%r\” \”%>s\” \”%b\” \”%{Referer}i\” \”%{User-Agent}i\” \”%{Connection}i\” \”%{Connection}o\” \”%{Content-Type}o\” \”%T\” \”PID:%P\” \”%{mod_gzip_result}n\” \”%{mod_gzip_input_size}n\” \”%{mod_gzip_output_size}n\” \”%{mod_gzip_compression_ration}n\”” JAMBA_BASIS_LOGFORMAT_GZIP

Apache

Using mod_cband to limit bandwidth per vhost

mod_cband (http://cband.linux.pl) can do this from 0.9.6.0 version! You should use CBandExceededSpeed directive to slow down pages when the bandwidth is exceeded 🙂 See: http://www.howtoforge.com/mod_cband_apache2_bandwidth_quota_throttling http://www.icewalkers.com/Linux/Software/524590/mod_cband.html http://www.montanalinux.org/mod_cband.html http://www.uno-code.com/?q=node/64

Apache

MPM ‘worker’ configuration (Apache2)

Directive Description Default (worker.MPM) ===================== =============================================================================== ==================== ListenBackLog Maximum length of the queue of pending connections 511 . MaxClients Global maximum number of connections that will be processed simultaneously 400 MaxClients SHOULD NOT be lower than (ServerLimit) x (ThreadsPerChild). Normally they should be equal. . ServerLimit Upper limit on configurable number of processes (children) 16 …