deb/lighttpd-register-stat.bash
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sun, 07 May 2023 12:48:30 +0300
changeset 20 f1b38aa4fa52
parent 9 096e320e01b0
permissions -rw-r--r--
Removed tab.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9
096e320e01b0 Recepie for stat site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     1
#!/bin/bash
096e320e01b0 Recepie for stat site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
096e320e01b0 Recepie for stat site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
apt install rsync
096e320e01b0 Recepie for stat site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
096e320e01b0 Recepie for stat site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
d=stat
096e320e01b0 Recepie for stat site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
mkdir -p /srv/www/$d
096e320e01b0 Recepie for stat site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
chown user:user /srv/www/$d
096e320e01b0 Recepie for stat site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
096e320e01b0 Recepie for stat site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
cat <<EOF >/etc/lighttpd/conf-available/92-$d.conf
096e320e01b0 Recepie for stat site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
\$HTTP["host"] == "$d.defun.work" {
096e320e01b0 Recepie for stat site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
  server.document-root = "/srv/www/$d"
096e320e01b0 Recepie for stat site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
}
096e320e01b0 Recepie for stat site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
EOF
096e320e01b0 Recepie for stat site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
096e320e01b0 Recepie for stat site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    15
lighttpd-enable-mod $d
096e320e01b0 Recepie for stat site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    16
service lighttpd restart