Installing Magento on Lighttpd 1.4.X via FastCGI

Last modified by PremierWeb on Thu, June 24, 2010 15:21
Source|Old Revisions  

This is an old revision of the document!

If you are familiar with Lighttpd, it does not support .htaccess, thus the out of the box magento installation won’t work. Never fear, however, for a few simple server configuration change makes it all better.

  1. $HTTP["host"] =~ "^(www.)?$" {
  2.     = ""
  3.         server.document-root  = "/var/www/"
  4.         server.error-handler-404 = "/index.php"
  5. }

Essentially, this forwards all non-existent urls in index.php for routing. Simple.

Next, install the htscanner PHP module and add it to your php.ini to properly override the PHP configuration parameters (memory_limit, max_execution_time, etc.) specified in Magento’s .htaccess files.

To fix the problem of list/grid view not working, add the following to the top of index.php

  1. if(empty($_GET) && FALSE !== strpos($_SERVER['REQUEST_URI'], '?'))
  2. {
  3.     $tmp = parse_url($_SERVER['REQUEST_URI']);
  4.     $_SERVER['QUERY_STRING'] = $tmp['query'];
  5.         unset($tmp);
  6.     parse_str($_SERVER['QUERY_STRING'], $_GET);
  7. }