Created
December 23, 2018 08:59
-
-
Save didinahmadi/652f669e6a63ebd267642e5ea0adb7a2 to your computer and use it in GitHub Desktop.
script provision
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo service apache2 stop -y | |
sudo apt remove apache2.* -y | |
sudo apt-get remove apache2 -y | |
sudo apt-get autoremove -y | |
sudo apt-get purge apache2 -y | |
sudo add-apt-repository ppa:ondrej/php -y | |
sudo apt-get update -y | |
sudo apt-get install php7.2 -y | |
sudo apt-get install php7.2-mysql php7.2-mbstring -y | |
sudo apt-get install nginx -y | |
sudo apt-get install mariadb-server -y | |
aptitude -y install expect | |
MYSQL_ROOT_PASSWORD=root | |
SECURE_MYSQL=$(expect -c " | |
set timeout 10 | |
spawn mysql_secure_installation | |
expect \"Enter current password for root (enter for none):\" | |
send \"$MYSQL\r\" | |
expect \"Change the root password?\" | |
send \"n\r\" | |
expect \"Remove anonymous users?\" | |
send \"y\r\" | |
expect \"Disallow root login remotely?\" | |
send \"y\r\" | |
expect \"Remove test database and access to it?\" | |
send \"y\r\" | |
expect \"Reload privilege tables now?\" | |
send \"y\r\" | |
expect eof | |
") | |
echo "$SECURE_MYSQL" | |
aptitude -y purge expect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment