deb/apache-register-tips.bash
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sun, 07 May 2023 12:48:30 +0300
changeset 20 f1b38aa4fa52
parent 14 719ced1ac5c3
child 21 52f40bd9e114
permissions -rw-r--r--
Removed tab.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
6a6933bfce58 Added test Apache 2 virtual host.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     1
#!/bin/bash
6a6933bfce58 Added test Apache 2 virtual host.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
11
a6a75053c129 Fixed names, enabled debugging.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 10
diff changeset
     3
set -x
a6a75053c129 Fixed names, enabled debugging.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 10
diff changeset
     4
a6a75053c129 Fixed names, enabled debugging.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 10
diff changeset
     5
# To meet uploading requirements.
10
6a6933bfce58 Added test Apache 2 virtual host.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
apt install rsync
6a6933bfce58 Added test Apache 2 virtual host.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     7
14
719ced1ac5c3 Added other sites to Apache.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 13
diff changeset
     8
d=tips
10
6a6933bfce58 Added test Apache 2 virtual host.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     9
mkdir -p /srv/www/$d
6a6933bfce58 Added test Apache 2 virtual host.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    10
chown user:user /srv/www/$d
6a6933bfce58 Added test Apache 2 virtual host.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
12
26943e31cae5 Removed numerical prefix.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 11
diff changeset
    12
cat <<EOF >/etc/apache2/sites-available/$d.conf
10
6a6933bfce58 Added test Apache 2 virtual host.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    13
<VirtualHost $d.defun.work:*>
6a6933bfce58 Added test Apache 2 virtual host.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    14
	DocumentRoot /srv/www/$d
13
7ed40cd96e3a Possible fix for: AH01630: client denied by server configuration.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 12
diff changeset
    15
7ed40cd96e3a Possible fix for: AH01630: client denied by server configuration.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 12
diff changeset
    16
    <Directory "/srv/www/$d/">
7ed40cd96e3a Possible fix for: AH01630: client denied by server configuration.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 12
diff changeset
    17
        Require all granted
7ed40cd96e3a Possible fix for: AH01630: client denied by server configuration.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 12
diff changeset
    18
    </Directory>
11
a6a75053c129 Fixed names, enabled debugging.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 10
diff changeset
    19
</VirtualHost>
10
6a6933bfce58 Added test Apache 2 virtual host.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    20
EOF
6a6933bfce58 Added test Apache 2 virtual host.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    21
6a6933bfce58 Added test Apache 2 virtual host.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    22
a2ensite $d
6a6933bfce58 Added test Apache 2 virtual host.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    23
service apache2 restart