Advertisement
opexxx

installLAMP.sh

Nov 24th, 2013
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.87 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. clear
  4.  
  5. echo 'Going to install the LAMP stack on your machine, here we go...'
  6. echo '------------------------'
  7. read -p "MySQL Password: " mysqlPassword
  8. read -p "Retype password: " mysqlPasswordRetype
  9.  
  10. yum install -y httpd php mysql mysql-server
  11.  
  12. chkconfig mysql-server on
  13. chkconfig httpd on
  14.  
  15. /etc/init.d/mysqld restart
  16.  
  17. while [[ "$mysqlPassword" = "" && "$mysqlPassword" != "$mysqlPasswordRetype" ]]; do
  18.   echo -n "Please enter the desired mysql root password: "
  19.   stty -echo
  20.   read -r mysqlPassword
  21.   echo
  22.   echo -n "Retype password: "
  23.   read -r mysqlPasswordRetype
  24.   stty echo
  25.   echo
  26.   if [ "$mysqlPassword" != "$mysqlPasswordRetype" ]; then
  27.     echo "Passwords do not match!"
  28.   fi
  29. done
  30.  
  31. /usr/bin/mysqladmin -u root password $mysqlPassword
  32.  
  33.  
  34. clear
  35. echo 'Okay.... apache, php and mysql is installed, running and set to your desired password'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement