Getting started with the uoWeb Vagrant build (Mac OS X)

Our Vagrant build allows you to work with a copy of the uoWeb distribution, in an environment similar to our servers. Learn how to work with it on Max OS X.

These instructions are written for a user with intermediate knowledge of their operating system and is comfortable working with the package manager, virtual machines, and the terminal. These steps were written for OS X 10.10 (Yosemite) and may require some modification on other versions.

Installation

Package Installation

  • Install the Java Runtime Environment (JRE) and the Java SE Development Kit (JDK). These tools are necessary to run our recommended editor, Netbeans.
  • Install NetBeans, our recommended editor, and configure it to the uoWeb coding standards. You can use another editor if you like, but you are responsible for ensuring you meet the coding standards.
  • Install Oracle VirtualBox.
  • Install the latest version of Vagrant.
  • Open the terminal and run the following commands: ## Install the PHP's PEAR library if you have not yet cd ~ curl http://pear.php.net/go-pear.phar > go-pear.phar sudo php go-pear.phar which pear # If this command returns nothing, then you will need to find out where # pear was installed (it should say in the install messages) and create # a link to it using this command. Replace /Users/yourname/pear/lib/pear # with the path to the PEAR install directory. ln -s /Users/yourname/pear/lib/pear /usr/bin/pear ## Add the drush channel to PEAR sudo pear channel-discover pear.drush.org sudo pear install drush/drush sudo which drush # If this command returns empty, you may need to find out where PEAR # has installed drush and create a link to it. sudo pear show-config # Find the PEAR Executable Directory and note the path. # Drush will be installed underneath this path. So if it shows # /Users/yourname/pear/bin, then drush can be found at # /Users/yourname/pear/bin/drush # Create a link to the drush file so that you can run it. sudo ln -s /Users/yourname/pear/bin/drush /usr/bin/drush # This should show you which version is installed now. drush version ## Install the rsync-back Vagrant plugin. # We have reports of intermittent network failures when running # this command. If you encounter these problems, please try # again until it works. sudo vagrant plugin install vagrant-rsync-back ## Make some useful directories. If you want to build sites underneath ## another directory, you can change the second command. mkdir /etc/drush mkdir ~/sites
  • You are now ready to follow the steps for creating sites using Vagrant. Here is some useful information:
    • Your host file is located at /etc/hosts and can be edited using sudo nano /etc/hosts.
    • When setting up a NetBeans project, the sites directory should be /Users/yourname/sites, unless you changed it above.
    • Sometimes, you will have to sudo vagrant commands on OS X. If you figure out how to fix this, please let us know!.
  • You're now ready to create sites using Vagrant. Here is some information you'll need:
    • Your host file is located at /etc/hosts
    • Your NetBeans sites directory is /home/your-username/sites
Haut de page