deb/lighttpd-register-tips.bash
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sun, 19 Mar 2023 00:35:34 +0200
changeset 4 8b60b9ad42e8
parent 3 8648def6d54b
child 5 b40d87296485
permissions -rw-r--r--
Added cooking + resume sites with generic code.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
240cb9b244aa Added "tips" site registration.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     1
#!/bin/bash
240cb9b244aa Added "tips" site registration.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
4
8b60b9ad42e8 Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 3
diff changeset
     3
apt install rsync
2
240cb9b244aa Added "tips" site registration.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
4
8b60b9ad42e8 Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 3
diff changeset
     5
d=tips
8b60b9ad42e8 Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 3
diff changeset
     6
mkdir -p /srv/www/$d
8b60b9ad42e8 Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 3
diff changeset
     7
chown user:user /srv/www/$d
8b60b9ad42e8 Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 3
diff changeset
     8
8b60b9ad42e8 Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 3
diff changeset
     9
cat <<EOF >/etc/lighttpd/conf-available/92-$d.conf
8b60b9ad42e8 Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 3
diff changeset
    10
$$HTTP["host"] == "$d.defun.work" {
8b60b9ad42e8 Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 3
diff changeset
    11
  server.document-root = "/srv/www/$d"
2
240cb9b244aa Added "tips" site registration.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    12
}
240cb9b244aa Added "tips" site registration.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
EOF
240cb9b244aa Added "tips" site registration.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
4
8b60b9ad42e8 Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 3
diff changeset
    15
lighttpd-enable-mod $d
3
8648def6d54b Refresh lighttd after enabling module.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2
diff changeset
    16
service lighttpd reload