A vagrant Ubuntu Server 32bit 14.04 LTS with Apache, MySQl, PHP and several development tools installed.

The server contains the following components:

  • apache
  • mysql
  • php 5.5
  • sqlite
  • vim
  • git
  • composer
  • nodejs, npm
  • cUrl
  • xdebug

The result can be used here: https://atlas.hashicorp.com/alexwenzel/boxes/webdev

Prepare the server

Initzialize vagrant:

vagrant init ubuntu/trusty32

Edit the initial vagrant file:

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  config.vm.box = "ubuntu/trusty32"

  config.vm.network "private_network", ip: "192.168.10.10"
  config.vm.synced_folder "./www", "/var/www"
  
  config.vm.provider "virtualbox" do |vb|
    vb.memory = 2048
  end
  
end

Then create the “www” folder and start vagrant:

vagrant up

SSH into the new vagrant box:

login as: vagrant
vagrant@127.0.0.1's password: vagrant

A quick ubuntu update:

sudo su
apt-get update
apt-get upgrade -y

Apache Webserver:

apt-get install apache2 -y
# add a server name
ServerName webdev

# modify directory configuration
<Directory /var/www/>
  Options Indexes FollowSymLinks
  AllowOverride All
  Require all granted
</Directory>

http://httpd.apache.org/docs/2.4/sections.html

PHP, MySQL, SQLite, PHP cUrl, Git:

apt-get install php5 libapache2-mod-php5 mysql-server php5-mysql php5-sqlite php5-curl git -y

NodeJs, npm:

curl -sL https://deb.nodesource.com/setup | sudo bash -
apt-get install nodejs -y

Composer:

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

 xDebug:

apt-get install php5-xdebug
zend_extension=xdebug.so

xdebug.profiler_enable_trigger = 1
xdebug.profiler_enable = 0
xdebug.profiler_output_dir = /var/www/xdebug/

https://alexwenzel.de/2014/191/php-profiling-xdebug

Create vagrant box file

vagrant package --base <virtual_maschine_name> --output mybox.box

Test the box:

$ vagrant box add my-box /path/to/the/new.box
...
$ vagrant init my-box
...
$ vagrant up
...