After a bit of down time I have started to get my website back online. I still need to sort out a theme and create some posts but the technical work is done.
My issues started because I had used a website host that gives you a free domain name when you sign up to host your website on their system. I hosted my site on their system for a while but the editor was not very good. I couldn’t make a website that I wanted. I moved my website to another host. This worked fine for a while but the original company decided you had have domain name and host services with them together or you had to move from their services.
I moved my DNS to a new company that primarily provides DNS services to lock down my domain names. There was a bit of back and forth with tech support at the old provider and the new provider to get the process completed. It was mostly making sure I really was who owned the domain names. I didn’t want to get caught in a similar situation so I didn’t publish a new website right away. After some testing I decided to go in a bit of a different direction.
I am not using a standard hosting provider. I decided to build my own server in Google’s cloud (after some testing of various options) and set up my own LAMP (Linux, Apache, MySQL, and PHP) server. I have used Linux for a lot of various projects so there is no administration issues that I anticipate and I am familiar with MySQL, Apache, and PHP. Google offers several distributions of Linux and I ended up using Ubuntu Server 22.04 LTS. I am most familiar with Debian varieties of Linux so I wanted to stay in that family. I use Linux Mint and Kbuntu on a couple of my personal computers.
There are a lot of guides online that explain how to do this but I had to configure my LAMP server manually. Normally you can install a package called “tasksel” and then use that install a “lamp-server” package. tasksel just saves time by combining a lot of commands into an easy script. The option seems to be missing from tasksel in the Google Linux image. tasksel did give me a webserver option, as pictured below, but I am not sure what that would have done. Normally LAMP Server is a listed option in the list when you don’t use the command line. tasksel did install PHP plus some other packages when I used the traditional command but MySQL and Apache were missing.
After getting the packages installed I was able to configure everything. Ultimately I am using Apache 2.x, MySQL 8.x, and PHP 8.1. Even without the use of tasksel the manual integration was so easy as I just need to install a few packages using these two commands. I am not sure I will use all the extra php modules but the apache mod and mysqli packages are a must.
- sudo apt install libapache2-mod-php
- sudo apt install php-{curl,intl,zip,soap,xml,gd,mbstring,bcmath,common,mysqli}
I also need a way to transfer files to and from the webserver so I added the package vsftpd. I configured the software on Ubuntu and made sure it required SSL. This process required creating a local user to log into the FTP server and making an SSL certificate for the requests. Google Cloud doesn’t allow user/password sign in by default, everything is done with SSH keys. Once the host was ready I added firewall rules in the Google Cloud Dashboard under the VPC network area.
Everything is configured and working and that’s where this post comes in. This will be the first addition to the new website.