Chapter 9: Drupal configuration

 

The majority of the configuration of a Ding Drupal site is handled via the Features module. However some variables differ between the different environtments for the same library site. These variables are set in the settings.php file and are documented here. LIBRARY should be replaced with the programmatic name of the library the site represents e.g. helsbib for Elsinore libraries, kkb for Copenhagen libraries etc. ENV should be replaced with the name of the environment e.g. DEV, STG or PROD. 

$conf = array(
#  'cache_inc' => 
'./profiles/ding/modules/contrib/memcache/memcache.inc', //Uncomment this to use memcache for caching
#  'session_inc' => 
'./profiles/ding/modules/contrib/memcache/memcache-session.inc', //Uncomment this to use memcache for session storage
  'memcache_servers' => array('127.0.0.1:11211' => 'default'), // The address of the memcache server
  'memcache_bins' => array('cache' => 'default'), //We currently use a single bin
  'memcache_key_prefix' =>  'LIBRARY_ENV', //Use both library name and environment af cache prefixes in case memcache is used by multiple libraries and environments
  'environment_indicator_enabled' => TRUE, //Show an environment indicator to distinguish between environments
  'environment_indicator_color' => '#f0f', //Choose an appropritate color (GREEN = DEV, ORANGE = STG, RED = PROD)
  'environment_indicator_text' => 'ENV, //Show the environment name in the indicator
  'reverse_proxy' => TRUE, //Use a reverse proxy - usually Varnish
  'reverse_proxy_addresses' => array('127.0.0.1'), //The reverse proxy is usually running on the same host as the webser
  'syslog_facility' => LOG_LOCAL1, //Use syslog for logging to avoid uneeded pressure on the databas
  'cache'          => 1, //Use normal cache for anonymous users who bypass the reverse proxy server
  'cache_lifetime' => 300, //Cache pages for 5 minutes
  'block_cache'    => 1, //Use block cache for optimal performance
  'preprocess_css' => 1, //Preprocess CSS for optimal performance
  'preprocess_js'  => 1, //Preprocess Javascript for optimal performance
);

//Optimized 404 page for static files. This avoids bootstrapping Drupal to render a custom 404 page in situations where it is not shown to the user anyway
$fast_404_header = 'HTTP/1.0 404 Not Found';
$fast_404_body   = '404 Not FoundNot Found

The requested URL was not found on this server.

'; // List of extensions for static files $exts = 'txt|png|gif|jpe?g|shtml?|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp'; // It is not an imagecache path, which we allow to go through Drupal if (!strpos($_SERVER['QUERY_STRING'], 'imagecache')) { // Is it a static file? if (preg_match('/\.(' . $exts . ')$/', $_SERVER['QUERY_STRING'])) { // Just send a 404 right now ... header($fast_404_header); print($fast_404_body); exit(); } }
Grupper: