Skip to content

Instantly share code, notes, and snippets.

@sahibalejandro
Last active August 29, 2015 14:02
Show Gist options
  • Save sahibalejandro/80038293f363ec9c95c2 to your computer and use it in GitHub Desktop.
Save sahibalejandro/80038293f363ec9c95c2 to your computer and use it in GitHub Desktop.
Vagrant provision script
#!/usr/bin/env bash
# Install basics
apt-get update
apt-get -y install git curl python-software-properties
# Install packagess
add-apt-repository -y ppa:ondrej/php5
apt-get update
apt-get -y install php5 php5-mysql php5-mcrypt php5-curl php5-gd
# PHP Config
sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php5/apache2/php.ini
sed -i "s/display_errors = .*/display_errors = On/" /etc/php5/apache2/php.ini
# Install composer
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
# Apache2 Config
rm -rf /var/www/html
ln -s /vagrant/public /var/www/html
sed -i "s/APACHE_RUN_USER=.*/APACHE_RUN_USER=vagrant/" /etc/apache2/envvars
sed -i "s/APACHE_RUN_GROUP=.*/APACHE_RUN_GROUP=vagrant/" /etc/apache2/envvars
sed -i "s/AllowOverride None/AllowOverride All/" /etc/apache2/apache2.conf
a2enmod rewrite
service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment