Posted on

Creating A Self Contained WordPress GUI Dev Box

After a few days of doing a whole lot of nothing as I recover from surgery I decided that it was time to start doing some computer hacking.   I’m not nearly as tired today as I have been.    The post-surgery cobwebs are mostly gone and I’m thinking clearly enough to do some productive computer work.   I’m still not 100% so staying away from code for another day may not be a bad idea.   I figure creating an upgraded WordPress Development Kit box has no chance of wreaking havoc on my published WordPress plugins.   Today is going to be an “upgrade my virtual development environment” day.

The task at hand?   Upgrade my WordPress Development Kit Vagrant box.

The original box runs a fully self-contained GUI development box on CentOS 6.5 running a local version of WordPress 3.9 with some PHP developer tools like NetBeans at-the-ready.     This makes it easy to “pack up and move” my entire development and testing system and bring it to any laptop that can run VirtualBox.     This also gives me a solid baseline to get new developers started with the same exact tools and user experience which expedites the process of getting new people online with helping code the WordPress plugins.

Today I am upgrading the WP Dev Kit Box to run on CentOS 7.     CentOS 7 has an upgraded desktop GUI and, more importantly, is virtualization-aware with built-in OS-level tools that detect when it is running as a VirtualBox guest.   It should make for a more seamless experience when going between the virtual guest box and the host system.   I’ve also moved my development over to phpStorm versus NetBeans so an eval copy of phpStorm will be installed along with the latest free version of NetBeans.   SmartGit and grunt will remain as part of the plugin development toolkit.    WordPress will be the latest production version of 4.x.

Guest System Specifications

  • CentOS 7 with GUI
  • 2GB RAM
  • 20GB dynamic HDD
  • 4 CPU cores
  • 1x 32MB video at 1440 x 1050 resolution
  • no audio
  • USB 2 support
  • NAT networking
  • Bidirectional clipboard.
  • Bidirectional drag-and-drop.
  • Port Forwarding localhost ( port 4567 to guest port 22 (ssh).
  • Standard vagrant user credentials.

Augmenting Minimal Setup

The box is installed using minimal install for CentOS 7.  The following elements have been updated to get to a standard WordPress plugin development environment:

  • vim installed
  • gvim installed
  • vagrant user added to sudoers file
  • GNOME desktop added
  • Graphical Admin Tools added
  • GUI runlevel (5) set as default
  • Install VirtualBox guest additions
  • Run the software update for all packages to 19-Oct-2014
  • Added the vagrant “base box public key” to the authorized keys file (allows vagrant scripts to run commands)

CentOS 7 GUI Base Box

The above configuration, without the developer tools like NetBeans, phpStorm, SmartGit, and Grunt nor the WordPress install is published as the “CentOS 7 GUI Base” box on VagrantCloud.   It is this foundation on which the WP Dev Kit Box will be built.

CentOS 7 WP Dev Kit Box

Now that the base GUI box is built it is time to layer on the WordPress system and development tools.  The following items are added to the mix:

  • Install PHP and PHP MySQL library.
  • Start httpd web server at boot (note: CentOS 7 uses the systemctl app to configure startup apps)
  • Install MariaDB (public domain MySQL branch) and set to start at boot.
  • Disable SELinux
  • Create the WordPress database.
    • database name: wordpress
    • database user: wpuser
    • database password: wppasswd
  • Install WordPress 4.0 and activate up to the “Enter site title, admin username, admin password” stage.
  • Install git
  • Install SmartGit 6.0.7 eval
  • Install NetBeans 8.0.1 HTML & PHP configuration
  • Install phpStorm 8.0.1 eval
  • Add Selenium IDE with GoTo lib, LastPass, and FireBug extensions to Firefox.

The WP Dev Kit box is also available in the Vagrant Cloud