+ 8_nginx_enable_site.sh
This commit is contained in:
@@ -33,5 +33,6 @@ wget ${base_url_scr}/4_acmesh.sh
|
|||||||
wget ${base_url_scr}/5_https.sh
|
wget ${base_url_scr}/5_https.sh
|
||||||
wget ${base_url_scr}/6_add_www_root.sh
|
wget ${base_url_scr}/6_add_www_root.sh
|
||||||
wget ${base_url_scr}/7_add_www_placeholder.sh
|
wget ${base_url_scr}/7_add_www_placeholder.sh
|
||||||
|
wget ${base_url_scr}/8_nginx_enable_site.sh
|
||||||
|
|
||||||
chmod 755 /tmp/*.sh
|
chmod 755 /tmp/*.sh
|
||||||
|
|||||||
28
scr/8_nginx_enable_site.sh
Executable file
28
scr/8_nginx_enable_site.sh
Executable file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
# enable a specific site in nginx / frode klevstul / oct 2025
|
||||||
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
||||||
|
if [ "$EUID" -ne 0 ]
|
||||||
|
then echo "error: run as 'root'"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
this_file_name=`basename "$0"`
|
||||||
|
|
||||||
|
if [ $# -ne 2 ]; then
|
||||||
|
echo usage: $this_file_name [USERNAME] [BARE_DOMAIN]
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
username=$1
|
||||||
|
domain=$2
|
||||||
|
|
||||||
|
cd /tmp/
|
||||||
|
trash-put ${domain.conf}
|
||||||
|
wget https://gt.op.fo/fro/lnxPub/raw/branch/master/srv/cmn/cfg/${domain}.conf
|
||||||
|
cp /tmp/${domain}.conf /etc/nginx/sites-available/.
|
||||||
|
ln -s /etc/nginx/sites-available/${domain}.conf /etc/nginx/sites-enabled/
|
||||||
|
chown ${username}:${username} /etc/nginx/sites-available/${domain}.conf
|
||||||
|
nginx -t && systemctl restart nginx
|
||||||
Reference in New Issue
Block a user