Websites – James Batchelor https://james-batchelor.com Useful I.T & VoIP Ramblings Sun, 09 Nov 2025 15:38:07 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.5 https://james-batchelor.com/wp-content/uploads/2025/05/cropped-cropped-logo-jb-202505-32x32.png Websites – James Batchelor https://james-batchelor.com 32 32 Migrate Zabbix/Grafana to new server https://james-batchelor.com/index.php/2025/11/09/migrate-zabbix-grafana-to-new-server/ Sun, 09 Nov 2025 15:38:07 +0000 https://james-batchelor.com/?p=1067 Continue reading "Migrate Zabbix/Grafana to new server"]]> I’m in the process of migrating hypervisors and the time has come to move my Zabbix instance that monitors my network, and Grafana that I use for dashboard displays.

Instead of a backup and restore of the VM, it seems the right time to migrate Zabbix and Grafana from an aging RHEL 8 instance to a new VM running a fresh copy of Debian 13. At the same time upgrading the applications to their latest versions…

Zabbix

New Server: Preparation

Begin by installing a LAMP stack on the new server:

apt install mariadb-server apache2 php php-mysql php-bcmath php-mbstring php-xml php-ldap php-json php-gd php-zip curl gnupg lsb-release

Then setup the basic configuration of MariaDB:

mysql -u root

ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';
DELETE FROM mysql.user WHERE User='';
DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');
DROP DATABASE IF EXISTS test;
DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%';
FLUSH PRIVILEGES;

To give it somewhere to migrate to, install a fresh, blank copy of Zabbix on the new server. The latest version can be used and is available on the Zabbix website, as the application will detect and auto upgrade your exisiting data (So long as a direct upgrade path between versions is supported).

As an example with version 7.4, first add the Zabbix repositories:

wget https://repo.zabbix.com/zabbix/7.4/release/debian/pool/main/z/zabbix-release/zabbix-release_latest_7.4+debian13_all.deb
dpkg -i zabbix-release_latest_7.4+debian13_all.deb
apt update

And install Zabbix:

apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent2

If following the install intructions from the Zabbix website, stop before starting the service. Instead, we’ll first pull and import the database from the old server…

Old Server: Export database

On the old/source server, temporarily stop Zabbix server:

systemctl stop zabbix-server

Now dump the database to a file. As this old server only ran Zabbix, we’ll dump the whole MySQL instance to preserve users and settings which will make migration easier.

If yours is more complex, dump just the Zabbix database and recreate the users manually on the new server.

Export the whole MySQL instance:

mysqldump -u root -p --all-databases > mysql.sql

When it completes, restart Zabbix on the old server, just incase you’d need another go at it later.

systemctl start zabbix-server

New Server: Import

Back on the new server, pull the exported database locally:

scp root@{old-server-ip}:/root/mysql.sql .

Also grab the configuration files of the old server, it’ll come in handy later:

scp -r root@{old-server-ip}:/etc/zabbix/* .

Import the copied database:

mysql -u root -p < mysql.sql

If importing an “–all-databases” export, the newly added users need to be commited before they can be used.

Note that after executing the below, the root credentials will be overwritten by those of the old server:

mysql -u root -p
FLUSH PRIVILEGES;

Next is the configuration file. I would recommend comparing the old and new /etc/zabbix/zabbix_server.conf files, and updating the new .conf to match the old rather than just copying the file.

nano /etc/zabbix/zabbix_server.conf

Now, its time to start Zabbix:

systemctl enable --now zabbix-server

Checking for any errors can be made by monitoring the log file:

tail -n 100 /var/log/zabbix/zabbix_server.log

Soon after starting the service you’ll notice a database upgrade completing in the file, this is Zabbix automatically upgrading your old data to the newly installed version, neat.

Visit the Zabbix web interface on the new server:

http://{new-server-ip}/zabbix/

You’ll be greeted with the setup wizard, follow the steps on screen to complete.

Don’t worry, Zabbix is running and logging now data to your existing Zabbix hosts, this wizard simply creates the /etc/zabbix/web/zabbix.conf.php file.

Once the wizard is completed, you’ll return to a familiar yet updated interface via the new server.

Zabbix Proxy

If the migration involves a major version change and you’re using proxies, the dashboard will quickly flag a problem with the proxy version being incompatible.

On the proxy, you’ll need to update the application by setting the associated version in the repositories and installing the updated version.

Using a Rocky 8 install as an example, add the updated repo:

rpm -Uvh https://repo.zabbix.com/zabbix/7.4/release/rocky/8/noarch/zabbix-release-latest-7.4.el8.noarch.rpm
dnf clean all

Then install the updated version:

Install
dnf install zabbix-proxy-mysql

Restart the service, and it will be up to date:

systemctl restart zabbix-proxy

Grafana

Migrating and updating Grafana is much the same process as Zabbix, if a little easier.

Install Grafana, on Debian 13 it is available from the main repository:

apt install grafana

Pull the required files direct from the old server to the new:

scp root@{old-server-ip}:/etc/grafana/grafana.ini .
scp root@{old-server-ip}:/var/lib/grafana/grafana.db .

Overwrite the installed files with the ones pulled from the old server, and set the correct permissions:

cp grafana.ini /etc/grafana/grafana.ini
chown root:grafana /etc/grafana/grafana.ini
cp grafana.db /var/lib/grafana/grafana.db
chown grafana:grafana /var/lib/grafana/grafana.db

Before starting, install any plugins used on the old server, for example:

grafana-cli plugins install alexanderzobnin-zabbix-app
grafana-cli plugins install grafana-clock-panel

Now Grafana can be started:

systemctl enable --now grafana-server

And visit the web interface:

http://{new-server-ip}:3000/

Where you can pick up at where you left on the old server.

]]>
10 years of website logs, and the resulting nostalgia trip https://james-batchelor.com/index.php/2025/09/28/10-years-of-website-logs-and-the-resulting-nostalgia-trip/ Sun, 28 Sep 2025 09:31:15 +0000 https://james-batchelor.com/?p=1051 Continue reading "10 years of website logs, and the resulting nostalgia trip"]]> This week I noticed a little milestone; my current iteration of website logs had clicked over to 10 years’ worth of accumulated statistics.

While I’ve been self-hosting websites since 2002, it wasn’t until 2015 that I started making a conscious effort to backup and retain web logs during server reinstalls and migrations.

To create statistics from these logs, I’ve been using Analog since around 2004. A simple parser that dates back to the early days of the internet and remains wholly unchanged for many decades.

This milestone prompted a nostalgia dive into the archives to see how far back I can go, uncovering Analog output from 2004, and an historic look on how the internet has changed over the last 20 years…

History

Since getting online in the late 90’s, I had always found the concept of networks and being able to access servers and web content from anywhere in the world absolutely fascinating.

I dabbled in html in the early years, creating my stake on the internet using Yahoo GeoCities. So, when given the opportunity to build a website for my friend’s music band, I wanted to create something bespoke; something that included social interaction, but being fully integrated to the website and importantly, without adverts.

Back then, to do this for free would involve creating a guestbook on a 3rd party site such as Lycos, among the other web tools that were rife at the time. Hosting dynamic content was relatively involved and not inexpensive, so providers such as Lycos would offer to do this for you, and support it with adverts. I’ve touched on this a while back following the end of Lycos. LINK

My solution, host the web server myself! The rational was that using my own server I could serve dynamic content and fully integrate it into the website. The catalyst was recently getting an “always on” internet connection in the form of cable internet in 2001, and that my first PC was made obsolete by the introduction of my second PC.

In 2002, using my first PC, Windows NT 4.0 Server, a dynamic DNS service, and purchasing a Netgear RT311 router, I started self-hosting.

Logging

The thrill of self-hosting came from the IIS logs, constantly reviewing them to see connections from around the world requesting files from the box in the corner of my room.

Analog, the web log parser came along as an evolution to this, allow consolidation of the logs into a single web page for easy reference and wonder. The more the logs grew, the more the statistics grew and the trends started to develop and reinforce themselves.

Analog has been around since 1995 and is largely unchanged, but still receives periodic maintenance updates from the C:Amie Edition.

10 Year Trend

Starting with the 10 year view, these are my points of interest for the modern internet, from this website’s perspective…

Traffic exploded during lockdown

Page requests and visits really took off in 2020, seeing over a five-fold increase in traffic from June 2020. Its unsure if it was a popular post, or the Google algorithm looked favourably on my site, but people sure had a lot of spare time around this period.

Self-hosting shielded bot access

I’ve recently moved away from hosting directly from home (more in a future post) and since moving presence to a commercial VPS service I’ve seen an uptick in visits. This should be good news, but a deeper look at the logs and the increased traffic is from malicious bots, targeting the common WordPress vulnerabilities. These bots must target IP ranges of established hosting providers.

Domains mean nothing anymore

Back when I started viewing Analog reports, the domain report was my way of gauging where in the world a visitor is from. Since then, the boundaries of domains have blurred drastically, and more used for vanity rather that identification. For example, have I really had 13722 visits from .vn (Vietnam)?

Cloudflare ruins logs

While hosting from home, I used Cloudflare as a proxy for a thin veil of security against exposing my IP. This had a detriment to the logs in the form of caching, where Cloudflare would serve a page rather than my server, and so not getting the log of the transaction. This caching also did register as a noticeable drop in traffic.

Bots, bots everywhere

Back in 2004, I only need worry about web crawlers scraping and indexing the site. Today, anyone can use a cheap VPS or commercial VPN service to anonymously attack and brute force a site it has become an epidemic. Now, my highest failure reports come from other hosting services.

Operating Systems

Finally, did someone really try to visit this site on a RISC OS system or even an Amiga?

20 Year Snapshot

Turning the clock back 20 years to my hosting infancy, I found an old report buried in a website backup, again, parsed by Analog.

Granted, this is a snapshot of from a much-reduced sample period, but in honesty, believe the real human visitor count is on par to what this website is now. Albeit catering to very localised content.

Hourly trends were what you expect.

This may be highly skewed by the localised content of the site at the time, but what struck me was the predictability of when users were visiting the site. With a sharp drop during the early hours and peaking in the evening. An indication that these were real visitors.

File requests were easier to understand.

A benefit of creating the website yourself. With the exception of forums, off the shelf applications such as WordPress were yet to materialise. Therefore, the file request reports were easier to decipher and to identify popular sections.

Data transfer was at a premium.

Self-hosting relied on using your home connection to serve pages to the world, and given that most home internet connections are asynchronous, you had to make the website as efficient as possible.

During this snapshot, while I had a modest 600kbps downstream bandwidth, the upstream utilised by visitors was just 128kbps.

Operating Systems

More nostalgia than a trend, but this complete list of OS visitors takes you back.

Summary

While a delightful look back, both at the web logs and the website files the discovery was bundled with. It makes you want to go back to those simpler times.

]]>
Restoring a Joomla website https://james-batchelor.com/index.php/2018/11/21/restoring-a-joomla-website/ Wed, 21 Nov 2018 14:27:56 +0000 http://james-batchelor.com/?p=576 Continue reading "Restoring a Joomla website"]]> From time to time we come across legacy applications and deployments that you didn’t know exist until something goes wrong with it. This week it was an unbeknown to me Joomla website that had been ticking over since 2012. However recent visits to the site got this result:

A report came in on this issue and a few checks of the domain DNS revealed it was on a platform we use for domains and web hosting.

Not overly familiar with the hosting company from a website standpoint and even less with Joomla, it was time to first fathom out how it works, and them find the problem and fix

At this stage of the initial report there’s not much that can be investigated on the fly as the whole website was offline. The only clue of the website showing a forbidden error when visiting suggests that there is a permissions conflict o the web server. Having access to the files, this could be tested by trying to browse to specific image files by using the directory path as the reference, however every file tried returned a 403 Forbidden error.

Joomla

The file structure had a lot of references to Joomla, and this was found to be an alternative blogging platform to WordPress. During the website’s commission in 2012, it seemed a choice between Joomla and WordPress, however with hindsight it seems the WordPress won the war. Essentially it’s pretty similar with an administration portal and driven by PHP and a MySQL database.

Of consideration from my experiences of WordPress is the number of updates a site will need over a year due to the vulnerabilities that constantly crop up, noting that the site has not been touched in the two years that I’ve been here, it could have been knocked offline as a result of an exploit.

With this is mind, I had to confirm that behind the 403 error was still a functioning website that could be restored.

Restoring to a New Server

Wanting to see if the site was still there and concerned about vulnerabilities, a fresh install of Windows Server 2012 in a VM was created to download the site and test.

In Windows, the Internet Information Services role was added, and the Web Platform Components 5.1 installed on top.

As a Joomla site is PHP and MySQL, I find the quickest way to get these installed and integrated with IIS is to install a new instance of Joomla via the Web Platform Installer, as it will also install all required packages in order to run on a Windows Server.

The WPI is followed to get the MySQL database and other components installed, the opening of the Joomla setup webpage is as far as is needed to go.

Adding the Website

A copy of the public_html files were restored to the emptied C:\inetpub\wwwroot folder so it can be run by the IIS default website,

To get the SQL database restored easily I used HeidiSQL, this is a great alternative to the go to MySQL Workbench CE, especially as I faced incompatibility issues with SQL version numbers and kept receiving “Bad Handshake” errors when connecting with Workbench.

In HeidiSQL, log in via the credentials entered during the initial Joomla setup. Create a new database in the left hand pane and name it the same as the backed up database.

Then with the database highlighted, choose File > Load SQL File, select the backup .sql file and open, when prompted choose to run immediately. The table structure and data will now import to the database.

Next was to create a user for the website to connect to the database, in Tools > User Manager, add a new user and give it access to Global Privileges.

Connecting

With the fundimentals now in place, the last step is to reconfigure the Joomla site so it connects to the newly restored database.

In Joomla, the database connection settings are stored in configuration.php located on in the root folder. Open this file in a text editor and amend the $user and $password fields to match the user created in HeidiSQL.

As in this instance the MySQL server and web server are on the same machine, $host can be changed to ‘localhost

Now is the moment of truth, open a web browser on the server and navigate to http://localhost , deep breath encouraged.

Result

To my surprise it was actually there, and visibly intact. While the issue is not solved I at least know that I still have something to work with, and can continue working out what went wrong.

This also confirmed that it was indeed a permissions issue on the live web server, but without access to this it was time to raise a support ticket with the web space provider.

Update

Turns out from raising the support ticket the suspicions of an exploit reigned true. The website was blocked from the web by the provider as it was reported for being involved in a phishing attack, and it would have been nice to be notified of this!

A quick clean and a lot of patching later the site is now unblocked and back online.

]]>
Find the True Speed of Your Website https://james-batchelor.com/index.php/2016/11/10/find-the-true-speed-of-your-website/ Thu, 10 Nov 2016 19:16:16 +0000 http://james-batchelor.com/?p=505 Continue reading "Find the True Speed of Your Website"]]> When running a website from a home server, viewing it locally will make it seem that the site is responding lightning fast and there are no issues. But what about the outsiders wanting a look at your content, are they getting the same performance? Chances are they are not, as a visitor’s machine needs to negotiate the internet and its equivalent of back streets and country roads to get to the home server’s location.

Where a home server can differentiate greatly from hosted solutions is the speed and relative location on the net. Visitors who view a website relies on the upstream connection at the server end to receive the content, and when this is via domestic internet connection the upstream can much smaller than the heavily advertised downstream connection. So it’s worth checking the theoretical upload speed to establish what kind of service and content can be served.

Viewing your website on a local network compared to the internet.
Viewing your website on a local network compared to the internet.

In terms of location, hosting companies are as close to the internet backbone as feasibly possible to get the best speeds and lower latency. The backbone of the net is handled by major operation companies that handle the bulk of all internet traffic between countries and continents, these in turn have datacentres where the traffic from countries are trunked to the different internet providers and down to the end user. As data makes its way from the backbone to the end user, it can hop between different servers as it meanders towards the final destination. For each hop the networking equipment has to read where to send it on, and route it on the right path. This all takes time, even though it is measured in milliseconds, an extended number of hops and the volume of data packets needed may produce a noticeable wait for a user to see the desired page.

All home user’s computers need deal with negotiating its way through the service providers’ local infrastructure to get to most sites, but when visiting a site hosted on a home server, data may need to navigate another service providers’ network to reach the site. This is where visitors may experience slower loading times compared to mainstream sites.
So how to tell if your home hosted website will be speedy when out in the wild? There’s a few different ways to check:

DIY Simulation

Firstly, let’s address if the upstream connection may be a cause of concern. Start by finding out the true upstream connection speed, this can be achieved by both running an online speed check and noting down the upload/upstream speed. Alternatively look around the modem’s setting pages to establish the theoretical maximum upload speed.
Then use the developer tools that come with most popular web browsers to simulate loading the site with the upstream bandwidth that may be available to visitors. In the browser, using Chrome for this example, press F12 to bring up the developer tools. Then click on the Network tab and choose the No Throttling button. There are a number of pre-sets available but to get the best scenario, create a custom profile.

For the new profile, your upload speed will become the profiles downstream speed, and your downstream speed can be the upload speed, latency is also important, and where the use of Dynamic DNS can really slow a connection down. To find out a realistic latency value, perform an online ping test to your own domain, and choose a latency value based on the results.

Developer tools are available on most browsers.
Developer tools are available on most browsers.

Hit F5 to refresh the page and watch how the site loads from an outside visitor’s perspective. The graph created in the developer tools gives insight into what elements of the page loaded and when. Interesting to note is the top row entry with the URL to the chosen page, as this is the time the visitor would have waited before seeing any text or loading action on their screen. It’s critical to get this quickly as with the increasing speeds of the internet, end users will quickly dismiss a site as being not available within a single second of not seeing any new content on screen.
This method is great when updating a site as it gives instant insight to how the page will load for visitors with any page change impacts can be viewed on the fly.

Third Party

The second option is to use a third party, a service that is already out in the internet wilderness and able to provide detailed insight to website loading times. This gives advantages over browser simulation as the virtual visitor is an actual machine on the internet, so any delays that a real visitor will have can be observed. But be aware that these services are servers themselves, and therefore may be closer to the internet backbone than the typical home visitor. Even though it’s a great tool to use periodically to gauge how the site is performing.
I prefer to use webpagetest.org to check my site, as along with bar graphs that display loading times for individual elements, it also gives the option to view a video that visually simulates the loading times just like a real visitor to the site would.

third-party
Third party tests give more control over server locations.

Get Mobile

A third and simpler option is to just find another computer away from the local network and visit the website to get a feel for loading times. I’ve used this in the past and it does indeed give a good indication of speed of load. However, be aware that the biggest skew point of this method is the choice of internet service provider, if the internet connection of your test computer and home server is via the same provider then the data would need only travel through its infrastructure creating a false speed advantage, not to say that it’s incorrect. If a site was to target users of the same ISP in the same locale then this would be considered an advantage, but does not provide an accurate sample of the wider user base. If the test computer was on a different ISP infrastructure, this is a better simulation as packets would still need to go to a datacentre to transfer between companies, much like it would for users over a country regardless of location. But be aware that this method is based on best case scenario.

And thanks to the steer to mobile devices, a public Wi-Fi or mobile data can be used to test a website. Cellular networks will definitely use a different infrastructure to the one the home server resides on, but less chance on public Wi-Fi. But with all networks and especially with public ones your test data may be competing with many other users locally, that can negatively affect the results.

]]>
Review: Gigabyte Brix GB-BXBT-3825 https://james-batchelor.com/index.php/2016/07/16/review-gigabyte-brix-gb-bxbt-3825/ Sat, 16 Jul 2016 19:07:28 +0000 http://james-batchelor.com/?p=426 Continue reading "Review: Gigabyte Brix GB-BXBT-3825"]]> Let’s hope three servers is a charm, as its time for a new server. But this time I’m moving away from the HP Microserver. Why? Well the new server is destined to be a dedicated web server for my sites, ever concerned with security and protecting my network I thought it wise to separate the public facing websites physically from my data, adding an extra layer of security.

The choice was to go for a NUC based machine or Nettop, their small footprint allows them to be placed out of the way, plus they are in keeping with my low power requirements and often fan-less design keeps them quiet. As it’s to be a web server only, the restrictions on a device this size such as space for multiple hard drives, graphics performance and upgradability are not an issue.

Gigabyte Brix GB-BXBT-3825 I decided on a Gigabyte Brix GB-BXBT-3825, with the allure being the price of a mere £64 for a barebones system. With an Intel Atom E3825 Dual Core running at a constant 1.33Ghz the fear is it would not make a competent workstation PC, but should do fine for my intended role. What made it sweeter is that the required components to complete it, memory and a hard drive, was already in my possession from laptop upgrades. However, that did not go as plan is the memory required was DDR3L 1.35Volt, whereas I had a 1.5V variant. Therefore, I splashed out on 4GB of Kingston Value RAM and added a 120GB OCZ Trion 100 SSD to make the machine silent, the choice of SSD may have been overkill as the board only supports 3Gbps, so unable to utilize the drives full speed.

Gigabyte Brix GB-BXBT-3825

More on the Gigabyte Brix, on first impressions of a machine of this type it is a small machine, which impresses when there are similar models available that contain desktop class processors. Access to the innards is easy with the removal of 4 screws on the underside.

Once inside, you’re met with a single board with easy identifiable and accessible 204 pin Ram slot, no need to do so but a curious look at the other side revealed a large heatsink covering almost the entire board, confirming that it is passively cooled. Also on show is a mini-PCIe slot populated with the Wireless / Bluetooth module, this in theory could be replaced with a M.2 SSD but the lack of mounting points will make securing it in place a tad tricky.

Gigabyte Brix GB-BXBT-3825
The case lip makes the hard drives fiddly to install.

The only cable on view was for the 2.5 inch SSD/HDD, with the drive being secured on the base plate. This is where the design had a few quirks, the SSD can be slid inside the case and screwed in, but to plug it in requires the cage to be removed as the base lip obstructs its insertion. Also underneath the cage are two foam pads for dampening vibrations, a nice touch but the cage is screwed in metal to metal, which in my view just negates the point of these. Putting the machine back together requires some guesswork, what with it being square and only fitting one way, with no visual cue to help.

The true issues started when powering on, taking a few attempts to find the BIOS screen, a bit of research found that the board uses the VGA for display by default, so my HDMI connection was hit or miss. With the operating system installed first impressions were that it was slow, for £64 this was expected, but comparing it to my HP Microserver N54L with an ageing AMD Turion 2.2 Ghz, another low power processor my assumption led me to believe that the newer architecture would bring speed improvements, I was very wrong.

Getting on to its intended purpose as a web server, for a low traffic site like my own it works just fine, with unnoticeable latency when rendering PHP and ASP.Net pages. Logging in via a RDP connection it took a while before Server Manager Loading was complete, but after that navigating was as smooth as the HP Microserver.

Update

Alas, here comes its biggest pitfall, after 32days of use, the unit completely died. A basic requirement of a server is for it to be reliable, and I only noticed when the port lights on my network switch were extinguished for the Brix. Luckily I had not put the server into production as I would have caused considerable downtime. I want my servers to be reliable and since this event, a replacement Brix unit would not put me at ease.

If you’re going to name your product Brix, then making sure it doesn’t brick should be doubly important, it’s just too easy to make a joke!

]]>
New Website: Canton TV https://james-batchelor.com/index.php/2016/04/25/new-website-opportunity/ Mon, 25 Apr 2016 16:40:12 +0000 http://james-batchelor.com/?p=393 Continue reading "New Website: Canton TV"]]> In January I was given the opportunity to design and build a new website to help colleagues in the retail store where I worked. This website serves as a demonstration on how I took my website and server knowledge to create a low cost solution to an issue I was confronted with.

This occurred when working in a retail store but can be re-purposed to suit other needs.

cantontv

What I came up with was Canton TV, a website written in ASP.NET C# and hosted on my home server, it served as a tool for colleagues of varying technological skills create messages and upload images for display in video format on screen in a communal area of the store.

Read on for the full story…

The Premise

During a store meeting the subject of communication amongst staff was brought to light and management were tasked to find a way to address this. An idea suggested was to have a digital display in a high traffic staff area (Near the Clocking machines) that could show information on upcoming events, celebrate success and an update on current store performance.

The caveat was that it had to be implemented for as little cost as possible; thankfully the store stocked a line of television on special offer that had media playing capabilities. So this and a USB flash drive could be written off the stock records to facilitate this, but nothing more.

Not being able to acquire any more hardware, the next challenge was getting content onto the display. The process for creating content needed to be accessible for users with a varying range of IT capability, so converting PowerPoint slides to jpeg manually would be out of reach for many of the user base.

Another issue was in finding a device to create content, security restrictions to the in store computers prevented installing software, ruling out 3rd party software as an answer.

The Solution

Calling on my previous experience, I put forward a plan to create a website that would take the user input, format the information into a visually appealing display, and serve a file that can simply be transferred to the USB drive ready for display.

This satisfied a number of issues faced. Firstly a sympathetically laid out website will accessible and useable by anyone wanting to use it, plus the flexibility of designing a layout of a site means I can adjust it to suit the user’s needs.

A website also negates the need for client based software, circumventing the restrictions on the store computers and allowing all the machines access to the application. Plus with use of a USB adaptor, Android devices could also be used to create content for display.

The How

Already running a home server made hosting an easy and free choice, and after some research I discovered that my preferred asp.NET had the power to manipulate images using the System.Drawing library.

To make the length of time each image was on display content appropriate, I could gain control over the televisions slideshow settings by converting each image to a video file, specifying the time during content creation. For this I can employ FFMpeg, a utility that can be controlled via a command line, plus the ability to stitch audio into the output gave scope for added appeal to the messages displayed.

The Build

An alpha build was quickly built to establish the feasibility of the program, with most of the pain coming from finding a format the television would play in 1080p resolution, with the result being in .vob format.

With a simple site operational I spent time with a sample of the user base and monitor them using the site. This gave me chance to discover how others would use the site, any layout issues they encounter, what improvements I can make to aid the experience, and importantly, if they can break the site from exploiting any coding errors.

This one-on-one time proved invaluable, as I could make simple changes that made a lot to the user experience. These included setting the logo as a link to the home page, adding a quick links menu to the final step for improved productivity, and since the browser used was Internet Explorer 8, adding code to force the download dialog box to display, giving users a change to specify a download location.

With the amendments made, some more styling was added to make the site more inviting to the less computer centric user, security on the server end tightened and temporary file removed, leaving a fully fledged website behind.

The Pseudo

After experimenting with layouts and processes involved, I came up with the following steps for the user to create content, with what the code runs behind the scenes:

Step 1: Enter Content – User selects a section of the site and inputs information into a form, based on the section, can also choose elements such as background images, text size and audio options.

The page will send the inputted variables to the next page.

Step 2: Preview Image – A chance for the user to see a preview on the image, with a chance to return to the input page and make changes.

This page draws the image, adds the text from step one and stores it to disk. The saved image is then displayed on the page as a preview. Any variables needed for the next step are reloaded ready to be passed on. Depending on the section, any elements needed for conversion but do not change are hard coded and passed to the next page.

Step 3: Converting –A loading screen is displayed while the video is created.

On load the page calls FFMpeg with arguments to use the image created on the previous page, with variables either taken from the previous or carried over from the first. Getting FFMpeg to return results to .Net is difficult due to the amount of output it displays, so to save a lot of parsing the loading screen is a 7 second countdown resulting in redirecting to the next step.

Step 4: Preparing File – A similar loading screen appears, with minor updates to keep the user informed that the process is still running.

This page does the housekeeping, starting by reading the system time to a variable. The image from step 2 is deleted and the newly created video is moved to a download folder, and renamed with the system timestamp to give it a unique identifier.

Step 5: Download – A link to download the completed video, with instructions on how to save to a USB stick and display on the TV.

The timestamp variable is read and added to the download URL so it points to the correct file, plus a workaround added to force a download dialog box in IE.

The Result

I’m pleased to say that the communication screen has been widely accepted, with the greatest satisfaction coming from colleagues referring to information on the screen and submitting topics to be displayed in future.

Soon after its creation my time in the store came to an end, with 14 years’ service I was made redundant and left the company. With more time I would have loved to refine the site and add more features, at its final version I would have liked to add the following:

  • YouTube integration, download corporate videos for display on the screen
  • Token system to allow the site to be multiuser
  • Topic and Dated filenames to allow easier management of SD card
  • Add ambient music choices to all topics
  • FFMpeg to add animation to images on conversion
]]>
New Server https://james-batchelor.com/index.php/2015/06/21/new-server/ https://james-batchelor.com/index.php/2015/06/21/new-server/#respond Sun, 21 Jun 2015 12:47:17 +0000 http://james-batchelor.com/?p=284 Continue reading "New Server"]]> My trusty HP Microserver N36L has been ticking along nicely for years with Windows 2003 at the helm, but with support for 2003 coming to an end an alternative was needed.

Recently I have been using Amazon EC2 cloud services for all my website hosting, new customers to the service get a 12 months free teir1.micro instance with myself opting for Windows Server 2012 R2 as my OS, and I’ve taken up this offer since October last year when an extended spell of server woes left me unable to serve websites.

A caveat with the free EC2 instance is the billing process, while the instance is free you have to pay attention to what is included as part of the offer, network usage, hard drive capacities and security keys are subject to charge over certain thresholds, so be aware.

With the trail due to expire in a few months I preferred to avoid an ongoing monthly cost and bring website hosting back to my own server, but not my current server as I didn’t want a box that served the web as well as store all my personal files. The logical conclusion was to get a new server.

HP has just launched the Gen 9 series servers so the Gen 8 are being offered with hefty cash back offers, tempting but the entry level Gen 8 moved to using Intel Celeron processors, while having slightly better performance, the power consumption also increased. Combine that with the expense on upgrading the basic offering with more memory and storage the cheapest solution was to go for a second hand “Gen 7”, something I’m familiar with.

HP Microserver N54L
HP Microserver N54L, last of the Gen 7.

I settled on a used HP Microserver N54L, ready kitted out with 4GB EEC RAM, 2 x 2TB Seagate Barracuda drives, DVD-RW drive and an extra gigabit Ethernet port, plus I can add 2 x 1TB WD Green drives spare from an earlier upgrade. Experience from a micro EC2 instance showed that this server would not be the bottleneck for a website, that would be firmly in my internet connections court.

Going forward the plan is to mothball the N36L server running Win 2003, keeping it essentially as a NAS device and closing incoming connections from the net, with the newer N54L replacing it in everyday tasks . But until then the EC2 instance is free until October, giving me chance to experiment with the best setup before going live, virtualisation will get a look in too.

]]>
https://james-batchelor.com/index.php/2015/06/21/new-server/feed/ 0
UPS Investment https://james-batchelor.com/index.php/2015/01/12/ups-investment/ https://james-batchelor.com/index.php/2015/01/12/ups-investment/#respond Mon, 12 Jan 2015 22:42:00 +0000 http://james-batchelor.com/?p=274 Continue reading "UPS Investment"]]> From the last post, the idea of having UPS in my home may put me off forever, but to put it into context the unit had been installed before I was employed over 12 years ago, and over the past 2 years it was beeping intermittently to indicate a fault that a convenient press on any button would silence.

The post before that however had more gravitas, with my server being offline for close to a month all due to a one second power cut made me feel vulnerable to another downtime incident over something I couldn’t control. It was time to look into a Uninterruptable Power Supply to protect my server from power cuts that could knock my RAID out of sync.

My purchasing requirements were as cheap as possible,  but had to be an online system, meaning that the UPS would notify the server when it was running on batteries and shut down the system down before the juice ran out. An offline system would be less inexpensive, but a long term power outage would just postpone the problem, plus since I don’t intend to supply backup to the network hub, I would be powerless (on both levels) to do anything about it.

APC CS350
APC CS350

I settled on the APC CS350, a lead-acid unit with serial and USB connectivity. Making thing simple I connected the UPS to the server via USB and Windows 2003 found it without extra drivers, making it as familiar to use as a laptop with its battery management.

Shutdown at 25%
Shutdown at 25%, to ensure data is safe

After allowing the battery to charge, testing is easy, switch off the mains and see how it does. Even from this modest unit my HP Microserver in idle gets 50 minutes of extra life before the battery runs out. I set Windows to shut down at 25% charge, more than enough to shutdown, given that during a power outage the router would be down so the server would be unable to communicate with anything, data preservation is the main game.

The UPS cost £46, my preferred WD Caviar Green 1TB drive costs £48, if another power cut occurs then my it would of paid for itself, another cut and its paid for itself. Yes?

]]>
https://james-batchelor.com/index.php/2015/01/12/ups-investment/feed/ 0
Major Outage https://james-batchelor.com/index.php/2014/11/22/major-outage-2/ https://james-batchelor.com/index.php/2014/11/22/major-outage-2/#respond Sat, 22 Nov 2014 18:03:47 +0000 http://james-batchelor.com/?p=232 Continue reading "Major Outage"]]> It had to happen, after years of reliability (apart from an ISP related failure), I had my first hardware related downtime, caused by a power cut that lasted all of one second.

In the electric free event, only a few electricals switched off, my HP Microserver was one that lost power and restarted. Looking at the headless unit after boot, all lights were on, HDD light on full and the network lamp was flickering away as normal. However trying to access the server, even down to a simple ping, it was unresponsive.

Time for investigation, and it was ripped out of its kitchen cupboard home and connected to a TV along with a keyboard and mouse. From there it was painfully apparent that the RAID mirror had been corrupted and the BIOS couldn’t find the OS. The OS drive was in a RAID 1 mirror so I took out the primary master disk (first on the BIOS boot priority) and tried to boot the remaining mirror. This time it started Windows. All was back on track it seemed, waited for the other mirror holding data to re-sync then changed the boot priority in Windows (not BIOS) to use the good OS drive first. A restart to plug the un-synced HDD in and it booted fine, no SMART errors reported with the removed drive and it started to rebuild the system mirror.

Things then took an ugly turn, using the desktop would be as normal for around 90 seconds, then the system would freeze, apart from the mouse for minutes at a time, before coming back to life and displayed applications requested before the freeze. It seemed as if the system was having big problems trying to read from the disk, it would run fine simply moving the mouse around, but when selecting a program it would freeze, and depending on what you requested to load it could be up to 20 minutes. While in this state of freeze, the HDD lamp on the Microserver would be solid, so naturally it pointed to either a bad hard drive or the RAID mirror was having problems.

The HP Microserver in a state of repair
The HP Microserver in a state of repair

Not finding a solution, I admitted defeat and did a fresh install of windows, but still wanted to get the latest backup, the data mirror was easy to recover by just removing the drives as they can be imported on a new install. The OS drive was a bit trickier, the system would freeze if I tried to copy files as is. Luckily I had the old 250GB drive that came with the Microserver, it had Windows 2003 on it and ran on the system until more capacity was required, it was swapped out for a 1TB drive. Not so lucky was that the only software found to copy files from a Foreign RAID mirror cost £50, I shelled out this money as my data was more valuable than the asking fee. Along with an extra 1TB drive to hold the data while I juggle drives it ended up costing me a few quid.

All this from a 1 second power cut.

RAID 1 on a system disk:

Research says this is not a good idea. While it will run with no issues during normal operation, after an unexpected shutdown a RAID controller just can’t tell the difference between a good file and an un-synced, corrupt file, so the controller will either guess, which could restore an out of data file, or create a mismatch of current and out of date files that ultimately brings your OS to a halt.

]]>
https://james-batchelor.com/index.php/2014/11/22/major-outage-2/feed/ 0
Installing WordPress on Windows Server https://james-batchelor.com/index.php/2014/11/03/installing-wordpress-on-windows-server/ https://james-batchelor.com/index.php/2014/11/03/installing-wordpress-on-windows-server/#respond Mon, 03 Nov 2014 18:31:13 +0000 http://james-batchelor.com/?p=223 Continue reading "Installing WordPress on Windows Server"]]> It’s simple, instead of the process of installing PHP, MySQL, assigning permissions and all the debugging that many of us have gone through, Microsoft has come up with WPI, or Web Platform Installer.

wpi1
WPI makes installing WordPress easy.

Amongst other web applications, WordPress is the most popular and it makes the install on Windows as simple as a few clicks.

wpi2
All done!

So far I’ve tried it on Server 2003 R2 and Server 2012 R2, both with instant success.

It’s available at: http://www.microsoft.com/web/downloads/platform.aspx

]]>
https://james-batchelor.com/index.php/2014/11/03/installing-wordpress-on-windows-server/feed/ 0