Skip to main content
Topic: Windows 10 + PuPHPet + Vagrant + DigitalOcean (Read 1041 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Windows 10 + PuPHPet + Vagrant + DigitalOcean

I like to use configuration management systems because it allows me to keep track of changes and one-click start a new VM. I use DigitalOcean[1] as a host because they offer a $5/m option on an SSD and I don't need all of the extra tools that AWS has. I use PuPHPet to create my provisioning scripts because it is really easy - just click what I want and that's it. I use Windows as my OS - if you give me grief about it, you can keep it to yourself, I like it.

Initially I had a site that I setup with CentOS and just punching in a bunch of `yum install` commands. I had WP installed but I never got around to completing the site. After about a year I decided I was going to scrap WP and install Elkarte. I don't run any forums and this way I can dogfood my work. It's a private site that I probably won't be posting on here but it really doesn't matter.

PuPHPet has a DigitalOcean deploy target which is awesome. Even tells you what you need to do to get Vagrant to work with it. You need to run two very simple commands: `vagrant plugin install vagrant-digitalocean` and `vagrant box add dummy`[2]. I did that, created the archive, ran `vagrant up` and starting getting issues.

Vagrant stalls
It just stopped after it created the VM and set the IP. I didn't know why. I could access the VM but it didn't setup any programs or sync any scripts. I was confused but then I enabled the `--debug` flag. I recommend you always do this. There will be tons of lines scrolling across the screen, but if something happens, you want to know what it was.

After I enabled the debug flag I saw errors about the SSH key.

PuTTYgen doesn't create real SSH keys
I figured this out after an entire day (like 18 hours) of trial and error. I finally decided to start an Ubuntu VM (with PuPHPet/Vagrant) locally and attempt to run it. Boom! It worked. I got another error, but at least now I could narrow down the issues.

I just copied the SSH keys from my Linux install over to Windows. Then open puttygen, load that private key in there, and create a new putty style key. I named it with "putty key" so I knew that it was only for PuTTY and not for rsync (more about rsync later).

PuPHPet has a bug with Nginx
If you see an error about 'false' being a string, go to your config.yaml and remove 'false' and replace it with false. In other words, remove the single quotes from the boolean. It is a bug that should be fixed eventually, but Juan Treminio is a busy guy and PuPHPet isn't his priority. It is easier to just find the Nginx section and replace that before you vagrant up.

Cygwin rsync doesn't work out of the box
First off, it didn't add the Cygwin bin path to %PATH%. Then, apparently it can't find it. Finally, there is an issue with Vagrant that makes it not work. I found a tutorial on how to fix that. Instead of explaining it all here, just go to the tutorial.

I might update this with the errors at some point, but I don't want to break things again just to give you all of the errors that I found. If you have questions about this setup or are having problems, I might be able to help you out. Good luck.
shameless referal link
really wish I could format that as inline code
I am currently doing freelance work. If you need coding help, forum help, or server maintenance, shoot me a PM and let me know.

Re: Windows 10 + PuPHPet + Vagrant + DigitalOcean

Reply #2
Thanks for the writeup !

I've not used DO as of yet but looked at it more than once,  Thats very cool that they have an easy way to work with puPHPet.  Now I may have to look at that as well.

Currently @Ant59 got me using Vagrant and VM's on my windows 7 box, and that has been a very cool environment to work in.   I basically just use the scripts he posted to provision and use an environment and have at it.  Used to use a local WAMP install but I only use that now when I need to run xdebug as I have not gotten that running (as well smooth as it works on local) on the remote box.

Well more to look into now :D
Squish squish. squish, squish, squish.
Find a bug,
Make a wish.

Re: Windows 10 + PuPHPet + Vagrant + DigitalOcean

Reply #4
Thanks, I'll give that a run in just a bit.
Squish squish. squish, squish, squish.
Find a bug,
Make a wish.

Re: Windows 10 + PuPHPet + Vagrant + DigitalOcean

Reply #5
 emanuele needs to read that very carefully. *nods*
Bugs creator.
Features destroyer.
Template killer.