Ajout : etc/nginx/org/heureux-cyclage/clavette-lyon
authorLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Wed, 15 Apr 2015 07:53:56 +0000 (09:53 +0200)
committerLudovic CHEVALIER <ludovic.chevalier@heureux-cyclage.org>
Wed, 15 Apr 2015 07:53:56 +0000 (09:53 +0200)
srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/... [new symlink]
srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/common.conf.m4 [new file with mode: 0644]
srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/install [new file with mode: 0755]
srv/ateliers/etc/nginx/org/heureux-cyclage/clavette-lyon/server.conf.m4 [new file with mode: 0644]
srv/ateliers/sys/nginx/org/heureux-cyclage/clavette-lyon/... [new symlink]
srv/ateliers/sys/nginx/org/heureux-cyclage/clavette-lyon/home [new file with mode: 0644]
srv/ateliers/sys/nginx/org/heureux-cyclage/clavette-lyon/user [new file with mode: 0644]
srv/ateliers/sys/php5/fpm/org/heureux-cyclage/clavette-lyon/... [new symlink]
srv/ateliers/sys/php5/fpm/org/heureux-cyclage/clavette-lyon/pool [new file with mode: 0644]

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 (symlink)
index 0000000..951b30d
--- /dev/null
@@ -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 (file)
index 0000000..350bb67
--- /dev/null
@@ -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 (executable)
index 0000000..10c48da
--- /dev/null
@@ -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 (file)
index 0000000..7c40ed8
--- /dev/null
@@ -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 (symlink)
index 0000000..951b30d
--- /dev/null
@@ -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 (file)
index 0000000..934d84a
--- /dev/null
@@ -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 (file)
index 0000000..dd443d2
--- /dev/null
@@ -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 (symlink)
index 0000000..951b30d
--- /dev/null
@@ -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 (file)
index 0000000..24b2e2b
--- /dev/null
@@ -0,0 +1 @@
+php_lhc_clav_lyon
\ No newline at end of file