Search code examples
centosvirtual-machinevmwarelampvagrant

Vagrant Box LAMP Images


Are there freely available Vagrant-box images for CentOS 6.xx 64bit that include the following LAMP stack? or should i just use a base CentOS image and build my own environment?

  • PHP 5.4+
  • Mcyrpt Extension
  • Mysql 5.xx +
  • Apache 2.xx

Im usually developing on the Laravel framework (PHP).


Solution

  • Vagrant base boxes are minimal boxes, not likely to include LAMP/LEMP stack.

    Vagrant supports various provisioning tools like chef, puppet, ansible.

    If you know basics about chef cookbooks, just put the cookbooks together and edit the Vagrantfile before you vagrant up.

    LAMP requires the following cookbooks

    • apache2
    • php
    • mysql
    • openssl
    • build-essential
    • xml

    Use a opscode bento boxes and run the cookbooks.

    Refer to chef_solo, add the recipes required to the runlist in the Vagrant file

    Vagrant.configure("2") do |config|
      config.vm.provision "chef_solo" do |chef|
        chef.add_recipe "lamp"
      end
    end
    

    NOTE: in this example lamp includes the following recipes:

    • apache2
    • mysql::server
    • mysql::ruby
    • php
    • php::module_mysql

    Run vagrant up and it'll do the provisioning for you.