logo
backtop

So what actually changed then?

(Posted 18:01:57 on 30th January 2023 by Rag)
This is a great question as the website has undergone the biggest change since I started it and nobody can probably tell the difference. The site has always been hosted on a WAMP stack (Windows, Apache, MySQL and PHP) and I've moved it to a LEMP stack (Linux, Nginx, MariaDB, PHP) on Docker. Additionally, I changed the file structure and some of the base coding across the site. It's amazing what you do when you're bored I guess. Off the top of my head, here's the details and impact:
  • Docker - previously all the websites and services were mushed together with one Apache server with four virtual hosts connecting to one PHP instance that connects to one MySQL instance. Now, we have an Nginx reverse proxy in a container that connects to four other Nginx servers on their own containers that connect to their own PHP container that in turn connects to its own MariaDB container. This means that each site can be split off and moved very easily if needed
  • Windows to Linux is a big change because Linux is case sensitive and Windows is not. My coding and file naming hasn't been consistent, so I've had to correct a lot of links, but this does mean I can port the websites to any hosting environment at anytime with no further modifications if needed.
  • Changing the file structure again means re-coding all links. A lot of this was done to be consistent on how media is stored so I can access it from a media server. Previously videos from photos were under photos, videos from games under games (with random sub folders), videos from videos under videos .... you get the point. Now it's all neat and tidy.
  • Changing to MariaDB from MySql actually doesn't have an impact as they both use the MySql language and libraries. MariaDB is an open source fort from MySql after the latter was bought by Oracle.
  • Upgrading PHP causes deprecated functions to need to be changed. There were a few of these, but the biggest impact was deprecating implicit translation of values or null, specifically, passing non integer or null values to functions that require an integer. Previously it rounded the value or treated null as zero, but it don't do that no more.
  • Moving the database calls from MySqli to PDO meant that I had to re-code every part of the site that calls the database. I also added try catch to the call functions to make it a bit neater. This change is more secure and potentially more portable.

On top of that, there were some fixes to some broken pages that had crept into the site, the creation of the 2023 F1 Fantasy Race Game adding a pretty meaningless Chart Generator because I needed it and decided to just make it available.

I also standardized the logon process across the site and created a my account page. There's nothing really there yet, but it's a framework that I can build on. You now need to logon to post to the forums along with playing the Race Game. In doing this, I decided to add encryption to the password file, but you should still not use a password you use elsewhere. I also got rid of all the home page naming. Originally everything was a home page, e.g. photoshomepage or videoshomepage and I've just removed the homepage bit. No reason, other than it made me feel better and if I'm redoing all the links on the site, now's as good a time as any to make those changes.

It's all been a lot of fun as I've been learning a lot of things along the way.
0 comments

 

This is a Build Your Own Blog entry.