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: Jan 17 2025 17:58:11
Script start
Timing: Jan 17 2025 17:58:11
Module start 'content'
Timing: Jan 17 2025 17:58:11
Module end 'content'
Timing: Jan 17 2025 17:58:11
Script end

Main resources:

Total runtime0.3241 sec
Peak memory usage4,096.0000 KB
Database Queries217

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 596.4297180.7891
Module start 'content' 0.00700.1643 777.2188871.8594
Module end 'content' 0.17130.1527 1,649.0781344.7266
Script end 0.3239  1,993.8047 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00361.1117210.0002
Check MTime0.00140.4313210.0001
Mysql Total
Database connection0.00090.281710.0009
Mysqli_queries0.225569.58722170.0010
Looping result0.00190.57642150.0000
Template Total0.294891.020.1474
Template load0.00180.541020.0009
Template processing0.293190.441020.1465
Template load and register function0.00010.035810.0001
states
state_id_array0.00110.353720.0006
state_identifier_array0.00090.265430.0003
Override
Cache load0.00150.4708450.0000
Sytem overhead
Fetch class attribute name0.00190.5906100.0002
Fetch class attribute can translate value0.00100.323150.0002
class_abstraction
Instantiating content class attribute0.00000.0065110.0000
XML
Image XML parsing0.00511.571150.0010
General
dbfile0.01003.0782480.0002
String conversion0.00000.001530.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
1node/view/full.tplforum_topic/full.tplextension/community_design/design/suncana/override/templates/forum_topic/full.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1content/datatype/view/ezxmltags/separator.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltags/separator.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 27
 Number of unique templates used: 9

Time used to render debug report: 0.0002 secs