Skip to content

Instantly share code, notes, and snippets.

@bergantine
Last active December 15, 2015 18:19
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 bergantine/5302604 to your computer and use it in GitHub Desktop.
Save bergantine/5302604 to your computer and use it in GitHub Desktop.
Vagrantfile for PHP-Newproj #vagrant #php #apache #vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.define :lampvm do |cfg|
# Every Vagrant virtual environment requires a box to build off of.
cfg.vm.box = "precise64"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
cfg.vm.box_url = "http://files.vagrantup.com/precise64.box"
# Forward a port from the guest to the host, which allows for outside
# computers to access the VM, whereas host only networking does not.
cfg.vm.forward_port 80, 8080
# Share www folder
config.vm.share_folder "web", "/var/www", "./www"
# Enable provisioning with chef solo, specifying a cookbooks path
# (relative to this Vagrantfile), and adding some recipes and/or
# roles.
#
cfg.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks"
# compilers
chef.add_recipe "apt"
chef.add_recipe "build-essential"
# lamp stack
chef.add_recipe "openssl"
chef.add_recipe "apache2"
chef.add_recipe "mysql"
chef.add_recipe "mysql::server"
chef.add_recipe "php"
chef.add_recipe "php::module_apc"
chef.add_recipe "php::module_curl"
chef.add_recipe "php::module_mysql"
chef.add_recipe "apache2::mod_php5"
chef.add_recipe "apache2::mod_rewrite"
# git
chef.add_recipe "git"
# python, python-dev plus pip and virtualenv
chef.add_recipe "python"
chef.add_recipe "python::pip"
chef.add_recipe "python::virtualenv"
# Configure MySQL
# Set the default python version to 2.7.3
chef.json = {
:mysql => {
:server_root_password => 'secret',
:server_debian_password => 'secret',
:server_repl_password => 'secret',
:bind_address => '127.0.0.1'
},
:python => {
:version => '2.7.3',
:distribute_install_py_version => '2.7'
}
}
# tie it all together
chef.add_recipe "chef-cookbook-phpnewproj"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment