Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- echo "What is your root password for MySQL?"
- read -s mysql_root_pw
- echo "Repeat your root password for MySQL"
- read -s copy
- if [ $copy != $mysql_root_pw ]
- then
- exit
- fi
- # Install Nginx and make sure firewall setting allows Nginx
- sudo apt-get update
- sudo apt-get install nginx
- sudo ufw allow 'Nginx Full'
- # Install MySQL, start, set to start on boot and set root password
- sudo apt-get install mysql-server
- sudo ufw allow mysql
- systemctl start mysql
- systemctl enable mysql
- mysql -u root -p -e "UPDATE mysql.user SET Password = PASSWORD('$mysql_root_pw') WHERE User = 'root'; FLUSH PRIVILEGES;"
- # Install PHP and fix one security issue
- sudo apt-get install php-fpm php-mysql
- echo "cgi.fix_pathinfo=0" >> /etc/php/7.0/fpm/php.ini
- sudo systemctl restart php7.0-fpm
- # Install certbot
- sudo add-apt-repository ppa:certbot/certbot
- sudo apt-get update
- sudo apt-get install python-certbot-nginx
Add Comment
Please, Sign In to add comment