Skip to content

Instantly share code, notes, and snippets.

@rgoodie
Forked from alimac/vagrant-d8.sh
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgoodie/d6bc60dc54e49290f353 to your computer and use it in GitHub Desktop.
Save rgoodie/d6bc60dc54e49290f353 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Install Drupal 8 Development Environment
# update apt
sudo apt-get update -y
# install development tools
sudo apt-get install curl git vim -y
# apache
sudo apt-get install apache2 -y
sudo a2enmod rewrite
sudo awk '/<Directory \/var\/www\/>/,/AllowOverride None/{sub("None", "All",$0)}{print}' /etc/apache2/sites-available/default > /tmp/default
sudo mv /tmp/default /etc/apache2/sites-available/default
# mysql
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password $1"
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $1"
sudo apt-get install mysql-server -y
# php
sudo apt-get install python-software-properties build-essential -y
sudo add-apt-repository ppa:ondrej/php5 -y
sudo apt-get update -y
sudo apt-get install php5-common php5-dev php5-cli php5-fpm -y
sudo apt-get install php5-curl php5-mysql php5-gd php5-mcrypt php5-xdebug -y
# install Drupal tools
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
sed -i '1i export PATH="$HOME/.composer/vendor/bin:$PATH"' $HOME/.bashrc
composer global require drush/drush:dev-master
# download and install Drupal
cd /var/www/html
rm -f index.html
/home/vagrant/.composer/vendor/bin/drush dl drupal-8
mv drupal-*/* /var/www/html/
/home/vagrant/.composer/vendor/bin/drush site-install --db-url=mysql://root:$1@localhost/d8 -y
# Restart MySQL and Apache.
sudo service mysql restart
sudo service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment