--- /dev/null
+../...
\ No newline at end of file
--- /dev/null
+server_name
+ questionnaires.heureux-cyclage.org
+ formations.heureux-cyclage.org
+ rencontres.heureux-cyclage.org;
+root /home/www/data/org/heureux-cyclage/questionnaires;
+
+
+client_body_buffer_size 8k;
+client_max_body_size 10m;
+location / {
+ if ($host = "formations.heureux-cyclage.org") {
+ return 302 "$scheme://questionnaires.heureux-cyclage.org/index.php?r=survey/index&sid=367568";
+ }
+ if ($host = "rencontres.heureux-cyclage.org") {
+ return 302 "$scheme://questionnaires.heureux-cyclage.org/index.php?r=survey/index&sid=462499";
+ }
+ index index.html index.htm index.php;
+ }
+location ~* ^.+\.(css|gif|html|ico|jpeg|js|jpg|png|txt|xml)$ {
+ access_log off;
+ expires 30d;
+ log_not_found off;
+ }
+location ~ /\. {
+ access_log off;
+ deny all;
+ log_not_found off;
+ }
+location ~ \.php$ {
+ include /etc/nginx/conf.d/fastcgi.conf;
+ set $no_cache "0";
+ if ($request_method !~ ^(GET|HEAD)$) {
+ # NOTE: if non GET/HEAD, don't cache and mark user as uncacheable for 1 second via cookie.
+ set $no_cache "1";
+ }
+ if ($no_cache = "1") {
+ # NOTE: drop no cache cookie if need be (for some reason, add_header fails if included in prior if-block).
+ add_header Set-Cookie "_mcnc=1; Max-Age=2; Path=/";
+ add_header X-Microcachable "0";
+ }
+ if ($http_cookie ~* "_mcnc") {
+ # NOTE: bypass cache if no-cache cookie is set
+ set $no_cache "1";
+ }
+ fastcgi_cache_bypass $no_cache;
+ fastcgi_cache_use_stale updating;
+ fastcgi_cache_valid 200 10s;
+ fastcgi_cache_valid 404 10m;
+ fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
+ fastcgi_index index.php;
+ fastcgi_no_cache $no_cache;
+ fastcgi_param REDIRECT_STATUS 200;
+ # NOTE: PHP only, required if PHP was built with --enable-force-cgi-redirect
+ fastcgi_pass_header Cookie;
+ fastcgi_pass_header Set-Cookie;
+ fastcgi_split_path_info ^(.+\.php)(/.+)$;
+
+ fastcgi_pass unix:/run/php5/fpm/lhc_quest;
+ }
+
+# vim: ft=sh
--- /dev/null
+#!/bin/sh -eu
+# SYNTAX: $path
+# DESCRIPTION: install
+
+# ACTION: initialize from .../lib/tool/admin/
+ tool=$(readlink -e "${0%/install}"/...)/lib/tool/admin
+ . "$tool"/lib/install.sh
+# ACTION: initialize $sv from ./sys/$sv/
+ sv=${cmd##*/etc/}
+ sv=${sv%%/*}
+# ACTION: initialize $site from ./etc/$sv/$site/install
+ site=${cmd##*/"$sv"/}
+ site=${site%/install}
+# ACTION: install from ./etc/nginx/\$site/install
+ "$tool"/etc/nginx/\$site/install "$site"
+# TODO: invoke php install script /etc/php5/fpm/org/heureux-cyclage/questionnaires/install
+# ACTION: install from ./etc/nginx/org/heureux-cyclage/questionnaires
+ nginx_log_home=$("$tool"/cat sys/nginx/log/home)
+ nginx_log_user=$("$tool"/cat sys/nginx/log/user)
+ pool=$("$tool"/cat sys/php5/fpm/org/heureux-cyclage/questionnaires/user)
+ user=$("$tool"/cat sys/nginx/org/heureux-cyclage/questionnaires/user)
+ home=$("$tool"/cat sys/nginx/org/heureux-cyclage/questionnaires/home)
+ "$tool"/ssh-sudo \
+ install -D -d -m 2750 -o "$nginx_log_user" -g "$nginx_log_user" \
+ "$nginx_log_home"/"$site"/tls
+ "$tool"/ssh-sudo adduser "$pool" "$user"
+ "$tool"/etc/mysql/user/install "$pool"
+ "$tool"/etc/mysql/database/install "$pool"
+ "$tool"/install etc/nginx/org/heureux-cyclage/questionnaires
--- /dev/null
+define(`DOMAIN',`org/heureux-cyclage')dnl
+define(`SITE',`DOMAIN/questionnaires')dnl
+server {
+ listen 443;
+ include /etc/nginx/SITE/common.conf;
+ include /etc/nginx/conf.d/ssl-pfs.conf;
+ ssl_certificate /etc/nginx/DOMAIN/crt.pem;
+ ssl_certificate_key /etc/nginx/DOMAIN/key.pem;
+ access_log /home/www/log/SITE/tls/access.log main;
+ error_log /home/www/log/SITE/tls/error.log warn;
+}
+server {
+ listen 80;
+ server_name
+ questionnaires.heureux-cyclage.org;
+
+ return 301 https://$host$request_uri;
+ }
--- /dev/null
+../...
\ No newline at end of file
--- /dev/null
+.../lib/tool/admin/etc/php5/fpm/$pool/install
\ No newline at end of file
--- /dev/null
+define(`POOL',patsubst(__file__,`^.*/fpm/\(.*\)/[^/]*$',`\1'))dnl
+[POOL]
+access.log = CAT(sys/php5/fpm/POOL/log/home)/access.log
+catch_workers_output = no
+chdir = /
+env[HOSTNAME] = $HOSTNAME
+env[TEMP] = /tmp
+env[TMPDIR] = /tmp
+env[TMP] = /tmp
+group = CAT(sys/php5/fpm/POOL/user)
+#listen = 127.0.0.1:9000
+#listen.allowed_clients = 127.0.0.1
+#listen.owner = www-data
+listen = CAT(sys/php5/fpm/POOL/socket)
+listen.backlog = -1
+listen.group = CAT(sys/nginx/user)
+listen.mode = 0660
+php_admin_value[extension] = pdo_mysql.so
+php_value[allow_url_fopen] = On
+ping.path = /ping
+pm = dynamic
+pm.max_children = 15
+pm.max_requests = 200
+pm.max_spare_servers = 5
+pm.min_spare_servers = 1
+pm.process_idle_timeout = 60s
+pm.start_servers = 1
+pm.status_path = /status
+request_slowlog_timeout = 5s
+request_slowlog_timeout = 5s
+request_terminate_timeout = 120s
+request_terminate_timeout = 120s
+rlimit_core = unlimited
+rlimit_core = unlimited
+rlimit_files = 131072
+rlimit_files = 131072
+security.limit_extensions = .php
+slowlog = CAT(sys/php5/fpm/POOL/log/home)/slow.log
+user = CAT(sys/php5/fpm/POOL/user)
--- /dev/null
+../...
\ No newline at end of file
--- /dev/null
+/home/www/data/org/heureux-cyclage/questionnaires
\ No newline at end of file
--- /dev/null
+www-lhc-questionnaires
\ No newline at end of file
--- /dev/null
+../...
\ No newline at end of file
--- /dev/null
+/etc/php5/fpm/org/heureux-cyclage/questionnaires
\ No newline at end of file
--- /dev/null
+../...
\ No newline at end of file
--- /dev/null
+/home/www/log/php5/fpm/org/heureux-cyclage/questionnaires
\ No newline at end of file
--- /dev/null
+/run/php5/fpm/lhc_quest
\ No newline at end of file
--- /dev/null
+php_lhc_quest
\ No newline at end of file