Code Monkey home page Code Monkey logo

vagrant-lampp's Introduction

Vagrant LAMPP

Vagrant box with Puppet Standalone provisioner. Install Apache2, MySQL, PHP and a couple of tools needed for PHP development.

For convenience, Puppet configures the default VHost for Apache2 to point to the project root directory and creates a MySQL database.

The box is using Ubuntu 12.04 Server (Precise) x64 as base box.

Preconditions

  • Vagrant (Tested on different version 1.2.7, 1.5.1)
  • VirtualBox

Usage

Adding To A Project

This is intended to be used as drop-in sub-module for an PHP development project. To add this box to a project, either clone it into a sub-folder of your project root or preferrable add it as a submodule if you are already using Git on the project:

git submodule add [email protected]:joerx/vagrant-lampp.git vagrant

The above command will create a new folder 'vagrant' inside your project containing the contents of this repository. The folder name 'vagrant' is not technically required, but recommended.

More on Git submodules here: http://git-scm.com/book/ch6-6.html

Folder Structure

It is required to located the contents of this repository into a folder directly below the project root of your web application (see below why).

Environment variables

Some customization of the Vagrant box can be achieved by setting environment variables before booting or provisioning the box:

  • V_SITE_NAME: override the site name to be used (see below), otherwise the name of the parent folder is used
  • V_APT_MIRROR: allows to use an alternative apt-mirror for performance improvements. Defaults to 'archive.ubuntu.com'.
  • V_VBGUEST_AUTO: If (vagrant-vbguest)[https://github.com/dotless-de/vagrant-vbguest] is installed, it will automatically update VirtualBox guest additions inside the box. Set this to "0" to disable this (useful for testing).

Project Assumptions

The box will set up the document root for the web servers default vhost and a MySQL database for the project automatically. It will do this based on an internal variable SITE_NAME. The SITE_NAME will be the base name of the parent of the folder the Vagrant file is located in. This can be overridden using the environment variable V_SITE_NAME.

Assuming you add this to a project called 'my_project', and given the directory structure below, SITE_NAME would be set to 'my_project'.

.
|-- ...
`-- my_project
    |-- vagrant
    |   |-- puppet
    |   |-- README.md
    |   `-- Vagrantfile
    `-- ...

Based on this, the following configuration will be applied:

  • A shared folder 'my_project' --> '/var/www/my_project'
  • Folder '/var/www/my_project' as document root for Apache2
  • A MySQL database 'my_project', user 'my_project', pass 'my_project'

Recommended Plugins

  • Use vagrant-vbguest to make sure guest additions in the box match current VirtualBox version

Limitations

  • Cannot push to Git from inside the box as public SSL key is missing. Branch, commit, etc. works though. Copy the SSH-public/private key pair your are using on Github to /home/vagrant/.ssh if you want to push from inside the box

License

See LICENSE.

Copyright 2013 Jörg Henning <[email protected]>

vagrant-lampp's People

Contributors

joerx avatar

Stargazers

Jesper De Temmerman avatar Ron Aughenbaugh avatar Joaquin Menchaca avatar Nick Ilyin avatar Franz Josef Kaiser avatar Sergey Storchay avatar  avatar Piotr Piatkowski avatar

Watchers

James Cloos avatar  avatar Dmitry Zaitsev avatar Joaquin Menchaca avatar

Forkers

jah-io

vagrant-lampp's Issues

License

Hi, I really appreciate your work - would you mind if I use it in commercial (closed source) project? Could you add any license information to the repo?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.