Vagrant

Got a kewl website or have a website question? Hosting? Servers?

Vagrant

Postby KyleMassacre » Sun Jul 12, 2015 1:38 pm

I hope this is a good place for this but here we go...

Does anyone here use vagrant? The reason I ask is because I am looking for a decent box that comes with a LAMP stack. Now before people say why use LAMP, why not LEMP? Well, because it's vagrant and what I am working on is using Apache.

My whole problem is that I am not good at all with Ruby, bash, .sh, etc and can't have too much configuring around otherwise I will break it and have to start over again much like I have been doing. I suck at starting up webhosts which is the bottom line here

I have gone to PuPHPet and configured a nice little vagrant box there but I can't get MySQL connection settings to work no matter what I try. I can connect remotely using Sequal Pro and a ssh connection but I can't connect with my local site that is using codeigniter. I have no clue what I am doing wrong, he'll I can't even get it to connect with a hostname to get to the dev site like using my-site.dev I have to connect with the IP address haha.

Any my help is greatly appreciated
Skype: KyleMassacre
My NWE Modules
User avatar
KyleMassacre
 
Posts: 557
Joined: Wed Nov 27, 2013 7:42 am
Has thanked: 19 times
Been thanked: 35 times

Re: Vagrant

Postby hallsofvallhalla » Mon Jul 13, 2015 9:40 am

hmm never used vagrant before but definitely checking it out.
User avatar
hallsofvallhalla
Site Admin
 
Posts: 11842
Images: 13
Joined: Wed Apr 22, 2009 6:29 pm
Location: mobile, al
Has thanked: 11 times
Been thanked: 146 times
Blog: View Blog (3)

Re: Vagrant

Postby KyleMassacre » Mon Jul 13, 2015 10:02 am

It would be sooo much better if I could connect it haha. It is an awesome tool
Skype: KyleMassacre
My NWE Modules
User avatar
KyleMassacre
 
Posts: 557
Joined: Wed Nov 27, 2013 7:42 am
Has thanked: 19 times
Been thanked: 35 times

Re: Vagrant

Postby KyleMassacre » Mon Jul 13, 2015 10:18 am

For those that don't use it let me give you some stuff that I noticed about it.

It kind of similar to digital ocean in a way but much easier and free since it's all local. You may just have to pay for a type of OS if that IS isn't free like windows for example.
Everything is configurable, you just can't exceed your guest machine's specs(your actual computer). For example RAM, HDD, etc.
I am not sure if you need virtualbox for this feature but if you set you disk space to like 100 gigs, you can make it dynamic. That means if you set it to 100 but are only using 5, it only takes 5 gigs and not 100. There is a feature for fixed which will take 100 no matter what.

Like digital ocean there are images that you can get which are called boxes with premade scripts that will automatically install what you need or you can install an OS that's just blank for example: no LAMP or LEMP.

It is command line based with a few commands like vagrant init which creates your vagrant session, vagrant up which starts your server, vagrant halt which shuts down your server, and vagrant destroy which removes your vagrant session with an option to wipe out your server if you wish to can that project.
Skype: KyleMassacre
My NWE Modules
User avatar
KyleMassacre
 
Posts: 557
Joined: Wed Nov 27, 2013 7:42 am
Has thanked: 19 times
Been thanked: 35 times

Re: Vagrant

Postby KyleMassacre » Wed Jul 29, 2015 6:12 am

I wanted to bring this back up again because there has been some issues in other threads about their local environment particularly with WAMP server. I know some people are hesitant about switching to something else like XAMPP for example. But with vagrant and virtualbox it makes life so easy. You can create a virtual fileshare to your vagrant environment. For example:
Vagrant file
Code: Select all
Vagrant.configure("2") do |config|
  config.vm.synced_folder "path/to/htdocs", "/etc/user/www/html"
  config.vm.synced_folder "path/to/db/files", "path/to/vagrant/mysql/files"
end

This way you can work from your current files along with your current database with no need to back them up just to work with vagrant.

If you already have a production server then you just configure your vagrant box to the same setup which gets rid of the "Well it worked on my machine" or, "Why is it working here and not there?" headache. So if you haven't tried it out yet, take the time and do so. I currently only work in vagrant and highly recommend it
Skype: KyleMassacre
My NWE Modules
User avatar
KyleMassacre
 
Posts: 557
Joined: Wed Nov 27, 2013 7:42 am
Has thanked: 19 times
Been thanked: 35 times

Re: Vagrant

Postby kaos78414 » Mon Aug 03, 2015 9:33 am

We use vagrant at work to set up our development environments, but we don't deploy with it. Honestly if I had to pick a tool for this purpose I'd choose Docker (https://www.docker.com/).
w00t
User avatar
kaos78414
 
Posts: 507
Joined: Thu Jul 22, 2010 12:36 am
Location: Dallas, TX
Has thanked: 0 time
Been thanked: 2 times

Re: Vagrant

Postby KyleMassacre » Mon Aug 03, 2015 10:01 am

I don't really do production related stuff anyways. I use Vagrant as a standardized machine with git. And with git we use several branches like development, alpha, and master. But since I only use one type of environment it's real easy. It's just easier to set up my local like my production environment that I may be using
Skype: KyleMassacre
My NWE Modules
User avatar
KyleMassacre
 
Posts: 557
Joined: Wed Nov 27, 2013 7:42 am
Has thanked: 19 times
Been thanked: 35 times


Return to WebSite

Who is online

Users browsing this forum: No registered users and 1 guest

cron

x