Modification : nginx root configurable.
authorJulien Moutinho <julm+heureux-cyclage@autogeree.net>
Thu, 22 Aug 2013 18:34:15 +0000 (20:34 +0200)
committerroot <root@ateliers.heureux-cyclage.org>
Thu, 22 Aug 2013 19:04:10 +0000 (21:04 +0200)
etc/agendav/config.php
etc/nginx/site.d/agendav/site.conf
etc/nginx/site.d/cyclocamp-www/site.conf
etc/nginx/site.d/lhc-remorque/ikiwiki.setup
etc/nginx/site.d/lhc-remorque/local.sh
etc/nginx/site.d/lhc-remorque/site.conf
etc/nginx/site.d/ptitvelo-www/site.conf
etc/nginx/site.d/roundcube/site.conf
etc/roundcube/main.inc.php
etc/sv/nginx/local.sh
local/www-init

index 232d708..262dcb4 100755 (executable)
@@ -1,7 +1,7 @@
 <?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
 <?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
-require_once('/home/www/pub/agendav/web/public/../application/config/production/advanced.php');
-require_once('/home/www/pub/agendav/web/public/../application/config/production/defaults.php');
+require_once('/home/www/data/agendav/web/public/../application/config/production/advanced.php');
+require_once('/home/www/data/agendav/web/public/../application/config/production/defaults.php');
 
 $http_host = $_SERVER['HTTP_HOST'];
 if (substr($http_host, 0, strlen("agendav.")) == "agendav.") {
 
 $http_host = $_SERVER['HTTP_HOST'];
 if (substr($http_host, 0, strlen("agendav.")) == "agendav.") {
@@ -50,13 +50,13 @@ $config['format_title_month'] = 'MMMM yyyy';
 $config['format_title_table'] = 'dddd, MMM d yyyy';
 $config['format_title_week'] = "MMM d[ yyyy]{ '&#8212;'[ MMM] d yyyy}";
 $config['log_path'] = '/home/www/log/php5/fpm/agendav/';
 $config['format_title_table'] = 'dddd, MMM d yyyy';
 $config['format_title_week'] = "MMM d[ yyyy]{ '&#8212;'[ MMM] d yyyy}";
 $config['log_path'] = '/home/www/log/php5/fpm/agendav/';
-if (file_exists("/home/www/pub/agendav/web/public/img/logo-$http_host.png")) {
+if (file_exists("/home/www/data/agendav/web/public/img/logo-$http_host.png")) {
        $config['logo'] = "logo-$http_host.png";
  }
 else {
        $config['logo'] = 'agendav_100transp.png';
  }
        $config['logo'] = "logo-$http_host.png";
  }
 else {
        $config['logo'] = 'agendav_100transp.png';
  }
-if (file_exists("/home/www/pub/agendav/web/public/img/logo-login-$http_host.png")) {
+if (file_exists("/home/www/data/agendav/web/public/img/logo-login-$http_host.png")) {
        $config['login_page_logo'] = "logo-login-$http_host.png";
  }
 else {
        $config['login_page_logo'] = "logo-login-$http_host.png";
  }
 else {
index 144ed9c..21f3e8f 100644 (file)
@@ -6,7 +6,7 @@ client_body_buffer_size 8k;
 client_max_body_size 10m;
 
 location / {
 client_max_body_size 10m;
 
 location / {
-       root /home/www/pub/agendav/web/public/;
+       root /home/www/data/agendav/web/public/;
        index index.html index.htm index.php;
  }
 location ~ /\. {
        index index.html index.htm index.php;
  }
 location ~ /\. {
@@ -15,7 +15,7 @@ location ~ /\. {
        log_not_found off;
  }
 location ~* ^.+\.php(|/.*)$ {
        log_not_found off;
  }
 location ~* ^.+\.php(|/.*)$ {
-       root /home/www/pub/agendav/web/public/;
+       root /home/www/data/agendav/web/public/;
        include /etc/nginx/conf.d/fastcgi.conf;
        set $no_cache "0";
        if ($request_method !~ ^(GET|HEAD)$) {
        include /etc/nginx/conf.d/fastcgi.conf;
        set $no_cache "0";
        if ($request_method !~ ^(GET|HEAD)$) {
@@ -50,7 +50,7 @@ location ~* ^.+\.php(|/.*)$ {
        fastcgi_pass unix:/run/php5/fpm/agendav;
  }
 location ~* ^.+.(css|gif|html|ico|jpeg|js|jpg|png|txt|xml)$ {
        fastcgi_pass unix:/run/php5/fpm/agendav;
  }
 location ~* ^.+.(css|gif|html|ico|jpeg|js|jpg|png|txt|xml)$ {
-       root /home/www/pub/agendav/web/public/;
+       root /home/www/data/agendav/web/public/;
        access_log off;
        expires 30d;
        log_not_found off;
        access_log off;
        expires 30d;
        log_not_found off;
index 3a9ce61..ce1b0fb 100644 (file)
@@ -18,7 +18,7 @@ location ~ /\. {
  }
 location ~ ^/julm/ {
        auth_basic "ni dieu, ni maitre, ni moteur";
  }
 location ~ ^/julm/ {
        auth_basic "ni dieu, ni maitre, ni moteur";
-       auth_basic_user_file /home/www/pub/cyclocamp-www/julm/.htpasswd;
+       auth_basic_user_file /home/www/data/cyclocamp-www/julm/.htpasswd;
  }
 
 # vim: ft=sh
  }
 
 # vim: ft=sh
index afab83b..771d644 100644 (file)
@@ -9,7 +9,7 @@ use IkiWiki::Setup::Standard {
         }],
        banned_users => [],
        srcdir => "/home/lhc/var/ikiwiki/remorque",
         }],
        banned_users => [],
        srcdir => "/home/lhc/var/ikiwiki/remorque",
-       destdir => "/home/www/pub/lhc-remorque",
+       destdir => "/home/www/data/lhc-remorque",
        #templatedir => "/home/lhc/var/ikiwiki/remorque/tmpl",
        templatedir => '/usr/share/ikiwiki/templates',
        underlaydir => '/usr/share/ikiwiki/basewiki',
        #templatedir => "/home/lhc/var/ikiwiki/remorque/tmpl",
        templatedir => '/usr/share/ikiwiki/templates',
        underlaydir => '/usr/share/ikiwiki/basewiki',
@@ -29,7 +29,7 @@ use IkiWiki::Setup::Standard {
        gitmaster_branch => "master",
        wrappers => [
                 { cgi => 1
        gitmaster_branch => "master",
        wrappers => [
                 { cgi => 1
-                , wrapper => "/home/www/pub/lhc-remorque/cgi/ikiwiki.cgi"
+                , wrapper => "/home/www/data/lhc-remorque/cgi/ikiwiki.cgi"
                 , wrappermode => "00750"
                 }
         , { post_commit => 1
                 , wrappermode => "00750"
                 }
         , { post_commit => 1
index 9ec7bdb..beebcd3 100644 (file)
@@ -13,14 +13,14 @@ sudo install -m 664 -o www -g www \
  --disabled-login \
  --disabled-password \
  --group \
  --disabled-login \
  --disabled-password \
  --group \
- --home /home/www/pub/"$site" \
+ --home /home/www/data/"$site" \
  --shell /bin/false \
  --system
 "$tool"/local/adduser www-"$site" \
  --disabled-login \
  --disabled-password \
  --group \
  --shell /bin/false \
  --system
 "$tool"/local/adduser www-"$site" \
  --disabled-login \
  --disabled-password \
  --group \
- --home /home/www/pub/"$site" \
+ --home /home/www/data/"$site" \
  --shell /bin/false \
  --system
 sudo adduser fcgi-"$site" www-"$site"
  --shell /bin/false \
  --system
 sudo adduser fcgi-"$site" www-"$site"
@@ -70,7 +70,7 @@ sudo install -m 400 -o wiki-"$site" -g wiki-"$site" \
  /home/lhc/var/ikiwiki/remorque/etc/ikiwiki.setup
 sudo adduser wiki-"$site" www-"$site"
 sudo install -d -m 2770 -o wiki-"$site" -g fcgi-"$site" \
  /home/lhc/var/ikiwiki/remorque/etc/ikiwiki.setup
 sudo adduser wiki-"$site" www-"$site"
 sudo install -d -m 2770 -o wiki-"$site" -g fcgi-"$site" \
- /home/www/pub/"$site"/cgi
+ /home/www/data/"$site"/cgi
 cd /
 sudo -u wiki-"$site" ikiwiki \
  --verbose \
 cd /
 sudo -u wiki-"$site" ikiwiki \
  --verbose \
index e8010a4..959b8cd 100644 (file)
@@ -3,7 +3,7 @@ server_name
  ra.heureux-cyclage.org;
 
 auth_basic "pour demander un compte: admin@heureux-cyclage.org";
  ra.heureux-cyclage.org;
 
 auth_basic "pour demander un compte: admin@heureux-cyclage.org";
-auth_basic_user_file /home/www/pub/lhc-remorque/.htpasswd;
+auth_basic_user_file /home/www/data/lhc-remorque/.htpasswd;
 client_body_buffer_size 8k;
 client_max_body_size 10m;
 
 client_body_buffer_size 8k;
 client_max_body_size 10m;
 
index 66c920d..45a7d8a 100644 (file)
@@ -1,7 +1,8 @@
-server_name 
+server_name
     ptitvelo.heureux-cyclage.org
     www.ptitvelo.net
     ptitvelo.net;
     ptitvelo.heureux-cyclage.org
     www.ptitvelo.net
     ptitvelo.net;
+root /home/www/data/ptitvelo-www/www;
 
 client_body_buffer_size 8k;
 client_max_body_size 10m;
 
 client_body_buffer_size 8k;
 client_max_body_size 10m;
index 670b105..c8fd7cb 100644 (file)
@@ -32,7 +32,7 @@ location ~ ^/(bin|SQL)/ {
        deny all;
  }
 location ~ ^/images/.+(png) {
        deny all;
  }
 location ~ ^/images/.+(png) {
-       root /home/www/pub/roundcube;
+       root /home/www/data/roundcube;
        access_log off;
        expires 30d;
        log_not_found off;
        access_log off;
        expires 30d;
        log_not_found off;
index f71f883..94a5edc 100644 (file)
@@ -215,7 +215,7 @@ $rcmail_config['auto_create_user'] = true;
 
 // replace Roundcube logo with this image
 // specify an URL relative to the document root of this Roundcube installation
 
 // replace Roundcube logo with this image
 // specify an URL relative to the document root of this Roundcube installation
-if (file_exists("/home/www/pub/roundcube/images/logo-$http_host.png")) {
+if (file_exists("/home/www/data/roundcube/images/logo-$http_host.png")) {
        $rcmail_config['skin_logo'] = "./images/logo-$http_host.png";
  }
 else {
        $rcmail_config['skin_logo'] = "./images/logo-$http_host.png";
  }
 else {
index 0b014f7..e7331d4 100644 (file)
@@ -37,7 +37,7 @@ for site in $(find "$tool"/etc/nginx/site.d \
         --disabled-login \
         --disabled-password \
         --group \
         --disabled-login \
         --disabled-password \
         --group \
-        --home /home/www/pub/"$site" \
+        --home /home/www/data/"$site" \
         --shell /bin/false \
         --system
        "$tool"/local/adduser log-www-"$site" \
         --shell /bin/false \
         --system
        "$tool"/local/adduser log-www-"$site" \
@@ -53,9 +53,9 @@ for site in $(find "$tool"/etc/nginx/site.d \
         /etc/nginx/site.d/"$site"
        sudo install -d -m 770 -o www -g www \
         /etc/nginx/x509.d/"$site"
         /etc/nginx/site.d/"$site"
        sudo install -d -m 770 -o www -g www \
         /etc/nginx/x509.d/"$site"
-       sudo test -L /home/www/pub/"$site" ||
+       sudo test -L /home/www/data/"$site" ||
        sudo install -d -m 2770 -o www-"$site" -g www-"$site" \
        sudo install -d -m 2770 -o www-"$site" -g www-"$site" \
-        /home/www/pub/"$site"
+        /home/www/data/"$site"
        sudo adduser www-data www-"$site"
        sudo adduser www-data log-www-"$site"
        sudo install -m 660 -o www -g www \
        sudo adduser www-data www-"$site"
        sudo adduser www-data log-www-"$site"
        sudo install -m 660 -o www -g www \
@@ -80,7 +80,9 @@ for site in $(find "$tool"/etc/nginx/site.d \
                server {
                        access_log /home/www/log/$site/nginx/access.log main;
                        error_log  /home/www/log/$site/nginx/error.log warn;
                server {
                        access_log /home/www/log/$site/nginx/access.log main;
                        error_log  /home/www/log/$site/nginx/error.log warn;
-                       root       /home/www/pub/$site;
+                       $(if ! grep -q '^root\>' "$tool"/etc/nginx/site.d/"$site"/site.conf
+                               then printf 'root %s;' /home/www/data/"$site"
+                               fi)
                        include    /etc/nginx/site.d/$site/local.conf;
                        include    /etc/nginx/site.d/$site/site.conf;
                 }
                        include    /etc/nginx/site.d/$site/local.conf;
                        include    /etc/nginx/site.d/$site/site.conf;
                 }
index 1c3d8d3..5dc05b2 100755 (executable)
@@ -20,12 +20,12 @@ tool=$(readlink -e "${0%/*}/..")
 #sudo adduser www www-data
 sudo adduser www log-www
 #sudo adduser log log-www
 #sudo adduser www www-data
 sudo adduser www log-www
 #sudo adduser log log-www
-usermod --home /home/www/pub www-data
+usermod --home /home/www/data www-data
 sudo install -d -m 751 -o www -g www \
  /home/www
 sudo install -d -m 750 -o www -g www \
  /home/www/etc
 sudo install -d -m 1771 -o www-data -g www-data \
 sudo install -d -m 751 -o www -g www \
  /home/www
 sudo install -d -m 750 -o www -g www \
  /home/www/etc
 sudo install -d -m 1771 -o www-data -g www-data \
- /home/www/pub
+ /home/www/data
 sudo install -d -m 1771 -o log-www -g log-www \
  /home/www/log
 sudo install -d -m 1771 -o log-www -g log-www \
  /home/www/log