vagrant-debian-7.4-x64-webserver
Meu chef-solo cookbook que contém configurações para servidor web
Recipes
- LAMP (PHP 5.4)
- Postgres 9.1
- Python with pip and virtualenv
Requerimentos
- VirtualBox
# aptitude install virtualbox
- Vagrant >=1.6.1
- NFS
# aptitude install nfs-kernel-server nfs-common
Instalação e uso
-
Clone o projeto
$ git clone https://github.com/laborautonomo/vagrant-debian-7.4-x64-webserver.git $ cd vagrant-debian-7.4-x64-webserver
-
Altere o
Vagrantfile
com suas preferenciasconfig.vm.box = "chef/debian-7.4" config.vm.network "forwarded_port", guest: 80, host: 8080 config.vm.network "private_network", ip: "192.168.33.102" config.vm.post_up_message = "Your environment is ready and accessible in http://192.168.33.102" config.vm.synced_folder "/var/www", "/vagrant", type: "nfs" config.vm.provider "virtualbox" do |vb| vb.customize ["modifyvm", :id, "--memory", "1024"] end
-
Configure a senha do usuário root do MySQL em
cookbooks/mysql/recipes/default.rb
mysql_root_pwd = "your-password"
-
Configure o Postgres em
cookbooks/postgres/recipes/default.rb
# Edit the following to change the name of the database user that will be created: db_user="user-name" db_pass="your-password" # Edit the following to change the version of PostgreSQL that is installed pg_version=9.1
-
Configure os valores padrão do Apache2 - vhost em
cookbooks/apache2/recipes/default.rb
node.default['apache']['server_name'] = "192.168.33.102" node.default['apache']['server_admin'] = "your@email" node.default['apache']['doc_root'] = "/vagrant"
-
Configure os hosts e doc_roots dos seus projetos em
cookbooks/apache2/recipes/sites_available.rb
SITES_AVAILABLE = [ {:server_name => 'host1',:doc_root => 'website1'}, {:server_name => 'host2', :doc_root => 'website2'}, ... ]
-
Por fim, execute
vagrant up --provision