Guest User

Untitled

a guest
Jul 3rd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. echo "What is your root password for MySQL?"
  4. read -s mysql_root_pw
  5. echo "Repeat your root password for MySQL"
  6. read -s copy
  7. if [ $copy != $mysql_root_pw ]
  8. then
  9. exit
  10. fi
  11.  
  12. # Install Nginx and make sure firewall setting allows Nginx
  13. sudo apt-get update
  14. sudo apt-get install nginx
  15. sudo ufw allow 'Nginx Full'
  16.  
  17. # Install MySQL, start, set to start on boot and set root password
  18. sudo apt-get install mysql-server
  19. sudo ufw allow mysql
  20. systemctl start mysql
  21. systemctl enable mysql
  22. mysql -u root -p -e "UPDATE mysql.user SET Password = PASSWORD('$mysql_root_pw') WHERE User = 'root'; FLUSH PRIVILEGES;"
  23.  
  24. # Install PHP and fix one security issue
  25. sudo apt-get install php-fpm php-mysql
  26. echo "cgi.fix_pathinfo=0" >> /etc/php/7.0/fpm/php.ini
  27. sudo systemctl restart php7.0-fpm
  28.  
  29. # Install certbot
  30. sudo add-apt-repository ppa:certbot/certbot
  31. sudo apt-get update
  32. sudo apt-get install python-certbot-nginx
Add Comment
Please, Sign In to add comment