Skip to content

Instantly share code, notes, and snippets.

@entomb
Created August 27, 2015 13:15
Show Gist options
  • Save entomb/2bb2fa3ac5cd2b57c681 to your computer and use it in GitHub Desktop.
Save entomb/2bb2fa3ac5cd2b57c681 to your computer and use it in GitHub Desktop.
Vagrant file that doest suck (php5/mysql/apache + node)
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
config.vm.box = "hashicorp/precise32"
config.vm.network "forwarded_port", guest: 80, host: 8080
# config.vm.network "public_network"
# config.vm.synced_folder "../data", "/vagrant_data"
config.vm.synced_folder ".", "/vagrant", :mount_options => ['dmode=774','fmode=775']
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
config.vm.provision "shell", inline: <<-SHELL
sudo su
sudo apt-get update
apt-get install -y vim curl git tmux make build-essential
apt-get install -y apache2
debconf-set-selections <<< 'mysql-server mysql-server/root_password password pass'
debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password pass'
apt-get install -y mysql-server
apt-get install -y php5 php5-curl php5-mcrypt php5-memcached php5-mysql
a2enmod rewrite
curl --silent --location https://deb.nodesource.com/setup_0.12 | bash -
apt-get install --yes nodejs
npm install -g grunt-cli
#set the vhost
if ! [ -L /var/www ]; then
rm -rf /var/www
ln -fs /vagrant/app /var/www
fi
apt-get install -y python-software-properties
add-apt-repository ppa:ondrej/php5
apt-get update
apt-get install php5
cd /var/www
curl -sS https://getcomposer.org/installer | php
#restart stuff
service apache restart
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment