wiki:sysadminApacheConfiguration

Apache server configuration

Static vs. dynamic content

Right now, our Apache servers are serving up all of the static content (images, javascript, etc) as well as OpenSRF dynamic content. By default, those Apache processes serve up 1000 requests, then get killed off and respawned (to avoid memory leaks).

Eventually, I would be interested in moving in a direction like using nginx to proxy static content.

Avoiding too-long caching of changed files

We were seeing that some browsers were retaining cached versions of files for a long time, even though we had changed the JavaScript to, say, group formats and editions (or not). The default caching period for most content was one week. So one pertinent change to the default configuration for expiring content in /etc/apache/sites-available/eg.conf that Dan made on 2009-06-12 was as follows:

# ----------------------------------------------------------------------------------
# OPTIONAL: Set how long the client will cache our content.  Change to suit
# ----------------------------------------------------------------------------------
ExpiresActive On
# The defaults
#ExpiresDefault A2592000
#ExpiresByType text/html A64800
#ExpiresByType application/xhtml+xml A64800
#ExpiresByType application/x-javascript A64800
#ExpiresByType text/css A3000

# From one month to 1 week
ExpiresDefault "access plus 1 week"
# From one week to 1 day, staggering a bit to avoid reloading everything in one fell swoop
ExpiresByType text/html "access plus 25 hours"
ExpiresByType application/xhtml+xml "access plus 25 hours"
ExpiresByType application/x-javascript "access plus 24 hours"
ExpiresByType text/css "access plus 23 hours"
Last modified 11 years ago Last modified on Jun 12, 2009, 9:32:50 AM