Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.17 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Clear terminal first
  4. clear
  5.  
  6. # Make sure user is root
  7.  
  8. if [[ $EUID -ne 0 ]]; then
  9.    echo "INIT 0!, SCRIPT SHOULD BE RUN AS ROOT!" 1>&2
  10.    exit 1
  11. fi
  12.  
  13. default=Vm0wd2VHUXhTWGhXV0doV
  14.  
  15. # Installing webserver & configurate
  16. # Powered by LAMP (Linux, Apche, MySQL, PHP)
  17.  
  18. # Installing Apache2
  19.  
  20. apt install apache2 -y
  21.  
  22. # Installing MySQL Server
  23.  
  24. apt install debconf-utils -y
  25. echo "mysql-server mysql-server/root_password select $default" | debconf-set-selections
  26. echo "mysql-server mysql-server/root_password_again select $default" | debconf-set-selections
  27. sudo apt-get -y install mysql-server
  28.  
  29. # Installing PHP
  30.  
  31. sudo apt install libapache2-mod-php php-mcrypt php-mysql php-mbstring php-curl php-tokenizer php-xml
  32.  
  33. #######################################################
  34. #           WEBSERVER SUCCESSFULLY INSTALLED          #
  35. #######################################################
  36.  
  37. #######################################################
  38. #                CONFIGURING SSHPANEL                 #
  39. #######################################################
  40.  
  41. # Changed webserver root directory
  42. apt install sed
  43. sed -i 's/var\/www/var\/www\/html\/sshpanel\/public/g' /etc/apache2/apache2.conf
  44.  
  45. # Go to Webserver dir
  46. cd /var/www/html
  47.  
  48. # Cloning SSHPANEL from GitHub
  49. # Make sure Git has been installed
  50. apt install git -y
  51.  
  52. # Cloning!
  53. git clone git://github.com/rizalio/sshpanel.git
  54.  
  55. # Generating .env file & configure database
  56. mysql -u root -p$default -e "CREATE DATABASE IF NOT EXISTS sshpanel;exit;"
  57. cd /var/www/html/sshpanel
  58. echo "DB_CONNECTION=mysql" >> .env
  59. echo "DB_PORT=3306" >> .env
  60. echo "DB_DATABASE=sshpanel" >> .env
  61. echo "DB_USERNAME=root" >> .env
  62. echo "DB_PASSWORD=$default" >> .env
  63. mysql -u root -p$default -e "use sshpanel; SET autocommit =0; source database/database.sql; COMMIT; exit;"
  64.  
  65.  
  66.  
  67. chmod -R 755 /var/www/html/sshpanel/*
  68. chmod -R 755 /var/www/html/sshpanel/storage
  69.  
  70. #Restarting webserver
  71. sudo apache2 restart
  72.  
  73. # Complete installation
  74. clear
  75.  
  76.  
  77. # Tell user installation is complete
  78. echo "Congratulation, SSHPANEL Now installed on your server!"
  79. echo "Default login email is : admin@admin.admin & default password is : admin"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement