# HG changeset patch # User Pascal Bellard # Date 1290072109 -3600 # Node ID bea570b9faaabd5a5346295621d016c62dcc3762 # Parent a6137e640e0141e1fc1ed4a42c36070056f6184c mirror-tools: add /etc/lighttpd/vhosts.conf diff -r a6137e640e01 -r bea570b9faaa mirror-tools/stuff/etc/lighttpd/vhosts.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mirror-tools/stuff/etc/lighttpd/vhosts.conf Thu Nov 18 10:21:49 2010 +0100 @@ -0,0 +1,171 @@ +# /etc/lighttpd/vhosts.conf : Virtual hosts configuration file. +# + +# Example.org +# +#$HTTP["host"] =~ "(^|\.)example\.org$" { + #server.document-root = "/var/www/vhost/exemple.com/html" + #server.errorlog = "/var/log/lighttpd/example.org-error.log" + #accesslog.filename = "/var/log/lighttpd/example.org-access.log" +#} + +# mirror.slitaz.org (Server canonical hostname) +# +$HTTP["host"] =~ "^mirror\.slitaz\.org$" { + server.document-root = "/var/www/slitaz/mirror" + server.errorlog = "/var/log/lighttpd/mirror.slitaz.org-error.log" + accesslog.filename = "/var/log/lighttpd/mirror.slitaz.org-access.log" + + include "awstats.conf" + + alias.url += ( "/info" => "/var/www/mirror-info/" ) + + alias.url += ( "/pizza" => "/var/www/pizza/" ) + + alias.url += ( "/doc" => "/var/www/doc/" ) + var.dokudir = "/doc" + # Rewrites for dokuwiki + url.rewrite = ( + "^" + var.dokudir + "/lib/.*$" => "$0", + "^" + var.dokudir + "/_media/(.*)?\?(.*)$" => var.dokudir + "/lib/exe/fetch.php?media=$1&$2", + "^" + var.dokudir + "/_media/(.*)$" => var.dokudir + "/lib/exe/fetch.php?media=$1", + "^" + var.dokudir + "/_detail/(.*)?\?(.*)$" => var.dokudir + "/lib/exe/detail.php?media=$1&$2", + "^" + var.dokudir + "/_detail/(.*)?$" => var.dokudir + "/lib/exe/detail.php?media=$1", + "^" + var.dokudir + "/_export/([^/]+)/(.*)\?(.*)$" => var.dokudir + "/doku.php?do=export_$1&id=$2&$3", + "^" + var.dokudir + "/_export/([^/]+)/(.*)" => var.dokudir + "/doku.php?do=export_$1&id=$2", + "^" + var.dokudir + "/doku.php.*" => "$0", + "^" + var.dokudir + "/feed.php.*" => "$0", + "^" + var.dokudir + "/(.*)\?(.*)" => var.dokudir + "/doku.php?id=$1&$2", + "^" + var.dokudir + "/(.*)" => var.dokudir + "/doku.php?id=$1" + ) + + alias.url += ( "/webboot" => "/var/www/boot/" ) + + alias.url += ( "/pkgs" => "/var/www/pkgs/" ) + index-file.names += ( "search.sh" ) + cgi.assign += ( + ".sh" => "/bin/sh" + ) + + alias.url += ( "/hg" => "/var/www/hg/" ) +### url.rewrite-once = ( "/hg(.*)" => "/hg/hgwebdir.py$1" ) + index-file.names += ( "hgwebdir.py" ) + cgi.assign += ( + ".py" => "/usr/bin/python" + ) + + alias.url += ( "/www" => "/home/slitaz/website" ) + +# alias.url += ( "/tiny" => "/var/www/pizza/tiny/demos/192.168.0.6/var/www" ) +# index-file.names += ( "index.sh" ) + + index-file.names += ( "index.html" ) + index-file.names += ( "index.php" ) + # Last but not least... + index-file.names += ( "/dir-generator.php" ) +} + +## info.mirror.slitaz.org +## +#$HTTP["host"] =~ "^info\.mirror\.slitaz\.org$" { +# server.document-root = "/var/www/mirror-info/" +# server.errorlog = "/var/log/lighttpd/info.mirror.slitaz.org-error.log" +# accesslog.filename = "/var/log/lighttpd/info.mirror.slitaz.org-access.log" +# include "awstats.conf" +#} + +$HTTP["host"] =~ "ajaxterm\.slitaz\.org$" { + proxy.server = ( "/" => + ( ( "host" => "127.0.0.1", "port" => 8022 ) ) + ) +} + +# pizza.slitaz.org (Server canonical hostname) +# +$HTTP["host"] =~ "^pizza\.slitaz\.org$" { + server.document-root = "/var/www/pizza" + server.errorlog = "/var/log/lighttpd/pizza.slitaz.org-error.log" + accesslog.filename = "/var/log/lighttpd/pizza.slitaz.org-access.log" + include "awstats.conf" + index-file.names += ( "index.php" ) +} + +# slitaz.org +# +#$HTTP["host"] =~ "(^|www\.)slitaz\.org$" { +$HTTP["host"] =~ "www\.slitaz\.org$" { + server.document-root = "/home/slitaz/website" + server.errorlog = "/var/log/lighttpd/slitaz.org-error.log" + accesslog.filename = "/var/log/lighttpd/slitaz.org-access.log" + include "awstats.conf" + +### index-file.names = ( "index.html" ) + index-file.names += ( "start.html" ) + + +### url.rewrite-once = ( +### "^/about" => "/fr/about", +### "^/artwork" => "/fr/artwork", +### "^/devel" => "/fr/devel", +### "^/doc" => "/fr/doc", +### "^/get" => "/fr/get", +### "^/packages" => "/fr/packages" +### ) + +} + +# doc.slitaz.org +# +$HTTP["host"] =~ "doc\.slitaz\.org$" { + server.document-root = "/var/www/doc" + server.errorlog = "/var/log/lighttpd/doc.slitaz.org-error.log" + accesslog.filename = "/var/log/lighttpd/doc.slitaz.org-access.log" + index-file.names = ("doku.php") + var.dokudir = "" + # Rewrites for dokuwiki + url.rewrite = ( + "^" + var.dokudir + "/lib/.*$" => "$0", + "^" + var.dokudir + "/_media/(.*)?\?(.*)$" => var.dokudir + "/lib/exe/fetch.php?media=$1&$2", + "^" + var.dokudir + "/_media/(.*)$" => var.dokudir + "/lib/exe/fetch.php?media=$1", + "^" + var.dokudir + "/_detail/(.*)?\?(.*)$" => var.dokudir + "/lib/exe/detail.php?media=$1&$2", + "^" + var.dokudir + "/_detail/(.*)?$" => var.dokudir + "/lib/exe/detail.php?media=$1", + "^" + var.dokudir + "/_export/([^/]+)/(.*)\?(.*)$" => var.dokudir + "/doku.php?do=export_$1&id=$2&$3", + "^" + var.dokudir + "/_export/([^/]+)/(.*)" => var.dokudir + "/doku.php?do=export_$1&id=$2", + "^" + var.dokudir + "/doku.php.*" => "$0", + "^" + var.dokudir + "/feed.php.*" => "$0", + "^" + var.dokudir + "/(.*)\?(.*)" => var.dokudir + "/doku.php?id=$1&$2", + "^" + var.dokudir + "/(.*)" => var.dokudir + "/doku.php?id=$1" + ) +} + +# boot.slitaz.org +# +$HTTP["host"] =~ "boot\.slitaz\.org$" { + server.document-root = "/var/www/boot" + server.errorlog = "/var/log/lighttpd/boot.slitaz.org-error.log" + accesslog.filename = "/var/log/lighttpd/boot.slitaz.org-access.log" +} + +# pkgs.slitaz.org +# +$HTTP["host"] =~ "pkgs\.slitaz\.org$" { + server.document-root = "/var/www/pkgs" + server.errorlog = "/var/log/lighttpd/pkgs.slitaz.org-error.log" + accesslog.filename = "/var/log/lighttpd/pkgs.slitaz.org-access.log" + index-file.names += ( "search.sh" ) + cgi.assign = ( + ".sh" => "/bin/sh" + ) +} + +# hg.slitaz.org (Mercurial repos) +# +$HTTP["host"] =~ "hg\.slitaz\.org" { + cgi.assign = ( + ".py" => "/usr/bin/python" + ) + server.document-root = "/var/www/hg" +# url.rewrite-once = ( "(.*)" => "/hgwebdir.py$1" ) + index-file.names += ( "hgwebdir.py" ) +} + diff -r a6137e640e01 -r bea570b9faaa mirror-tools/stuff/home/backups/mirror/backup.sh --- a/mirror-tools/stuff/home/backups/mirror/backup.sh Thu Nov 18 09:56:09 2010 +0100 +++ b/mirror-tools/stuff/home/backups/mirror/backup.sh Thu Nov 18 10:21:49 2010 +0100 @@ -7,12 +7,19 @@ backup_data() { +GZIP=rgzip +which $GZIP > /dev/null || GZIP=gzip +echo "Sync doc.slitaz.org ..." +rsync -aH -e "$SSH" --bwlimit=50 \ + $REMOTE_USER@tank.slitaz.org:/home/slitaz/www/doc/data/. /var/www/doc/data/. while read file dirs; do + echo "Create $file.cpio.gz ..." ( cd / ; find $dirs | cpio -o -H newc ) | \ - rgzip -9 > $file.cpio.gz 2> /dev/null + $GZIP -9 > $file.cpio.gz 2> /dev/null done <>$TEMP_DIR/install.sh<SliTaz Network