Skip to content

Instantly share code, notes, and snippets.

@andonovn

andonovn/Vagrantfile

Last active Feb 2, 2017
Embed
What would you like to do?
vagrantfile - old ubuntu with lamp
#!/usr/bin/env bash
echo "--- Updating packages list ---"
sudo apt-get update
echo "--- Setting document root ---"
sudo rm -rf /var/www
sudo ln -fs /vagrant/public /var/www
echo "--- PHP errors enabling ---"
sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/apache2/php.ini
sed -i "s/display_errors = .*/display_errors = On/" /etc/php/apache2/php.ini
echo "--- Apache configuration ---"
sudo sed -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
sudo sed -i 's/Require all denied/Require all granted/' /etc/apache2/apache2.conf
sudo a2enmod rewrite
echo "--- Virtual host ---"
sudo sed -i '$a 127.0.0.1 wordpress.dev' /etc/hosts
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/wordpress.dev.conf
sudo sed -i 's/#ServerName www.example.com/ServerName wordpress.dev/' /etc/apache2/sites-available/wordpress.dev.conf
sudo sed -i 's@DocumentRoot /var/www/html@DocumentRoot /vagrant/public@' /etc/apache2/sites-available/wordpress.dev.conf
sudo a2ensite wordpress.dev
sudo service apache2 restart
# -*- 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 = "lucid64-lamp"
onfig.vm.box_url = "https://dl.dropbox.com/u/14741389/vagrantboxes/lucid64-lamp.box"
config.vm.network "private_network", ip: "192.168.23.23"
config.vm.provision :shell, :path => "vagrant-install.sh"
config.vm.synced_folder ".", "/vagrant", :mount_options => ["dmode=777", "fmode=666"]
# If true, then any SSH connections made will enable agent forwarding.
# Default value: false
# config.ssh.forward_agent = true
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment