simde-utc / portail-old

Portail des associations de l'UTC
Other
9 stars 23 forks source link

Vagrant #166

Closed MiLk closed 8 years ago

MiLk commented 10 years ago

Il est maintenant possible d'utiliser Vagrant pour avoir une machine de test. Il n'est plus necessaire d'installer apache, php et mysql sur son pc.

vagrant up permet de creer la machine. vagrant ssh pour se ssh dessus. vagrant halt pour l'arreter. vagrant destroy pour la detruire.

Il faut avoir installer Vagrant et VirtualBox.

Le portail est accessible a l'adresse: http://10.10.10.10/. Phpmyadmin est accessible a l'adresse: http://10.10.10.10/phpmyadmin

La machine est basee sur Debian Squeeze.

Le dossier du portail est synchronize automatiquement entre le pc et la machine virtuelle. Le proprietaire est www-data pour simplifier. Pour lancer des commandes en cli dans la machine virtuelle, il est conseille de se logguer en www-data. Il suffit de lancer la commande suivante apres avoir faire vagrant ssh: sudo -u www-data -s /bin/bash.

MiLk commented 10 years ago

Il faut complètement supprimer le contenu du dossier cache pour régénérer les paths.

Par defaut phpmyadmin n'autorise pas les passwords empty, ca se change dans /etc/phpmyadmin/config.inc.php.

Sinon il faut changer le password de root qui est vide par defaut.

feuloren commented 10 years ago

keur keur love :+1:

MiLk commented 10 years ago

Up @Zicouto @jofroid

Peut-etre que @feuloren peut jeter un oeil aussi.

MiLk commented 10 years ago
$ vagrant up default                                                                                                                          [21:49:33]
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'puppetlabs/debian-6.0.9-32-puppet' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'puppetlabs/debian-6.0.9-32-puppet'
    default: URL: https://vagrantcloud.com/puppetlabs/debian-6.0.9-32-puppet
==> default: Adding box 'puppetlabs/debian-6.0.9-32-puppet' (v0.3.0) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/puppetlabs/debian-6.0.9-32-puppet/version/2/provider/virtualbox.box
==> default: Successfully added box 'puppetlabs/debian-6.0.9-32-puppet' (v0.3.0) for 'virtualbox'!
==> default: Importing base box 'puppetlabs/debian-6.0.9-32-puppet'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'puppetlabs/debian-6.0.9-32-puppet' is up to date...
==> default: Setting the name of the VM: portail_default_1407590072734_57592
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!

Pas de soucis chez moi @Zicouto

brcorentin commented 10 years ago

Bringing machine 'default' up with 'virtualbox' provider... ==> default: Checking if box 'puppetlabs/debian-6.0.9-32-puppet' is up to date... ==> default: There was a problem while downloading the metadata for your box ==> default: to check for updates. This is not an error, since it is usually due ==> default: to temporary network problems. This is just a warning. The problem ==> default: encountered was: ==> default: ==> default: Couldn't resolve host 'vagrantcloud.com' ==> default: ==> default: If you want to check for box updates, verify your network connection ==> default: is valid and try again. ==> default: Clearing any previously set forwarded ports... ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat default: Adapter 2: hostonly ==> default: Forwarding ports... default: 22 => 2222 (adapter 1) ==> default: Running 'pre-boot' VM customizations... ==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2222 default: SSH username: vagrant default: SSH auth method: private key default: Warning: Connection timeout. Retrying... ==> default: Machine booted and ready! ==> default: Checking for guest additions in VM... default: No guest additions were detected on the base box for this VM! Guest default: additions are required for forwarded ports, shared folders, host only default: networking, and more. If SSH fails on this machine, please install default: the guest additions and repackage the box to continue. default: default: This is not an error message; everything may continue to work properly, default: in which case you may ignore this message. ==> default: Setting hostname... ==> default: Configuring and enabling network interfaces... ==> default: Mounting shared folders... default: /vagrant => /home/corentin/portail Failed to mount folders in Linux guest. This is usually because the "vboxsf" file system is not available. Please verify that the guest additions are properly installed in the guest and can work properly. The command attempted was:

mount -t vboxsf -o uid=id -u vagrant,gid=getent group vagrant | cut -d: -f3 vagrant /vagrant mount -t vboxsf -o uid=id -u vagrant,gid=id -g vagrant vagrant /vagrant

@MiLk

MiLk commented 10 years ago
 Couldn't resolve host 'vagrantcloud.com'

Probleme de config dns ou reseau indispo.

Tu es sous quel os? tu as bien le module kernel vbox installé?

apuyou commented 10 years ago

Chez moi il télécharge mais j'ai aussi l'erreur à propos du filesystem. La commande est bien exécutée dans la VM ? Il faudrait quoi comme module du côté de l'hôte (Mac OS pour moi) ?

Je fais tourner d'autres Vagrant et rien à signaler.

brcorentin commented 10 years ago

J'ai fait un premier test sous Windows et j'ai eu ce bug. Je me suis dis après que j'allais arreter de tenter le diable donc je suis passé sous fedora 20 et j'ai eu ce même bug. J'ai bien installé vbox.

feuloren commented 9 years ago

Ça marche chez moi en installant le plugin vagrant-vbguest : vagrant plugin install vagrant-vbguest La box a été mise à jour depuis ta PR par contre (puppetlabs/debian-6.0.10-32-puppet - la 6.0.9 renvoie un 404 maintenant)

MiLk commented 9 years ago

Updated.

vagrant plugin install vagrant-vbguest
vagrant up
vagrant ssh
sudo -u www-data -s /bin/bash
cd portail
rm -rf cache/*
php symfony cc
feuloren commented 9 years ago

Sur une install toute neuve ça plante avec:

==> default: Running provisioner: puppet...
==> default: Running Puppet with site.pp...
==> default: stdin: is not a tty
==> default: Error: Could not parse application options: invalid option: --manifestdir

Une idée ? (Une nouvelle version de puppet peut être ?)

MiLk commented 9 years ago

Nouvelle version de puppet ou vagrant.

Il faudrait clore cette PR et migrer sur docker.

feuloren commented 8 years ago

Tu as déjà utilisé docker @MiLk ? Si je comprends bien la philosophie, il faut que je fasse un docker pour chaque appli (mysql, php-fpm, nginx), que je rende le code accessible avec un VOLUME et que je combine le tout avec docker-compose.

MiLk commented 8 years ago

Ouais. Utilise mysql et apache plutot que nginx, ca sera plus simple. Je peux y jeter un oeil le week end prochain si besoin.