reidcooper / BasicVagrantLAMPSetup

Basic Vagrant Set Up Guide, including a LAMP set up script

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple Vagrant/LAMP Set Up

=====

I have use Vagrant a couple of times for projects in which it has become incredibly useful in set up and operation. Its nice for me because I like to keep my computer environment clean and not possibly filled with errors that could potentially harm my computer. Therefore, having a virtual machine environment works for me. I have also used it for some of my college classes which require the LAMP stack, in this case, I just have to run vagrant up which loads up the stack and my projects are all ready to go. But, vagrant boxes can be used for anything you can think of not just LAMP stacks. Any type of development environment can work.

I have also included a LAMP Stack set up script which I have written which works as of 3/10/15. Let me know if I have to change it. It automatically installs LAMP including phpmyadmin with default username: root and password: password. This is currently configured to be the most basic of configuration and has not been tested or meant for anything for production in terms of security etc.. Use this as a guide on how to set up a vagrant machine and LAMP stack if required.

Remember, you can take snapshots of your virtual machine in virtualbox. This way, it saves the state of the machine at that moment in time so you can revert back to it in case shit hits the fan.

Set Up Vagrant:


  1. install Vagrant
  2. install virtual box
  3. make a project directory
  4. cd into directory
  5. Go to https://atlas.hashicorp.com/boxes/search to find a box
  6. Copy name of box
  7. (If a box hasn't been added) run in project directory vagrant box add (NAME i.e. ubuntu/trusty64)
  8. While still in project directory, vagrant init
  9. Edit Vagrantfile
  10. Open up vagrant file within that project directory
    • uncomment config.vm.network "forwarded_port", guest: 80, host: 8080
    • uncomment config.vm.box = "(BOX NAME i.e. ubuntu/trusty64)"
  11. Save File
  12. vagrant up
  13. Finished (Optional Steps Below for Entering Vagrant Machine)
  14. vagrant ssh
  15. cd into /vagrant folder

Operation:


  1. cd into project directory
  2. vagrant up (if not running)
  3. vagrant halt (if running)

Commands:


  • vagrant up
  • vagrant halt
  • vagrant ssh
  • vagrant destroy
  • exit (exit vagrant ssh session)

#####How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu:

#####Or use my script to do the dirty work for you!

#####Reid's LAMP Vagrant Script:

===

  1. Make sure in Project Directory which is shared in the vagrant machine
  2. vagrant ssh
  3. cd into the /vagrant directory
  4. run sh LAMPVagrantSetupScript.sh
  5. Default Passwords for everything is root & password
  6. Restart Machine (exit, vagrant halt, vagrant up)

===

  • MYSQL: root password
  • PHPMYADMIN: root password

#####Random Notes:

#####Sources:

About

Basic Vagrant Set Up Guide, including a LAMP set up script


Languages

Language:Ruby 51.5%Language:Shell 48.5%