improved vhost
This commit is contained in:
@@ -56,13 +56,14 @@ if [ "$vh" = "y" ]; then
|
||||
read _letsencrypt
|
||||
done
|
||||
|
||||
systemctl stop nginx
|
||||
|
||||
# lets'encrypt
|
||||
# https://certbot.eff.org/lets-encrypt/debianstretch-nginx
|
||||
if [ "$_letsencrypt" = "yes" ]; then
|
||||
apt-get --yes install certbot
|
||||
systemctl stop nginx
|
||||
certbot certonly --standalone -d "$_domain" --cert-name "$_domain"
|
||||
systemctl start nginx
|
||||
# TODO stop the whole process if letsencrypt faile
|
||||
mkdir -p /etc/nginx/ssl/certs/"$_domain"
|
||||
openssl dhparam -out /etc/nginx/ssl/certs/"$_domain"/dhparam.pem 2048
|
||||
@@ -146,7 +147,7 @@ if [ "$vh" = "y" ]; then
|
||||
ln -s /etc/nginx/sites-available/"$_domain".conf /etc/nginx/sites-enabled/"$_domain".conf
|
||||
|
||||
# restart nginx
|
||||
systemctl start nginx
|
||||
systemctl restart nginx
|
||||
echo -e "\033[92;1mvhost $_domain configured \033[Om"
|
||||
else
|
||||
echo "Vhost installation aborted"
|
||||
|
||||
Reference in New Issue
Block a user