Skip to main content

The yoobeeBox

WhyGetting are we using this?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.

 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
Ifhas created a vagrant box that you plancan onuse. justIt usingcontain thismost to runtechnology youryou wordpresswill websites,need orto host a youwebsite arefor justlocal indevelopment.
the
It's levela 5LAMP webserver &(linux, graphicApache, course,MySQL thenand itPHP) isand recommendedhas build to enable you onlyto followinstall theand thisrun tutorial.WordPress and will work with a number of other CMSs.

Setting up your server

Adding the yoobeeBox.box file to vagrant

TheThis first 3 Stepsstep only need to be followed if this is the first time you are following this tutorial on your current computer.once. If you have already done these steps on your current computer you can then skip to stepCreating 4.a new server. once a box is added it can be used multiple times.

  1. You

    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.
    Anywhere

    on

    Create a new folder in your computerhome createdirectory acalled folder. You can also make it whatever you want but for this tutorial it will be named vagrantProjects.

  2. You

    mkdir now~/vagrantProjects

    need to get

    Grab a copy of the file needed to create the vagrant box.
    Thebox easiest place to get this isfile from the yoobee servers on your computers. If you are on your own computer you will still need to get a copy of this file.
    It is located at either

    • smb://natcoll.ac.nz/student/WE/Resources/Vagrant
    • smb://natcoll.ac.nz/student/WG/Resources/Vagrant
    In those folders you will find a file called yoobeeBox.box. Take a copy of that file (do not remove it)server and place it somewhere on your computer,desktop. easiestYour placetutor will beexplain yourwhere.
    The desktop.
  3. file
  4. Openis upnamed theyoobeeBox.box

    program terminal

    We need to add this .box Youfile willto beour usingvagrant theso commonwe commandscan whichuse areit listedto above.
    Typecreate ina thenew followingdevelopment linesenvironment.

    vagrant box add yoobeeBox “path to the yoobeeBox.box file”
    The
    easiest
    way to get the path to the file is to drag the file into terminal. An

    example of the line is

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

    If

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

  5. Creating a new server

    Go to the folder you created in step 1 (vagrantProjects) and create a new folder in there. You can create as many folders in here as you want. Each folder will represent a different server. The more servers you have, the more disk space will be taken up on your computer. So you need to actually think about if you need to create a new server for your current project, or just use an exsisting one.
    In this example we are going to create a folder called server1

  6. Go back to terminal.
    You need to navigate your way into that folder you just created. By default it will open up in your root directory of your computer. Using ls (list directory) and cd (change directory). Move into your folder.
    An example can be like this:
    cd Desktop 
    ls Desktop 
    cd vagrantProjects 
    ls vagrantProjects 
    cd server1

  7. this moves you into the folder called server1. Until you get confident in terminal, it is recommended that you type ls after you change directories just to check you are in the right place. You should see a list of all the folder and files in that current directory.

  8. Once you are inside that folder we need to initialize the vagrant server. Type out
    vagrant init yoobeeBox

  9. This should create a file called VagrantFile inside that folder. You can type ls to check.

  10. If the VagrantFile exists, type output
    vagrant up

This will start the creation of the server. It might take a while the first time you do it but just wait and it should eventually finish.
If if says that it is trying to disconnect and reconnect, then don't worry, it should eventually connect if you followed all the previous steps correctly.
If for some reason it doesn't, then you have done something wrong in the steps above.

You should know that it has finished when you can type into terminal again. Or if you see the line Mounting shared folders... and there are two lines bellow it.

  1. If you now open up an internet browser and go to 192.168.33.10. You should see a website with the first heading saying Index of /
    This means you were successful in creating a vagrant server using the pre build yoobeeBox.box file.
    If you have a look inside your server1 folder, you should now see a new folder called www. Inside that folder you can add new files and folders and you should see them listed when you go to the url mentioned above.

Closing your server

When you have finished for 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 the folder for the server which is currently running. 
Type.

vagrant halt

This will turn off your server.

Turning on your server

When you want to turn your server back on. All you need to do is open up terminal again and make sure you are inside the folder for the server which is currently running. 
Type out

vagrant up

This will turn it on again. Just like in the set up, it might take a while but as long as it has worked before it will connect.

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