Vagrant

Got a kewl website or have a website question? Hosting? Servers?
Post Reply
User avatar
KyleMassacre
Posts: 573
Joined: Wed Nov 27, 2013 12:42 pm

Vagrant

Post by KyleMassacre »

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
User avatar
hallsofvallhalla
Site Admin
Posts: 12031
Joined: Wed Apr 22, 2009 11:29 pm

Re: Vagrant

Post by hallsofvallhalla »

hmm never used vagrant before but definitely checking it out.
User avatar
KyleMassacre
Posts: 573
Joined: Wed Nov 27, 2013 12:42 pm

Re: Vagrant

Post by KyleMassacre »

It would be sooo much better if I could connect it haha. It is an awesome tool
User avatar
KyleMassacre
Posts: 573
Joined: Wed Nov 27, 2013 12:42 pm

Re: Vagrant

Post by KyleMassacre »

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.
User avatar
KyleMassacre
Posts: 573
Joined: Wed Nov 27, 2013 12:42 pm

Re: Vagrant

Post by KyleMassacre »

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
User avatar
kaos78414
Posts: 507
Joined: Thu Jul 22, 2010 5:36 am

Re: Vagrant

Post by kaos78414 »

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
KyleMassacre
Posts: 573
Joined: Wed Nov 27, 2013 12:42 pm

Re: Vagrant

Post by KyleMassacre »

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
Post Reply

Return to “WebSite”