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!

eZ debug

Timing: Feb 18 2025 11:42:48
Script start
Timing: Feb 18 2025 11:42:48
Module start 'content'
Timing: Feb 18 2025 11:42:48
Module end 'content'
Timing: Feb 18 2025 11:42:48
Script end

Main resources:

Total runtime0.1396 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0093 587.7188180.7891
Module start 'content' 0.00930.0079 768.5078106.6328
Module end 'content' 0.01730.1223 875.1406525.6875
Script end 0.1396  1,400.8281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00463.3152200.0002
Check MTime0.00211.5177200.0001
Mysql Total
Database connection0.00090.663210.0009
Mysqli_queries0.084560.50661410.0006
Looping result0.00110.77011390.0000
Template Total0.121987.310.1219
Template load0.00100.732010.0010
Template processing0.120986.553610.1209
Override
Cache load0.00080.555810.0008
Sytem overhead
Fetch class attribute can translate value0.00050.392410.0005
XML
Image XML parsing0.00020.146810.0002
General
dbfile0.00886.3351200.0004
String conversion0.00000.008030.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs