Update 'installer.sh'
This commit is contained in:
22
installer.sh
22
installer.sh
@@ -37,9 +37,10 @@ hostnamectl set-hostname $domain
|
||||
apt update
|
||||
add-apt-repository universe -y
|
||||
add-apt-repository ppa:ondrej/php -y
|
||||
apt install mysql-server software-properties-common wget -y
|
||||
apt install software-properties-common -y
|
||||
apt upgrade -y
|
||||
apt autoremove -y
|
||||
mkdir -p /etc/nginx
|
||||
mkdir -p /var/www/"$domain"/html
|
||||
chmod -R 755 /var/www
|
||||
|
||||
@@ -165,18 +166,20 @@ ln -s /etc/nginx/sites-available/"$domain" /etc/nginx/sites-enabled/
|
||||
##-------------------------------##
|
||||
# NGINX Single core bug fix #
|
||||
##-------------------------------##
|
||||
echo "NGINX Single core bug fix"
|
||||
|
||||
mkdir /etc/systemd/system/nginx.service.d
|
||||
printf "[Service]\nExecStartPost=/bin/sleep 0.1\n" > /etc/systemd/system/nginx.service.d/override.conf
|
||||
systemctl daemon-reload
|
||||
systemctl restart nginx
|
||||
|
||||
##-----------------------##
|
||||
# MySQL Installation #
|
||||
##-----------------------##
|
||||
wget -q -t7 https://git.ictmaatwerk.com/VPS-scripts/Ubuntu-Mail/raw/branch/alpha/mysql-8.0.sh -O /tmp/mysql-8.0.sh
|
||||
bash /tmp/mysql-8.0.sh
|
||||
|
||||
##------------------------------##
|
||||
# MySQL_Secure_Installation #
|
||||
##------------------------------##
|
||||
echo "MySQL_Secure_Installation"
|
||||
|
||||
mysqladmin -u root password "$password"
|
||||
mysql -u root -p"$password" -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')"
|
||||
mysql -u root -p"$password" -e "DELETE FROM mysql.user WHERE User=''"
|
||||
@@ -185,12 +188,9 @@ mysql -u root -p"$password" -e "SELECT user,authentication_string,plugin,host FR
|
||||
mysql -u root -p"$password" -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '"$password"';"
|
||||
mysql -u root -p"$password" -e "FLUSH PRIVILEGES;"
|
||||
|
||||
##-----------##
|
||||
# MySQL #
|
||||
##-----------##
|
||||
echo "MySQL"
|
||||
|
||||
mkdir -p /etc/nginx
|
||||
##-----------------------------##
|
||||
# MySQL Database Creation #
|
||||
##-----------------------------##
|
||||
mysql -u root -p"$password" -e "CREATE DATABASE postfixadmin;"
|
||||
mysql -u root -p"$password" -e "GRANT ALL ON postfixadmin.* TO 'postfixadmin'@'localhost' IDENTIFIED BY '"$password"';"
|
||||
mysql -u root -p"$password" -e "FLUSH PRIVILEGES;"
|
||||
|
||||
Reference in New Issue
Block a user