Salut

Étant débutant dans tout ce qui est virtualisation d'une box Linux, J'ai suivi ce tuto Créer une VM avec Vagrant en installant la dernière version stable d'une box Debian jessie 8.1 (32 Bits) que j'ai trouvé ici

J'ai installé sur ma machine, ayant un systeme d'exploitation Windows 7 (32 Bits), ceci:

  • Git 1.9.4
  • Chef Development Kit 0.6.2
  • Vagrant 1.7.3
  • Virtual Box 4.3.30r101610

Dans un premier temps j'ai réussit à passer la premiere partie du tutoriel qui conciste à importer une box Debian, sauf que dans mon cas, j'ai renomé ma box "Debian81-i386" au lieu de "box-cutter/debian81-i386"

Contenu du fichier "Vagrantfile" dans mon "D:\VagrantBox\debian81-i386":

Vagrant.configure(2) do |config|
  config.vm.box = "debian81-i386"
  config.vm.box_url = "https://atlas.hashicorp.com/box-cutter/boxes/debian81-i386/versions/1.0.15/providers/virtualbox.box"
  config.vm.network "private_network", ip: "192.168.33.12"

  config.berkshelf.enabled = true
  config.vm.provision :chef_solo do |chef|
    chef.add_recipe "apt"
    chef.add_recipe "apache2"
  end
end

Contenu du fichier "Berksfile" :

source "https://supermarket.chef.io"

cookbook "apt"
cookbook "apache2"

La page "It Works" après avoir mis "192.168.33.12" dans mon navigateur et après avoir tapé un:

vagrant ssh

Dans un second temps, j'ai crée un fichier index.php dans le répertoire "D:\VagrantBox\Sites\Vagrant" contenant:

<?php
echo "Salut !";
>

je me suis placé dans le répertoire "D:\VagrantBox" et j'ai tapé:

git clone https://github.com/MiniCodeMonkey/Vagrant-LAMP-Stack.git LAMP
cd LAMP

Ensuite j'ai modifié le contenu du fichier "Vagrantfile" (se trouvant dans "D:\VagrantBox\LAMP")

# -*- mode: ruby -*-
# vi: set ft=ruby :

# General project settings
#################################

# IP Address for the host only network, change it to anything you like
# but please keep it within the IPv4 private network range
ip_address = "172.22.22.29"

# The project name is base for directories, hostname and alike
project_name = "site"

# MySQL and PostgreSQL password - feel free to change it to something
# more secure (Note: Changing this will require you to update the index.php example file)
database_password = "root"

# Vagrant configuration
#################################

Vagrant.configure("2") do |config|
  # Enable Berkshelf support
  config.berkshelf.enabled = true

  # Use the omnibus installer for the latest Chef installation
  config.omnibus.chef_version = :latest

  # Define VM box to use
  config.vm.box = "debian81-i386"
  config.vm.box_url = "https://atlas.hashicorp.com/box-cutter/boxes/debian81-i386/versions/1.0.15/providers/virtualbox.box"

  # Set share folder
  config.vm.synced_folder "/VagrantBox/Sites/Vagrant" , "/var/www/" + project_name + "/", :mount_options => ["dmode=777", "fmode=666"]

  # Use hostonly network with a static IP Address and enable
  # hostmanager so we can have a custom domain for the server
  # by modifying the host machines hosts file
  config.hostmanager.enabled = true
  config.hostmanager.manage_host = true
  config.vm.define project_name do |node|
    node.vm.hostname = project_name + ".local"
    node.vm.network :private_network, ip: ip_address
    node.hostmanager.aliases = [ "www." + project_name + ".local" ]
  end
  config.vm.provision :hostmanager

  # Enable and configure chef solo
  config.vm.provision :chef_solo do |chef|
    chef.add_recipe "app::packages"
    chef.add_recipe "app::web_server"
    chef.add_recipe "app::vhost"
    chef.add_recipe "memcached"
    chef.add_recipe "app::db"
    chef.json = {
      :app => {
        # Project name
        :name           => project_name,

        # Name of MySQL database that should be created
        :db_name        => "dbname",

        # Server name and alias(es) for Apache vhost
        :server_name    => project_name + ".local",
        :server_aliases =>  [ "www." + project_name + ".local" ],

        # Document root for Apache vhost
        :docroot        => "/var/www/" + project_name ,

        # General packages
        :packages   => %w{ vim git screen curl },

        # PHP packages
        :php_packages   => %w{ php5-mysqlnd php5-curl php5-mcrypt php5-memcached php5-gd }
      },
      :mysql => {
        :server_root_password   => database_password,
        :server_repl_password   => database_password,
        :server_debian_password => database_password,
        :bind_address           => ip_address,
        :allow_remote_root      => true
      }
    }
  end
end

Ainsi que celui de "Berksfile":

source "https://supermarket.getchef.com"

cookbook 'apache2'
cookbook 'apt'
cookbook 'build-essential'
cookbook 'dotdeb_repo', git: 'git://github.com/GeBeater/dotdeb-cookbook'
cookbook 'memcached'
cookbook 'mysql'
cookbook 'openssl'
cookbook 'php'
cookbook 'postfix'
cookbook 'app', path: './site-cookbooks/app'

Au passage, je remplace cette ligne:

cookbook 'dotdeb', git: 'git://github.com/GeBeater/dotdeb-cookbook'

par celle-ci:

cookbook 'dotdeb_repo', git: 'git://github.com/GeBeater/dotdeb-cookbook'

Parce que, lorsque j'execute la commande "Vagrant up", il m'affiche cette erreur-ci:

Le problème est que ça plante après avoir fait un vagrant up:

D:\VagrantBox\LAMP (master)
λ vagrant up
Bringing machine 'site' up with 'virtualbox' provider...
==> site: Loading Berkshelf datafile...
==> site: Sharing cookbooks with VM
==> site: Updating Vagrant's Berkshelf...
==> site: Resolving cookbook dependencies...
==> site: Fetching 'app' from source at site-cookbooks/app
==> site: Fetching 'dotdeb_repo' from git://github.com/GeBeater/dotdeb-cookbook (at master)
==> site: Fetching cookbook index from https://supermarket.getchef.com...
==> site: Using apache (0.0.5)
==> site: Using apache2 (3.1.0)
==> site: Using app (1.0.0) from source at site-cookbooks/app
==> site: Using apt (2.7.0)
==> site: Using build-essential (2.2.3)
==> site: Using chef-sugar (3.1.1)
==> site: Installing dotdeb (1.1.2) from https://supermarket.getchef.com ([opscode] https://supermarket.chef.io/api/v1)
==> site: Using chef_handler (1.2.0)
==> site: Using dotdeb_repo (1.1.0) from git://github.com/GeBeater/dotdeb-cookbook (at master)
==> site: Using iis (4.1.1)
==> site: Using memcached (1.7.2)
==> site: Using mysql (6.1.0)
==> site: Using openssl (4.2.0)
==> site: Using packagecloud (0.0.19)
==> site: Using php (1.6.1)
==> site: Using postfix (3.7.0)
==> site: Using rbac (1.0.3)
==> site: Using runit (1.7.2)
==> site: Using smf (2.2.7)
==> site: Using windows (1.38.1)
==> site: Using xml (1.2.13)
==> site: Using yum (3.6.3)
==> site: Using yum-epel (0.6.2)
==> site: Using yum-mysql-community (0.1.17)
==> site: Vendoring apache (0.0.5) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/apache
==> site: Vendoring apache2 (3.1.0) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/apache2
==> site: Vendoring app (1.0.0) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/app
==> site: Vendoring apt (2.7.0) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/apt
==> site: Vendoring build-essential (2.2.3) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/build-essential
==> site: Vendoring chef-sugar (3.1.1) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/chef-sugar
==> site: Vendoring chef_handler (1.2.0) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/chef_handler
==> site: Vendoring dotdeb (1.1.2) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/dotdeb
==> site: Vendoring dotdeb_repo (1.1.0) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/dotdeb_repo
==> site: Vendoring iis (4.1.1) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/iis
==> site: Vendoring memcached (1.7.2) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/memcached
==> site: Vendoring mysql (6.1.0) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/mysql
==> site: Vendoring openssl (4.2.0) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/openssl
==> site: Vendoring packagecloud (0.0.19) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/packagecloud
==> site: Vendoring php (1.6.1) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/php
==> site: Vendoring postfix (3.7.0) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/postfix
==> site: Vendoring rbac (1.0.3) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/rbac
==> site: Vendoring runit (1.7.2) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/runit
==> site: Vendoring smf (2.2.7) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/smf
==> site: Vendoring windows (1.38.1) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/windows
==> site: Vendoring xml (1.2.13) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/xml
==> site: Vendoring yum (3.6.3) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/yum
==> site: Vendoring yum-epel (0.6.2) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/yum-epel
==> site: Vendoring yum-mysql-community (0.1.17) to C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site/yum-mysql-community

==> site: Clearing any previously set network interfaces...
==> site: Preparing network interfaces based on configuration...
    site: Adapter 1: nat
    site: Adapter 2: hostonly
==> site: Forwarding ports...
    site: 22 => 2222 (adapter 1)
==> site: Booting VM...
==> site: Waiting for machine to boot. This may take a few minutes...
    site: SSH address: 127.0.0.1:2222
    site: SSH username: vagrant
    site: SSH auth method: private key
    site: Warning: Connection timeout. Retrying...
    site: Warning: Connection timeout. Retrying...
    site: Warning: Connection timeout. Retrying...
    site: Warning: Connection timeout. Retrying...
    site:
    site: Vagrant insecure key detected. Vagrant will automatically replace
    site: this with a newly generated keypair for better security.
    site:
    site: Inserting generated public key within guest...
    site: Removing insecure key from the guest if it's present...
    site: Key inserted! Disconnecting and reconnecting using new SSH key...
==> site: Machine booted and ready!
==> site: Checking for guest additions in VM...
==> site: Setting hostname...
==> site: Configuring and enabling network interfaces...
==> site: Mounting shared folders...
    site: /vagrant => D:/VagrantBox/LAMP
    site: /var/www/site => D:/VagrantBox/Sites/Vagrant
    site: /tmp/vagrant-chef/c1c5ae653d55acf5f67699d2035e35eb/cookbooks => C:/Users/Sacha/.berkshelf/vagrant-berkshelf/shelves/berkshelf20150729-3176-fl2c0b-site
==> site: Installing Chef 12.4.1 Omnibus package...
==> site: Downloading Chef 12.4.1 for debian...
==> site: downloading https://www.chef.io/chef/metadata?v=12.4.1&prerelease=false&nightlies=false&p=debian&pv=8.1&m=i686
==> site:   to file /tmp/install.sh.1284/metadata.txt
==> site: trying wget...
==> site: url   https://opscode-omnibus-packages.s3.amazonaws.com/debian/6/i686/chef_12.4.1-1_i386.deb
==> site: md5   5703a287b3b91463a20b96ac6cf7e403
==> site: sha256        26575e7710a0e9cddffac145e851a12f70ff2779b1969669250e615945a5f2f5
==> site: downloaded metadata file looks valid...
==> site: downloading https://opscode-omnibus-packages.s3.amazonaws.com/debian/6/i686/chef_12.4.1-1_i386.deb
==> site:   to file /tmp/install.sh.1284/chef_12.4.1-1_i386.deb
==> site: trying wget...
==> site: Comparing checksum with sha256sum...
==> site: Installing Chef 12.4.1
==> site: installing with dpkg...
==> site: Selecting previously unselected package chef.
==> site: (Reading database ... 30406 files and directories currently installed.)
==> site: Preparing to unpack .../chef_12.4.1-1_i386.deb ...
==> site: Unpacking chef (12.4.1-1) ...
==> site: Setting up chef (12.4.1-1) ...
==> site: Thank you for installing Chef!
==> site: Updating /etc/hosts file on active guest machines...
==> site: Updating /etc/hosts file on host machine (password may be required)...
==> site: Running provisioner: hostmanager...
==> site: Running provisioner: chef_solo...
==> site: Detected Chef (latest) is already installed
Generating chef JSON and uploading...
==> site: Running chef-solo...
==> site: stdin: is not a tty
==> site: [2015-07-29T08:03:16+00:00] INFO: Forking chef instance to converge...
==> site: Starting Chef Client, version 12.4.1
==> site: [2015-07-29T08:03:16+00:00] INFO: *** Chef 12.4.1 ***
==> site: [2015-07-29T08:03:16+00:00] INFO: Chef-client pid: 1497
==> site: [2015-07-29T08:03:25+00:00] INFO: Setting the run_list to ["recipe[app::packages]", "recipe[app::web_server]", "recipe[app::vhost]", "recipe[memcached]", "recipe[app::db]"] from CLI options
==> site: [2015-07-29T08:03:25+00:00] INFO: Run List is [recipe[app::packages], recipe[app::web_server], recipe[app::vhost], recipe[memcached], recipe[app::db]]
==> site: [2015-07-29T08:03:25+00:00] INFO: Run List expands to [app::packages, app::web_server, app::vhost, memcached, app::db]
==> site: [2015-07-29T08:03:25+00:00] INFO: Starting Chef Run for site.local
==> site: [2015-07-29T08:03:25+00:00] INFO: Running start handlers
==> site: [2015-07-29T08:03:25+00:00] INFO: Start handlers complete.
==> site: Compiling Cookbooks...
==> site: [2015-07-29T08:03:32+00:00] WARN: apache2::mod_php5 generally is expected to be run under a non-threaded MPM, such as prefork
==> site: [2015-07-29T08:03:32+00:00] WARN: See http://php.net/manual/en/faq.installation.php#faq.installation.apache2
==> site: [2015-07-29T08:03:32+00:00] WARN: Currently the apache2 cookbook is configured to use the 'worker' MPM
==> site: Recipe: apt::default
==> site:
==> site: * execute[apt-get-update] action run
==> site: [2015-07-29T08:20:18+00:00] INFO: execute[apt-get-update] ran successfully
==> site:
==> site: - execute apt-get update
==> site:
==> site:
==> site:
==> site:
==> site:   ================================================================================
==> site:   Recipe Compile Error
==> site:   ================================================================================
==> site:
==> site:   Chef::Exceptions::RecipeNotFound
==> site:   --------------------------------
==> site:   could not find recipe php54 for cookbook dotdeb
==> site:
==> site:   Cookbook Trace:
==> site:   ---------------
==> site:     /tmp/vagrant-chef/c1c5ae653d55acf5f67699d2035e35eb/cookbooks/app/recipes/web_server.rb:17:in `from_file'
==> site:
==> site:   Relevant File Content:
==> site:   ----------------------
==> site:   /tmp/vagrant-chef/c1c5ae653d55acf5f67699d2035e35eb/cookbooks/app/recipes/web_server.rb:
==> site:
==> site:    10:  include_recipe "apache2"
==> site:    11:  include_recipe "apache2::mod_php5"
==> site:    12:  include_recipe "apache2::mod_rewrite"
==> site:    13:  include_recipe "apache2::mod_ssl"
==> site:    14:
==> site:    15:  # Install PHP
==> site:    16:  include_recipe "dotdeb"
==> site:    17>> include_recipe "dotdeb::php54"
==> site:    18:  include_recipe "php"
==> site:    19:
==> site:    20:  # Install PHP5 packages
==> site:    21:  node['app']['php_packages'].each do |a_package|
==> site:    22:    package a_package
==> site:
==> site:
==> site:  23:  end
==> site:
==> site:
==> site:  24:
==> site:    25:  # Fix deprecated comments in PHP ini files by replacing '#' with ';'
==> site:    26:  bash "fix-phpcomments" do
==> site:
==> site:
==> site:   Running handlers:
==> site: [2015-07-29T08:20:18+00:00] ERROR: Running exception handlers
==> site:   Running handlers complete
==> site: [2015-07-29T08:20:18+00:00] ERROR: Exception handlers complete
==> site:   Chef Client failed. 1 resources updated in 1021.486263 seconds
==> site: [2015-07-29T08:20:18+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> site: [2015-07-29T08:20:18+00:00] ERROR: could not find recipe php54 for cookbook dotdeb
==> site: [2015-07-29T08:20:18+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.

Lorsque je me rends sur cette adresse http://www.site.local/ ou sur "172.22.22.29", ça m'affiche une page d'erreur "La connexion a échoué" :

Je précise que le ping fonctionne sur cette adresse:

Y a t-il d'autres paramètres à modifier ?
Merci d'avance

PS: j'ai spécialement formaté mon ordi histoire de tout recommencer depuis le début sur une base toute neuve que de lancer un WAMP (qui n'a pas été mis a jour depuis plus d'un an).

J'ai mis 2 semaines pour réussir la premiere partie du tuto de Grafikart qui d'ailleur je lui remercie infiniment pour ses tutoriel pour les petit developpeur-web comme moi.

Juste une petite précision pour ceux qui se sont planté dans la premiere partie du tutoriel:
La Version 5 de Virtual Box ne fonctionne pas avec Vagrant 1.7.3!
J'ai du la downgrade pour que Vagrant arrive à démarrer ma box.

Aucune réponse