From 08657aab7c6736038d9b3256f7d2e31c214beef5 Mon Sep 17 00:00:00 2001 From: Ludovic CHEVALIER Date: Wed, 15 Apr 2015 09:53:56 +0200 Subject: [PATCH] =?utf8?q?Ajout=C2=A0:=20etc/nginx/org/heureux-cyclage/cla?= =?utf8?q?vette-lyon?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../org/heureux-cyclage/clavette-lyon/... | 1 + .../clavette-lyon/common.conf.m4 | 28 ++++++++++++++++++ .../org/heureux-cyclage/clavette-lyon/install | 29 +++++++++++++++++++ .../clavette-lyon/server.conf.m4 | 17 +++++++++++ .../org/heureux-cyclage/clavette-lyon/... | 1 + .../org/heureux-cyclage/clavette-lyon/home | 1 + .../org/heureux-cyclage/clavette-lyon/user | 1 + .../fpm/org/heureux-cyclage/clavette-lyon/... | 1 + .../org/heureux-cyclage/clavette-lyon/pool | 1 + 9 files changed, 80 insertions(+) create mode 120000 srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/... create mode 100644 srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/common.conf.m4 create mode 100755 srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/install create mode 100644 srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/server.conf.m4 create mode 120000 srv/ateliers/sys/nginx/org/heureux-cyclage/clavette-lyon/... create mode 100644 srv/ateliers/sys/nginx/org/heureux-cyclage/clavette-lyon/home create mode 100644 srv/ateliers/sys/nginx/org/heureux-cyclage/clavette-lyon/user create mode 120000 srv/ateliers/sys/php5/fpm/org/heureux-cyclage/clavette-lyon/... create mode 100644 srv/ateliers/sys/php5/fpm/org/heureux-cyclage/clavette-lyon/pool diff --git a/srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/... b/srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/... new file mode 120000 index 0000000..951b30d --- /dev/null +++ b/srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/... @@ -0,0 +1 @@ +../... \ No newline at end of file diff --git a/srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/common.conf.m4 b/srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/common.conf.m4 new file mode 100644 index 0000000..350bb67 --- /dev/null +++ b/srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/common.conf.m4 @@ -0,0 +1,28 @@ +server_name + clavette-lyon.heureux-cyclage.org; +root /home/www/data/org/heureux-cyclage/clavette-lyon/www/; +index index.php; + +client_body_buffer_size 8k; +client_max_body_size 10m; + +location ~^/(tmp|config)/{ + return 403; +} +location ~ \.html$ { + log_not_found off; +} +location ~ \.php$ { + include /etc/nginx/conf.d/fastcgi.conf; + fastcgi_index index.php ; + fastcgi_param REDIRECT_STATUS 200; + fastcgi_split_path_info ^(.+\.php)(/.+)$; + + fastcgi_pass unix:/run/php5/fpm/lhc_clav_lyon; +} +error_page 404 = @spip; + +location @spip { + rewrite ^/(.*)(\.html)?$ /spip.php?url_propre=$1&$args last; +} +# vim: ft=sh diff --git a/srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/install b/srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/install new file mode 100755 index 0000000..10c48da --- /dev/null +++ b/srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/install @@ -0,0 +1,29 @@ +#!/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/clavette-lyon/install +# ACTION: install from ./etc/nginx/org/heureux-cyclage/clavette-lyon + 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/clavette-lyon/pool) + user=$("$tool"/cat sys/nginx/org/heureux-cyclage/clavette-lyon/user) + home=$("$tool"/cat sys/nginx/org/heureux-cyclage/clavette-lyon/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/clavette-lyon diff --git a/srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/server.conf.m4 b/srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/server.conf.m4 new file mode 100644 index 0000000..7c40ed8 --- /dev/null +++ b/srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/server.conf.m4 @@ -0,0 +1,17 @@ +define(`DOMAIN',`org/heureux-cyclage/clavette-lyon')dnl +define(`SITE',`DOMAIN/www')dnl +server { + listen 80; + include /etc/nginx/SITE/common.conf; + access_log /home/www/log/SITE/access.log main; + error_log /home/www/log/SITE/error.log warn; + } +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; +} diff --git a/srv/ateliers/sys/nginx/org/heureux-cyclage/clavette-lyon/... b/srv/ateliers/sys/nginx/org/heureux-cyclage/clavette-lyon/... new file mode 120000 index 0000000..951b30d --- /dev/null +++ b/srv/ateliers/sys/nginx/org/heureux-cyclage/clavette-lyon/... @@ -0,0 +1 @@ +../... \ No newline at end of file diff --git a/srv/ateliers/sys/nginx/org/heureux-cyclage/clavette-lyon/home b/srv/ateliers/sys/nginx/org/heureux-cyclage/clavette-lyon/home new file mode 100644 index 0000000..934d84a --- /dev/null +++ b/srv/ateliers/sys/nginx/org/heureux-cyclage/clavette-lyon/home @@ -0,0 +1 @@ +/home/www/data/org/heureux-cyclage/clavette-lyon \ No newline at end of file diff --git a/srv/ateliers/sys/nginx/org/heureux-cyclage/clavette-lyon/user b/srv/ateliers/sys/nginx/org/heureux-cyclage/clavette-lyon/user new file mode 100644 index 0000000..dd443d2 --- /dev/null +++ b/srv/ateliers/sys/nginx/org/heureux-cyclage/clavette-lyon/user @@ -0,0 +1 @@ +www-lhc-clav-lyon \ No newline at end of file diff --git a/srv/ateliers/sys/php5/fpm/org/heureux-cyclage/clavette-lyon/... b/srv/ateliers/sys/php5/fpm/org/heureux-cyclage/clavette-lyon/... new file mode 120000 index 0000000..951b30d --- /dev/null +++ b/srv/ateliers/sys/php5/fpm/org/heureux-cyclage/clavette-lyon/... @@ -0,0 +1 @@ +../... \ No newline at end of file diff --git a/srv/ateliers/sys/php5/fpm/org/heureux-cyclage/clavette-lyon/pool b/srv/ateliers/sys/php5/fpm/org/heureux-cyclage/clavette-lyon/pool new file mode 100644 index 0000000..24b2e2b --- /dev/null +++ b/srv/ateliers/sys/php5/fpm/org/heureux-cyclage/clavette-lyon/pool @@ -0,0 +1 @@ +php_lhc_clav_lyon \ No newline at end of file -- 2.20.1