Guest User

Untitled

a guest
Jan 1st, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. sudo apt-get update
  4. sudo apt-get install -y apache2
  5.  
  6. # create desired folders
  7. if ! [ -L /var/www/html/foxpal ]; then
  8. rm -rf /var/www/html/foxpal
  9. ln -sf /vagrant /var/www/html/foxpal
  10. fi
  11.  
  12. if ! [ -d /var/www/html/ossn_data ]; then
  13. mkdir -m 0777 /var/www/html/ossn_data
  14. fi
  15.  
  16. sudo a2enmod rewrite
  17. sudo a2enmod userdir
  18. sudo service apache2 restart
  19.  
  20. sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password secret'
  21. sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password secret'
  22. sudo apt-get install -y mysql-server
  23.  
  24. # Needed PHP Modules for OSSN
  25. sudo apt-get install -y php
  26. sudo apt-get install -y php-xml
  27. sudo apt-get install -y php-curl
  28. sudo apt-get install -y php-zip
  29. sudo apt-get install -y php-mcrypt
  30. sudo apt-get install -y php-gd
  31. sudo apt-get install -y php-json
  32. sudo apt-get install -y php-mysql
  33. sudo apt-get install -y libapache2-mod-php
  34.  
  35. sudo apt-get install -y zip
  36. sudo apt-get install -y curl
  37.  
  38. # Copy Skeleton Vhost and enable it
  39. WEBROOT="/var/www/html"
  40. VHOSTDIR="/etc/apache2/sites-available/"
  41. VHOSTCONFIG="/vagrant/configurations/skeleton"
  42. PROJECTNAME="dev.foxpal.local"
  43. DBCONFIG="/vagrant/configurations/skeleton.config.db"
  44. SITECONFIG="/vagrant/configurations/skeleton.config.site"
  45. DBDEST="/vagrant/configurations/ossn.config.db.php"
  46. SITEDEST="/vagrant/configurations/ossn.config.site.php"
  47.  
  48. if ! [ -f "$VHOSTDIR$PROJECTNAME" ]
  49. then
  50. cp "$VHOSTCONFIG" "$VHOSTDIR/$PROJECTNAME.conf"
  51. fi
  52.  
  53. if ! [ -f "$DBDEST" ]
  54. then
  55. cp "$DBCONFIG" "$DBDEST"
  56. fi
  57.  
  58. if ! [ -f "$SITEDEST" ]
  59. then
  60. cp "$SITECONFIG" "$SITEDEST"
  61. fi
  62.  
  63. sudo a2ensite $PROJECTNAME
  64. sudo service apache2 restart
  65.  
  66. MYSQL_USER="root"
  67. MYSQL_PASSWORD="secret"
  68. DBNAME="foxpal"
  69.  
  70. sudo mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -e "CREATE DATABASE IF NOT EXISTS $DBNAME;" 2> /dev/null
  71. sudo php /vagrant/install_project.php
  72.  
  73. sudo service apache2 restart
  74.  
  75.  
  76.  
  77. // Vagrant File:
  78.  
  79. Vagrant.configure("2") do |config|
  80. config.vm.box = "geerlingguy/ubuntu1604"
  81. config.vm.provision :shell, path: "configurations/bootstrap.sh"
  82. config.vm.network :private_network, ip: "222.222.222.222"
  83. config.vm.synced_folder '.', '/vagrant', nfs: true
  84. end
Add Comment
Please, Sign In to add comment