Skip to content
Minimal LEMP configuration for Vagrant
Shell Nginx HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
vagrant
.gitattributes
.gitignore
README.md
Vagrantfile
index.html

README.md

LEMP Vagrant box

I created this Vagrant box for the following reasons:

  • development with Python or PHP, and MySQL
  • vanilla Ubuntu
  • project agnostic (install project dependencies with pip, composer, bower, ...)
  • no dependencies on a provisioner like Docker, Puppet, Ansible, ...
  • completely unattended provisioning
  • Keep It Small & Simple

Prerequisites

All you need to get started is:

Then:

git clone https://github.com/otech-nl/vagrant-lemp.git
vagrant up

Wait until vagrant finishes and then open http://192.168.33.10 or type vagrant ssh.

Contents

This box uses ubuntu/wily64 and optionally contains:

  • nginx
  • mysql
  • php (php5-fpm, composer)
  • myadmin (phpmyadmin)
  • py (virtualenv)
  • js (nodejs, npm, bower)
  • cc (valgrind, glib)

Details

  • Select your preferred Ubuntu box bay setting config.vm.box in Vagrantfile.

  • You can enable components by copying their files from vagrant/available to vagrant/enabled

  • You can set your VM name and host name in Vagrantfile. This name is also used as your project name. By default the name is derived from your directory name.

  • Your current directory is mapped to /home/vagrant/public_html

  • The script optionally uses the HostsUpdater plugin to set hostnames vagrant.dev and .dev. Otherwise add the following line to your C:\Windows\System32\drivers\etc\hosts or /etc/hosts (depending on your host OS) to be able to use vagrant.dev as URL:

      192.168.33.10	vagrant.dev
    
  • Useful pages:

  • root password: vagrant

  • MySQL is secured using mysql_secure_installation

Customize provisioning

The provisioning script will execute any script in the Vagrant/enabled folder. These scripts inherit the name space of the provisioning script. In particular, the following variables are available:

  • $INSTALL: the apt-get installation command
  • $PROJECT: the project name
  • $DBNAME: the name of the database
  • $DBUSER: the name of the database user
  • $DBPASS: the password of the database user

Finally, the provisioning script executes vagrant/setup.sh as user vagrant.

Example setup scripts are included in vagrant/scripts. You can use these to create your own setup scripts.

You can’t perform that action at this time.