Skip to content

Instantly share code, notes, and snippets.

@johannesberdin
Last active January 4, 2016 12:23
Show Gist options
  • Save johannesberdin/2b9eb79800395fce891d to your computer and use it in GitHub Desktop.
Save johannesberdin/2b9eb79800395fce891d to your computer and use it in GitHub Desktop.
Provision shell script for my Vagrant lamp stack
#!/bin/sh
# vagrant shell script for simple lamp stack
export DEBIAN_FRONTEND=noninteractive
# update
apt-get -qq update
echo "Updated system."
# php55 repository
apt-get -qq -y install python-software-properties
add-apt-repository ppa:ondrej/php5 -y
echo "Added php55 repository."
apt-get -qq update
echo "Updated system again."
# vim
apt-get -qq -y install curl vim
echo "Installed basic tools."
# apache2
apt-get -qq -y install apache2
echo "Installed apache2."
## apache2 configuration
echo "ServerName localhost" >> /etc/apache2/apache2.conf
a2enmod rewrite
curl -O https://gist.githubusercontent.com/johannesberdin/6493681c4c43db9e2390/raw/ee560293a1596c77ff2b8664ff7a58ac49f0cde0/000-default.conf
mv 000-default.conf /etc/apache2/sites-available/000-default.conf
echo "Configured apache2."
# php5
apt-get -qq -y install php5 php5-dev php5-cli php5-mysql php-apc php5-mcrypt php5-gd php5-curl php5-xdebug php5-memcache php5-memcached php5-pgsql php5-sqlite
echo "Installed php5."
## php5 configuration
curl -O https://gist.githubusercontent.com/johannesberdin/1f7ab4db21f399aa980c/raw/ee2dccc35a2615dc2228d6bf523241a585904b39/php.ini
mv php.ini /etc/php5/apache2/php.ini
echo "Configured php5."
## composer
curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
echo "Installed composer."
# nodejs
apt-get -qq -y install nodejs node npm
echo "Installed nodejs."
# mysql
apt-get -qq -y install mysql-server
echo "Installed mysql."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment