Skip to content

Commit

Permalink
for folks with Vagrant
Browse files Browse the repository at this point in the history
  • Loading branch information
ahebrank authored and mrjoelkemp committed Jan 2, 2015
1 parent ba21dc4 commit 3ce0547
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ Thumbs.db

node_modules
.sass-cache
.vagrant
32 changes: 32 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# set up a Vagrantbox to run the repl
# check it out at http://phpepl.dev after running 'vagrant up'

Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"

# Remove the default Vagrant directory sync
config.vm.synced_folder ".", "/vagrant", disabled: true

config.vm.synced_folder "./", "/var/www/public", id: "vagrant-root",
owner: "vagrant",
group: "www-data",
mount_options: ["dmode=775,fmode=664"]

config.vm.network :private_network, ip: "192.168.56.101"
config.ssh.forward_agent = true

# host dns registration
# you'll need "vagrant plugin install vagrant-hostsupdater" for the site name to be added to your hosts resolver file automatically
config.vm.hostname = "phpepl.dev"
if Vagrant.has_plugin?("vagrant-hostsupdater")
config.hostsupdater.remove_on_suspend = true
end

config.vm.provider :virtualbox do |v|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
v.customize ["modifyvm", :id, "--memory", 512]
end

# install apache and php
config.vm.provision :shell, :path => "vagrant-bootstrap.sh"
end
7 changes: 7 additions & 0 deletions vagrant-bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
# simple provisioning for php and apache

sudo apt-get -y install apache2 php5
# fix the docroot
sudo sed -i 's/\/var\/www\/html/\/var\/www\/public/g' /etc/apache2/sites-enabled/000-default.conf
sudo service apache2 restart

0 comments on commit 3ce0547

Please sign in to comment.