Update 'NGINX-Installer_V0.1.sh'

This commit is contained in:
2018-09-07 11:06:51 +00:00
parent a2570a18ba
commit 6ffad731c2

View File

@@ -260,9 +260,7 @@ apt-get install phpmyadmin -y
ln -s /usr/share/phpmyadmin /var/www/"$domain"/html ln -s /usr/share/phpmyadmin /var/www/"$domain"/html
systemctl restart php7.2-fpm systemctl restart php7.2-fpm
# Redirect phpmyadmin -> database # Redirect phpmyadmin -> database
cd /var/www/"$domain"/html/ mv /var/www/"$domain"/html/phpmyadmin /var/www/"$domain"/html/database
ls -l
mv phpmyadmin database
#-------------------# #-------------------#
# POSTFIX # # POSTFIX #
@@ -283,38 +281,42 @@ newaliases
#-------------------# #-------------------#
# NETDATA # # NETDATA #
#-------------------# #-------------------#
if [$netdata = 1]
then
bash <(curl -Ss https://my-netdata.io/kickstart.sh) bash <(curl -Ss https://my-netdata.io/kickstart.sh)
ufw allow 19999/tcp ufw allow 19999/tcp
# systemctl stop netdata # systemctl stop netdata
# systemctl disable netdata # systemctl disable netdata
fi
#-------------------# #-------------------#
# MEMCACHED # # MEMCACHED #
# 127.0.0.1:11211 # # 127.0.0.1:11211 #
#-------------------# #-------------------#
if [$memcached = 1]
#apt-get install memcached -y then
#systemctl restart memcached apt-get install memcached -y
systemctl restart memcached
# systemctl stop memcached # systemctl stop memcached
# systemctl disable memcached # systemctl disable memcached
fi
#-------------------# #-------------------#
# REDIS # # REDIS #
# 127.0.0.1:6379 # # 127.0.0.1:6379 #
#-------------------# #-------------------#
if [$redis = 1]
#apt install redis-server -y then
#sed -i 's/supervised no/supervised systemd/g' /etc/redis/redis.conf apt install redis-server -y
#sed -i 's/# bind 127.0.0.1 ::1/bind 127.0.0.1 ::1/g' /etc/redis/redis.conf sed -i 's/supervised no/supervised systemd/g' /etc/redis/redis.conf
#sed -i 's/# requirepass foobared/requirepass '$passwd'/g' /etc/redis/redis.conf sed -i 's/# bind 127.0.0.1 ::1/bind 127.0.0.1 ::1/g' /etc/redis/redis.conf
#systemctl restart redis sed -i 's/# requirepass foobared/requirepass '$passwd'/g' /etc/redis/redis.conf
#systemctl restart redis.service systemctl restart redis
systemctl restart redis.service
# systemctl stop redis # systemctl stop redis
# systemctl stop redis.service # systemctl stop redis.service
# systemctl disable redis # systemctl disable redis
# systemctl disable redis.service # systemctl disable redis.service
fi
#-------------------# #-------------------#
# CERTBOT # # CERTBOT #
#-------------------# #-------------------#
@@ -323,6 +325,9 @@ add-apt-repository ppa:certbot/certbot
apt install python-certbot-nginx -y apt install python-certbot-nginx -y
ufw allow 443/tcp ufw allow 443/tcp
#certbot --nginx -d $domain -d www.$domain #certbot --nginx -d $domain -d www.$domain
#sed -i 's/ssl ipv6only/ssl http2 ipv6only/g' /etc/nginx/sites-available/"$domain"
#sed -i 's/listen 443 ssl/listen 443 ssl http2/g' /etc/nginx/sites-available/"$domain"
#sed -i 's#include /etc/letsencrypt/options-ssl-nginx.conf;#ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;#g' /etc/nginx/sites-available/"$domain"
#check certbot auto-renewal -> certbot renew --dry-run #check certbot auto-renewal -> certbot renew --dry-run
#-------------------# #-------------------#
@@ -342,7 +347,6 @@ systemctl restart php7.2-fpm.service
# MYSQL SETTINGS # # MYSQL SETTINGS #
#-------------------# #-------------------#
cd /etc/mysql
rm /etc/mysql/my.cnf rm /etc/mysql/my.cnf
cat > /etc/mysql/my.cnf <<- "EOF" cat > /etc/mysql/my.cnf <<- "EOF"
# - "/etc/mysql/my.cnf" to set global options, # - "/etc/mysql/my.cnf" to set global options,
@@ -385,6 +389,8 @@ EOF
# WP - INSTALL # # WP - INSTALL #
#-------------------# #-------------------#
if [$wordpress = 1]
then
db_name="wp_1" db_name="wp_1"
db_user="wp_1" db_user="wp_1"
db_pass=$(date +%s|sha256sum|base64|head -c 32) db_pass=$(date +%s|sha256sum|base64|head -c 32)
@@ -438,12 +444,4 @@ if ( !defined('ABSPATH') )
#define('WP_REDIS_PORT', '6379'); #define('WP_REDIS_PORT', '6379');
require_once(ABSPATH . 'wp-settings.php'); require_once(ABSPATH . 'wp-settings.php');
EOF EOF
fi
#-------------------#
# SSL & HTTP/2 #
#-------------------#
#certbot --nginx -d $domain -d www.$domain
#sed -i 's/ssl ipv6only/ssl http2 ipv6only/g' /etc/nginx/sites-available/"$domain"
#sed -i 's/listen 443 ssl/listen 443 ssl http2/g' /etc/nginx/sites-available/"$domain"
#sed -i 's#include /etc/letsencrypt/options-ssl-nginx.conf;#ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;#g' /etc/nginx/sites-available/"$domain"