DEV WordPress on Local Network

The following tutorial has been tested & written on Ubuntu 14.04 LTS running in an Oracle Virtual Machine. The reason i stage this way is to keep my machine as clutter free as possible. When you are not using it, the VM is simply shutdown!

Steps I have taken to set up a Dev WordPress site on my Local Network (Actually Ubuntu Server running in a Virtual Machine), however the following could just as easily be applied to the Raspberry Pi (LAMP installation would be necessary and outside the scope of this tutorial). At present the following has only been tested on Ubuntu Sever.
– Referenced heavily from the WordPress Codex

  • Log into terminal as root
  • Make sure you install Ubuntu with SSH & LAMP options enabled
  • – Set the MySQL password to something memorable & secure. This wil become the MySQL ‘root’ password.

First you have to set up a MySQL user and grant necessary privileges.
Log in to MySQL on the command line using mysql -u root -p where the password is that of what you set upon install.

CREATE DATABASE wordpress;
CREATE USER wpuser@localhost IDENTIFIED BY 'password';
// Make sure the apostrophe stays around the password
GRANT ALL PRIVILEGES ON wordpress.* TO "wpuser"@"localhost" IDENTIFIED BY "password";
FLUSH PRIVILEGES;
EXIT

Make sure the ‘password’ fields above are changed to something memorable & secure. Good habit, even on a local install.

Download the latest version of WordPress to your web directory (/var/www/html/).

cd /var/www/html/
wget https://wordpress.org/latest.tar.gz
tar xvfz latest.tar.gz

As a final step you need to grant Apache privileges for the newly created wordpress folder. Failure to do this will result in the following install to fail.

sudo chown -R www-data:www-data /var/www/html/wordpress

Obviously if you are already running as root you can omit the sudo, however just a quick explanation of what the above command is doing for those not so clued up reading this tutorial. (We all need to start somewhere!)

  • (chown) Is a Linux command to change ownership of a file / folder.
  • (-R) As we are working with a directory, this applies the command recursively.
  • (www-data:www-data) Changes owner to user of group (owner-user:owner-group).
  • (/var/www/html/wordpress) The directory / file we are sighting.

Now the WordPress installation is on the server, we can navigate to 'server'/wordpress/ in a web browser and follow the famous five minute install. Remember the name of the MySQL database and user you set up previously. WordPress will give you options if any of the above steps fail.. Particularly permissions.

Following the installation completion, with any luck you should be up and running!

Raspberry Pi Static IP Address

UPDATE
– Things have changed a little with the new Jessie based image…
See my new tutorial for Jessie based systems

The tutorial below is suitable for all versions of the Raspberry Pi running a Debian based OS (Raspbian etc). Although the older Raspberry Pi’s such as Model A & Model A+ are near obsolete, the structure is the same. Tested on Raspberry Pi Model B, Model B+ & Raspberry Pi 2.

So you want to set your Raspberry Pi to have a static IP address. This is useful in so many ways whether it be for port forwarding, SSH logins or one of the many other reasons you want to have the same persistent address such as a dev server. The process described below is also the same for all debian based systems, including Ubuntu.

First of all some research needs to be done to determine current network settings so that the static address can be applied correctly. Run the following two commands

ifconfig
route -n

Console

Once the above has been run we can collect the following information
– Gateway
– Netmask
– Network
– Broadcast

Once our needed information has been gathered, network interfaces needs to be modified & networking restarted (pi rebooted). As we are working on a fresh install and to keep it simple, i am going to be using the packaged text editor – nano. Run the following command, making sure it is launched as root.

sudo nano /etc/network/interfaces

We then want to edit our primary interface so that it defines a static ip with the necessary configurations. Make sure you change the address to that of your desired static ip. Obviously make sure it is within the bounds of your network. In my case eth0 is my primary interface, however if for example your primary interface was a wireless connection, the following would be configured under wlan0 and so on.

iface eth0 inet static
address 192.168.1.199
gateway 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255

Mine ended up looking like this…

Network/Interfaces

Make sure you then save and reboot (sudo reboot).
Done!