Lambdacurry

Pressflow (or Drupal) on Ubuntu 10.04 and later .. with nginx, php-fpm and clean-urls


For god’s sake do not use PHP 5.3 . Custom compile your own php-fpm 5.2. Maybe setup nginx with clean URL and the configuration given .

If you use PHP5.3, then any failure in any db connection/query (for me it was postgresql) will result in the php thread being killed (”child process exited with status 1”). 5.2 doesnt have this problem.

server {

listen 8080; ## listen for ipv4 listen [::]:8080 default ipv6only=on; ## listen for ipv6

server_name localhost;

    root /var/www/1/;
    large\_client\_header\_buffers 4 8k;
    access\_log  /var/log/nginx/1.access.log urchin;

   ## Serve an empty 1x1 gif \_OR\_ an error 204 (No Content) for favicon.ico
  location ~\* ^.+\\.(ico) {
   #empty\_gif;
    return 204;
    expires max;
  }
  location ~\* ^.+\\.(jpg|jpeg|gif|css|png|js)(\\?\[0-9\]+)?$ {
    root /var/www/1/;
   access\_log off;
    expires max;
    }

    location / {
        #root   /var/www/1/;
        index  index.html index.php;
        add\_header Last-Modified "";
        if\_modified\_since off;
        error\_page 404 = @drupal;
    }

    location @drupal {
                      rewrite ^(.\*)$ /index.php?q=$1 last;
    }

    location ~ \\.php$ {
            #include /usr/local/nginx/conf/fastcgi\_params;
            include /etc/nginx/fastcgi\_params;
            fastcgi\_pass  localhost:9000;
            fastcgi\_index index.php;
            fastcgi\_read\_timeout 500m;
            fastcgi\_param  SCRIPT\_FILENAME  /var/www/1$fastcgi\_script\_name;

fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_intercept_errors on; } }


Lambdacurry

Pressflow (or Drupal) on Ubuntu 10.04 and later .. with nginx, php-fpm and clean-urls

Published

September 09, 2010

Find me on Twitter @sandeepssrin

Did i make any mistake? Please consider sending a pull request.