Forums / Discussions / eZ Publish 4.2011 Community (4.5) with Nginx and PHP-FPM on Debian 6 (“Squeeze”)

Friday 06 May 2011 9:45:56 am - 5 replies

» Read full tutorial

Introduction

After completing this tutorial, you should have a working eZ Publish 4.2011 Community (or 4.5) installation running on a single Debian 6 server with the following features:

  • Nginx 1.0.0+ as web server
  • PHP 5.3.6+ invoked through PHP-FPM (FastCGI Process Manager)
  • APC (Alternative PHP Cache)
  • Rewrites for friendly URLs (virtual host mode)
  • Proper http cache headers for static files
  • Gzip compression
 
Author Message

Quoc Huy Nguyen Dinh

Monday 09 May 2011 3:24:36 am

Great tutorial! Well done and thanks for sharing to the community.

I've been using Nginx for some times now but as a proxying server. I've basically configure it to proxy cache all binary files and optionally forward the requests to dynamic content to another server running with Apache. Then using a modified all2evcc extension I can clear the cache on publishing by calling the purge URL handled by NGX Cache Purge plugin.

Gaetano Giunta

Monday 09 May 2011 3:58:58 am

For purging cache of reverse proxies upon content publishing, ezflow and ezworkflowcollection extensions can do it too (only drawback: only for current node url, no smart view cache mgmt)

Principal Consultant International Business
Member of the Community Project Board

Daniel A. Øien

Saturday 04 June 2011 5:08:22 am

Update: with the recent Dotdeb packages, the tutorial should work exactly the same on a Debian 5 "Lenny" server, with the following exception:

in /etc/apt/sources.list, add

deb http://packages.dotdeb.org oldstable all
deb-src http://packages.dotdeb.org oldstable all

instead of 

deb http://packages.dotdeb.org stable all
deb-src http://packages.dotdeb.org stable all

Daniel A. Øien
Open Concept SA, Norway
Web: http://openconcept.no/
In English: http://openconcept.no/eng

Sander van den Akker

Saturday 11 June 2011 2:03:43 pm

Thanks for sharing this! I'm seriously considering ditching Apache from my development environment and replacing it with Nginx.

I still have one small problem. Your set of rewrite rules works like a charm but index.php is still in the url string. This used to work in Apache (even with the rewrite rules in .htaccess, although I needed the ForceVirtualHost=true ini setting).

Anyone got a solution to this?

Edit: I had a misconfiguration in the MatchOrder. Don't know how this reflected on the above problem, but solved!

eZ Publish certified developer
http://auth.ez.no/certification/verify/392313

Daniel A. Øien

Friday 19 August 2011 1:32:00 am

Another detail that you might find useful: to control upload filesizes, there are three settings that you need to configure, one of which is particular to Nginx.

In the server block of your nginx sites (usually in /etc/nginx/sites-available/mysite, or in /etc/nginx/nginx.conf if you're not using sites)  you need to add (examples using 50 MB):

client_max_body_size 51m;   

Where XX is the desired maximum post size. This needs to be slightly higher than upload_max_filesize (see below).

You should also set in php.ini (/etc/php5/fpm/php.ini):

upload_max_filesize = 50M

post_max_size = 51M

The last one needs to be higher than upload_max_filesize as it takes into account other POST data in addition to the actual file.

Daniel A. Øien
Open Concept SA, Norway
Web: http://openconcept.no/
In English: http://openconcept.no/eng

You must be logged in to post messages in this topic!