Tag Archives: php5

Setup a backup job for your LAMP sites. | Setup a backup job for your LAMP sites.

I wrote a script which takes a backup of my webserver, taking a snapshot of all the website content, database, and configuration files.

Theory is if the webserver died, we would be about to result quickly using the data backed up.

On the server, put the following script and below is the cron entry which triggers every week. You will need up change the username and password for your mysql server.

This is the cron entry which fires up every friday.

Now this script will be on a linux machine somewhere else, it will connect and copy the backup archive file generated. You must first setup the ssh key so that its passwordless connection.

Simplicity it key! It works and will get you out of trouble. Well worth the 5minute investment.



Installing and configuring MediaWiki on Raspberry Pi 1 | Setup mediawiki on a raspberry pi 1

MediaWiki is the software used by Wikipedia run, its a fantastic way to document share.

I would recommend installing DNSMasq to allow as to use fully qualified domain names. See here.

Setting up Mediawiki is a pretty simply task, does not really require a high level of experience. Lets dig in, install software.

Once completed we start setting up the housing for MediaWiki, the following will also download the software from MediaWiki’s site and unzip it.

Then we’ll need to setup the database and user permissions.

Now we’ll begin the Mediawiki installation, easy part. Navigate to the following URL and start the point and click install.

Once connected you’ll see this.

Click on the “Set up the wiki” link, follow the instructions and enter all the information it requires. Take note, youll need the database,username and password we input earlier. Once it has finished it will let you download the LocalSettings.php file to your computer. You’ll need to upload it to the /var/www/html/wiki directory.

Lets create the DNS entries.

Insert the following line

Now restart DNSMasq

We also need to setup the virtual host in apache

Insert the following line

Restart apache.

Make sure your connected to the AP while your setting up, otherwise the setup will use the LAN IP to setup the config file.


Ubuntu installing and preparing Apache2 and PHP7 | how to install and setup apache2 and php on ubuntu

I spent a bit of time this morning setting up apache2 and php, things have changed in the newer versions of Linux.

The following will install apache and php.

This will test if PHP is install and running on the command line.

This will check if the PHP modules are loaded in apache.

Save the following file in the following location.

restart apache

in your web browser navigate to

You should see something like this.



Building a weather station Raspberry Pi 3 IOT | Raspberry Pi 3 weather station weewx IOT

I wanted to build a weather station located at my holiday house, functional reasons were to know when it hasn’t rained in a while so I knew if the garden needs watering.

The nerd in me just wants everything to be network enabled.

The components I used,

  1.  Acurite Pro 5-in-1 Color Weather Station with Wind and Rain
  2. Raspberry Pi 3

The setup was very simple and quick to set up!

Lets get started!

After installing the weather station somewhere around your house and switching on the base station. You should now be able to see the weather at the base station, information such as rain, temp, humidity etc should be flowing.

Now connect the base station to the raspberry pi via the USB cable.

SSH onto the raspberry pi, to check if we have connectivity do the following.

When you see the device we have connectivity.

Bus 001 Device 005: ID 24c0:0003

How to configure the server and install the software, in this setup we’ll be using weewx for our communication with the weather station and data gathering.

Then navigate to the raspberry pi IP address through your web browser.