PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, February 11, 2022

[FIXED] How to run a LAMP stack through Vagrant

 February 11, 2022     apache, lamp, mysql, php, vagrant     No comments   

Issue

I've been trying to figure this out for hours and just cant seem to. There doesn't seem to be much help online. I've tried to do it via Chef solo, but that doesn't seem to work and I'm not particularly a fan of it downloading php, apache, mysql every time I create a new VM.

Anyway, not particularly concerned what the method is, whether its through Chef solo or similar, or whether its a box with LAMP already set up, or something else, I just want a way (and preferably the easiest way) to set up a VM with a LAMP stack through Vagrant.


Solution

Chef Solo is the preferred method but has a pretty steep learning curve. You should make the effort to learn this eventually. In the meantime, you can manually install everything just like you mentioned and then package the box up

vagrant package

You'll now have a package.box that you can use to create virtual machines with from vagrant with the LAMP stack you installed. Add the box

vagrant box add lamp package.box

and then within your Vagrantfile

Vagrant::Config.run do |config|
  config.vm.box = "lamp"

  # stuff
end


Answered By - axsuul
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing