Skip to content

Instantly share code, notes, and snippets.

@thiagosf
Created August 1, 2015 15:30
Show Gist options
  • Save thiagosf/99acab655591559bb09a to your computer and use it in GitHub Desktop.
Save thiagosf/99acab655591559bb09a to your computer and use it in GitHub Desktop.
Configuração simples do vagrant para desenvolvimento web com: apache, php e mysql
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "phpdevbox"
config.vm.network :hostonly, "192.168.33.10"
config.vm.forward_port 80, 8080
config.vm.provision "shell", inline: <<-SHELL
sudo apt-get update
sudo apt-get install -y vim
sudo apt-get install -y apache2
sudo apt-get install -y php5
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'
sudo apt-get install -y mysql-server
# Alterando dono do grupo do html
sudo chown -R vagrant:www-data /var/www/html/
# Criando o php para testar
echo "<?php phpinfo();" > /var/www/html/info.php
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment