#-*- coding: utf-8 -*- #:Progetto: Gam -- Buildout di deploy #:Creato: lun 15 nov 2010 15:08:27 CET #:Autore: Lele Gaifax #:Licenza: GNU General Public License version 3 or later # [buildout] extends = buildout.cfg parts += supervisor nginx proxy.conf nginx.conf uwsgi pylgam zeoserver [versions] nginx = 0.8.53 uwsgi = 0.9.6.5 zc.recipe.egg = 1.3.2 [hosts] frontend = localhost supervisor = localhost pylgam = localhost plone4 = localhost [interfaces] frontend = 127.0.0.1 supervisor = 127.0.0.1 pylgam = 127.0.0.1 plone4 = 127.0.0.1 [ports] frontend = 8000 supervisor = 9001 pylgam = 8001 plone4 = 8002 zeo-server = 8100 pylgam-uwsgi = 5555 [supervisor] recipe = collective.recipe.supervisor port = ${ports:supervisor} user = admin password = admin serverurl = http://${hosts:supervisor}:${ports:supervisor} pylgam-uwsgi-args = --socket :${ports:pylgam-uwsgi} --disable-logging --master --no-orphans --wsgi-file ${buildout:parts-directory}/pylgam/wsgi --pidfile ${pathnames:var-directory}/pylgam-uwsgi.pid --home ${buildout:parts-directory}/pylgam programs = 10 uwsgi ${pathnames:bin-directory}/uwsgi [${:pylgam-uwsgi-args}] true 20 zeo ${pathnames:bin-directory}/zeoserver true 30 plone4 ${pathnames:bin-directory}/plone4 [console] true 40 frontend ${pathnames:bin-directory}/nginx true [nginx] recipe = hexagonit.recipe.cmmi url = http://sysoev.ru/nginx/nginx-${versions:nginx}.tar.gz configure-options = --conf-path=${pathnames:etc-directory}/nginx-frontend.conf --error-log-path=${pathnames:log-directory}/nginx-frontend.error.log --pid-path=${pathnames:var-directory}/nginx-frontend.pid --lock-path=${pathnames:var-directory}/nginx-frontend.lock --http-log-path=${pathnames:log-directory}/nginx-frontend.access.log --sbin-path=${pathnames:bin-directory} [proxy.conf] recipe = collective.recipe.template input = inline: proxy_set_header Host $host:${ports:frontend}; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 90; proxy_send_timeout 90; proxy_read_timeout 90; proxy_buffers 32 4k; output = ${pathnames:etc-directory}/proxy.conf [nginx.conf] recipe = collective.recipe.template input = inline: user www-data; daemon off; events { worker_connections 1024; use epoll; } http { gzip on; gzip_http_version 1.1; gzip_vary on; gzip_comp_level 6; gzip_proxied any; gzip_types text/plain text/css text/json application/json application/x-javascript application/xml application/xml+rss text/javascript; # Disable gzip for certain browsers. gzip_disable "MSIE [1-6].(?!.*SV1)"; include ${pathnames:etc-directory}/mime.types; include ${proxy.conf:output}; upstream plone4 { server ${hosts:plone4}:${ports:plone4}; } upstream pylgam { server ${hosts:pylgam}:${ports:pylgam}; } server { listen ${interfaces:frontend}:${ports:frontend} default; server_name ${hosts:frontend}; server_name_in_redirect on; root ${pathnames:pylgam-public-directory}; # Roba statica location ~* /(img|js|iepng|css|ico)/ { root ${pathnames:pylgam-public-directory}; expires max; add_header Cache-Control "public"; break; } # Documenti in Plone location ^~ /docs { access_log off; proxy_pass http://plone4; } # PylGAM location / { uwsgi_pass 0.0.0.0:${ports:pylgam-uwsgi}; include uwsgi_params; uwsgi_param SCRIPT_NAME ""; } } } output = ${pathnames:etc-directory}/nginx-frontend.conf [uwsgi] recipe = hexagonit.recipe.cmmi url = http://projects.unbit.it/downloads/uwsgi-${versions:uwsgi}.tar.gz configure-command = true pre-make-hook = ${buildout:directory}/deploy.py:uwsgi_add_install_rule [pylgam] recipe = collective.recipe.modwsgi eggs = ${pylons:eggs} PasteDeploy config-file = ${pylgam.ini:output} [zeoserver] recipe = plone.recipe.zeoserver zeo-address = ${ports:zeo-server} effective-user = www-data file-storage = ${pathnames:data-fs} blob-storage = ${pathnames:blobs} pack-user = admin pack-password = admin [plone4] zeo-client = true zeo-address = ${zeoserver:zeo-address} shared-blob = on