Skip to content

Instantly share code, notes, and snippets.

@jasperf
Forked from chiquitto/Vagrantfile
Last active November 28, 2015 13:05
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 jasperf/dbc2491cb7fe2d41c15a to your computer and use it in GitHub Desktop.
Save jasperf/dbc2491cb7fe2d41c15a to your computer and use it in GitHub Desktop.
File with vagrant configs for php development for Zend Skeleton Application including MySQL #zend #vagrant #zendframework2
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = '2'
@script = <<SCRIPT
DOCUMENT_ROOT="/var/www/ZendSkeletonApplication/public"
#https://github.com/zendframework/ZendSkeletonApplication.git before running VagrantFile
MYSQL_ROOT_PASSWORD="123456"
#To reset root pw for MySQL See http://askubuntu.com/questions/489098/unable-to-reset-root-password-of-mysql
#http://stackoverflow.com/questions/7739645/install-mysql-on-ubuntu-without-password-prompt
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password $MYSQL_ROOT_PASSWORD'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password $MYSQL_ROOT_PASSWORD'
apt-get update
apt-get install -y apache2 git curl php5-cli php5 php5-intl libapache2-mod-php5
#apt-get install -y mysql-server apache2 libapache2-mod-php5 php5 php5-mysql git curl php5-cli php5 php5-intl
echo "
<VirtualHost *:80>
ServerName ZendSkeletonApplication
DocumentRoot $DOCUMENT_ROOT
<Directory $DOCUMENT_ROOT>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
" > /etc/apache2/sites-available/ZendSkeletonApplication.conf
a2enmod rewrite
a2dissite 000-default
a2ensite ZendSkeletonApplication
php5enmod pdo_mysql
service apache2 restart
cd /var/www/ZendSkeletonApplication
curl -Ss https://getcomposer.org/installer | php
php composer.phar install --no-progress
#mv composer.phar /usr/local/bin/composer
#chmod +x /usr/local/bin/composer
echo "** Visit http://localhost:8085 in your browser for to view the application **"
SCRIPT
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = 'bento/ubuntu-14.04'
config.vm.network "forwarded_port", guest: 80, host: 8085
config.vm.network "private_network", ip: "192.168.56.101"
# config.vm.network :private_network, type: :dhcp
# config.vm.network "public_network"
config.vm.hostname = "ZendSkeletonApplication"
config.vm.synced_folder '.', '/var/www/ZendSkeletonApplication'
config.vm.provision 'shell', inline: @script
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment