Skip to content

Instantly share code, notes, and snippets.

@jveldboom
Last active March 18, 2018 20:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jveldboom/bdcb1c3e50101e9aac6a to your computer and use it in GitHub Desktop.
Save jveldboom/bdcb1c3e50101e9aac6a to your computer and use it in GitHub Desktop.
Unbuntu 14.04 Vagrant LEMP + Laravel

Download setup Ubuntu 14.04 box

// from local directory
vagrant init chef/ubuntu-14.04

Setup Vagrantfile

# -*- 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 = "chef/ubuntu-14.04"

	config.vm.hostname = "myhostname"

	# Configure A Private Network IP
	config.vm.network :private_network, ip: "192.168.33.10"

	# Configure A Few VirtualBox Settings
	config.vm.provider "virtualbox" do |vb|
		vb.customize ["modifyvm", :id, "--memory", "512"]
		vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
		vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
	end 

	# Fix Vagrant file permissions http://jeremykendall.net/2013/08/09/vagrant-synced-folders-permissions/
	config.vm.synced_folder "./", "/vagrant", id: "vagrant-root",
		owner: "vagrant",
		group: "www-data",
		mount_options: ["dmode=775,fmode=664"]

end

Install Nginx, MySQL, and PHP

https://www.digitalocean.com/community/articles/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-14-04

Install Laravel

http://laravel.com/docs/installation

// Make storage directories writable
chmod -R 775 app/storage

Rocketeer

// within "location"
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
// from Laravel homestead
location ~ \.php$ {
	fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php5-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        fastcgi_param DOCUMENT_ROOT $realpath_root;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment