Skip to main content

The yoobeeBox

Getting started

When using computers, sometimes we aren't the admins and cannot 100% control what we can do. Sometimes non admins can't even add files or folders to specific parts of the computer. This is the case at Yoobee.

Using Vagrant and Virtual Box, we will be able to make a virtual environment on our computers which we will have complete control of.

Common terminal commands

  • To List your current directory, type ls.
  • To switch directories, type cd followed by the name of the directory.
  • To make a directory, type mkdir followed by the name of the directory you want to make.

Using the Pre Build Yoobee Box

Yoobee has created a vagrant box that you can use. It contain most to technology you will need to host a website for local development.
It's a LAMP server (linux, Apache, MySQL and PHP) and has build to enable you to install and run WordPress and will work with a number of other CMSs.

Setting up your server

Adding the yoobeeBox.box file to vagrant

This step only need to be followed once. If you have already done these steps on your current computer you can then skip to Creating a new server. once a box is added it can be used multiple times.

We need to create a place on your computer where you will hold all of your virtual servers.
You can create as many as you want but it is recommended that you keep them all together.

Create a new folder in your home directory called vagrantProjects

mkdir ~/vagrantProjects

Grab a copy of the vagrant box file from the server and place it on your desktop. Your tutor will explain where.
The file is named yoobeeBox.box

We need to add this .box file to our vagrant so we can use it to create a new development environment.

vagrant box add yoobeeBox “path to the yoobeeBox.box file”

example vagrant box add yoobeeBox /Users/0123345/Desktop/yoobeeBox.box

When finished, you can then remove the yoobeeBox.box file from your computer.


Creating a new server

Create a new folder inside our vagrantProjects folder. This will be where or new server lives.

mkdir ~/vagrantProjects/newServer

Each folder created will represent a different server.

In the terminal navigated to the new servers folder.

cd ~/vagrantProjects/newServer

Once you are inside that folder we need to initialise the vagrant server.

vagrant init yoobeeBox

This should create a file names Vagrantfile inside that folder. us ls to check that it exists. if does we can start the new server.

vagrant up

This will start the of the server. It might take a while the first time you do it. Just wait and it will eventually finish.
It may says that it is trying to disconnect and reconnect, don't worry, it should eventually connect if you followed all the previous steps correctly.

Once finished your new server will be accessible in a browser using the URL  http://192.168.33.10/.

you should see something lie this:

This means you werehave successfulsuccessfully in creatingcreate a vagrant server using the pre build yoobeeBox.box file.
If

you
have

vagrant acommands

look

Vagrant insidecommands youroften server1relate folder,to you should now see a new folder called www. Inside thatthe folder you canare addcurrently newin, files and folders and you should see them listed when you go toin the url mentioned above.terminal.

Closing

vagrant yourup Will start a server

When you have finished forin the day and you are ready to turn off your server. All you need to do is open up terminal again and make sure you are inside thecurrent folder forif thea serverVagrantfile which is currently running. 
Type.exists.

vagrant halt Will stop a server in the current folder.

Thisvagrant willreload turnWill offrestart a server in the current folder.

Halt your server.server before you log out or restart your computer. Reload your server if it's not functioning as expected


TurningUsing on yourthe server

WhenThe youfirst wanttime towe turnused yourvagrant up in out new server backfolder, on.a Allnew youfolder neednamed towww dowas created. This folder is openthe up terminal againweb androot makedirectory surefor youour areserver. insideFiles placed in the folder for the server which is currently running. 
Type out

vagrant up

This will turnbe it on again. Just likedisplayed in the setbrowser. up,an itin mightthe takeroot of this folder index.html will be displayed first.

Vagrant is a whilevery butpowerful astool longyou ascan itlearn hasmore workedby beforereading itthe willdocumentation connect.

here

https://www.vagrantup.com/docs/