author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Sun, 07 May 2023 12:48:30 +0300 | |
changeset 20 | f1b38aa4fa52 |
parent 6 | f92d272095c3 |
permissions | -rw-r--r-- |
4
8b60b9ad42e8
Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
1 |
#!/bin/bash |
8b60b9ad42e8
Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
2 |
|
8b60b9ad42e8
Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
3 |
apt install rsync |
8b60b9ad42e8
Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
4 |
|
8b60b9ad42e8
Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
5 |
d=resume |
8b60b9ad42e8
Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
6 |
mkdir -p /srv/www/$d |
8b60b9ad42e8
Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
7 |
chown user:user /srv/www/$d |
8b60b9ad42e8
Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
8 |
|
8b60b9ad42e8
Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
9 |
cat <<EOF >/etc/lighttpd/conf-available/92-$d.conf |
5
b40d87296485
Quote dollar sign in here Bash document.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
4
diff
changeset
|
10 |
\$HTTP["host"] == "$d.defun.work" { |
4
8b60b9ad42e8
Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
11 |
server.document-root = "/srv/www/$d" |
8b60b9ad42e8
Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
12 |
} |
8b60b9ad42e8
Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
13 |
EOF |
8b60b9ad42e8
Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
14 |
|
8b60b9ad42e8
Added cooking + resume sites with generic code.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
15 |
lighttpd-enable-mod $d |
6
f92d272095c3
Restart lighttpd to pick up changes.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
5
diff
changeset
|
16 |
service lighttpd restart |