author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Thu, 02 May 2024 15:55:17 +0300 | |
changeset 37 | f2b49f2d087b |
parent 8 | 0df9576d516d |
permissions | -rw-r--r-- |
8
0df9576d516d
Recipe for welcome site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
1 |
#!/bin/bash |
0df9576d516d
Recipe for welcome site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
2 |
|
0df9576d516d
Recipe for welcome site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
3 |
apt install rsync |
0df9576d516d
Recipe for welcome site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
4 |
|
0df9576d516d
Recipe for welcome site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
5 |
d=welcome |
0df9576d516d
Recipe for welcome site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
6 |
mkdir -p /srv/www/$d |
0df9576d516d
Recipe for welcome site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
7 |
chown user:user /srv/www/$d |
0df9576d516d
Recipe for welcome site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
8 |
|
0df9576d516d
Recipe for welcome site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
9 |
cat <<EOF >/etc/lighttpd/conf-available/92-$d.conf |
0df9576d516d
Recipe for welcome site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
10 |
\$HTTP["host"] == "defun.work" { |
0df9576d516d
Recipe for welcome site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
11 |
server.document-root = "/srv/www/$d" |
0df9576d516d
Recipe for welcome site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
12 |
} |
0df9576d516d
Recipe for welcome site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
13 |
EOF |
0df9576d516d
Recipe for welcome site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
14 |
|
0df9576d516d
Recipe for welcome site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
15 |
lighttpd-enable-mod $d |
0df9576d516d
Recipe for welcome site.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
16 |
service lighttpd restart |