Skip to content

Instantly share code, notes, and snippets.

@maxxscho
Created March 20, 2014 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxxscho/9660934 to your computer and use it in GitHub Desktop.
Save maxxscho/9660934 to your computer and use it in GitHub Desktop.
Vagrant setup with forwarded port
echo "--- Good morning, master. Let's get to work. Installing now. ---"
echo "--- Updating packages list ---"
sudo apt-get update
echo "--- MySQL time - set MySQL Password ---"
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
echo "--- Installing base packages ---"
sudo apt-get install -y vim curl python-software-properties
echo "--- We want the bleeding edge of PHP, right master? ---"
sudo add-apt-repository -y ppa:ondrej/php5
echo "--- Updating packages list ---"
sudo apt-get update
echo "--- Installing PHP-specific packages ---"
sudo apt-get install -y php5 apache2 libapache2-mod-php5 php5-curl php5-gd php5-mcrypt mysql-server-5.5 php5-mysql git-core php-pear sqlite php5-sqlite php5-readline php5-xdebug
echo "--- Configure Xdebug ---"
cat << EOF | sudo tee -a /etc/php5/mods-available/xdebug.ini
xdebug.scream=0
xdebug.cli_color=1
xdebug.show_local_vars=1
xdebug.var_display_max_depth = 5
xdebug.var_display_max_children = 256
xdebug.var_display_max_data = 1024
EOF
echo "--- Install PHPUnit ----"
pear upgrade-all
pear config-set auto_discover 1
pear install -f --alldeps pear.phpunit.de/PHPUnit
echo "--- Enabling mod-rewrite ---"
sudo a2enmod rewrite
echo "--- What developer codes without errors turned on? Not you, master. ---"
sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php5/apache2/php.ini
sed -i "s/display_errors = .*/display_errors = On/" /etc/php5/apache2/php.ini
sed -i "s/disable_functions = .*/disable_functions = /" /etc/php5/cli/php.ini
# sed -i "s/disable_functions = /; disable_functions = /" /etc/php5/cli/php.ini # Maybe needed for Laravel Boris
echo "--- Composer is the future. But you knew that, did you master? Nice job. ---"
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
# /*
# |--------------------------------------------------------------------------
# | Optional stuff
# |--------------------------------------------------------------------------
# | If you want to create a database, uncomment the following 2 lines
# */
# echo "--- Create a database ---"
# echo "CREATE DATABASE IF NOT EXISTS sam_callcenter" | mysql -u root -proot
# /*
# |--------------------------------------------------------------------------
# | Stuff for laravel
# |--------------------------------------------------------------------------
# | This is stuff you probably need for Laravel
# */
# echo "--- Change document root in Apache conf to point to our public folder ---"
# sudo sed -i "s/DocumentRoot .*/DocumentRoot \/var\/www\/public/" /etc/apache2/sites-available/000-default.conf
# echo "--- Restarting Apache ---"
# sudo service apache2 restart
# echo "--- Laravel Artisan Migrate ---"
# cd /var/www
# php artisan migrate
# echo "--- Laravel Artisan Seed the database ---"
# php artisan db:seed
echo "--- All set to go! Would you like to play a game? ---"
# -*- 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 = "hashicorp/precise64"
config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.provision :shell, :path => "install.sh"
config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]
config.vm.provider :virtualbox do |vb|
vb.name = "SAM Callcenter App"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment