Colin Stuart Projects The Website
The website itself is a project i've been playing around with since 2009. It has been my friend and muse for many years. It also might be the only hobby that actually helped me make a few bucks.
Why its even here in the first place is that I just wanted to make a page talking about the history of the site itself and what its currently running on.
Specs
The website is running on a Digital Ocean droplet. It's a 1GB RAM, 1 CPU, 25GB SSD, and 1TB bandwidth droplet. It's running Ubuntu 24.04 LTS, Nginx, PHP 8.3, and MySQL.
This is my first time running Nginx instead of Apache and I love it!
Set Up
I went through the process a few times as the first time I messed up the config and it was acting off. Then the 2nd time I locked myself out of the server by turning on UFW without my SSH connection added. Because it's on a server I can't get physical access to I was stuck.
But after those little stumbling blocks and a few little fixes here and there I was able to get the website up and running.
After installing Ubuntu 24.04 LTS these were the commands used to set up the LEMP.
# Make sure to not block yourself from the server
sudo ufw allow ssh
sudo ufw limit 22/tcp
sudo apt upgate
sudo apt upgrade
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx
sudo systemctl status nginx
# Create some bash files of commands that I like to run
sudo apt install mysql-server -y
sudo systemctl start mysql
sudo systemctl enable mysql
sudo systemctl status mysql
sudo mysql_secure_installation
# Choose the options you want and set password security
sudo mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
FLUSH PRIVILEGES;
Exit
sudo systemctl restart mysql
sudo apt update
sudo apt install software-properties-common ca-certificates lsb-release apt-transport-https
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.3-fpm php8.3-cli
sudo apt install php8.3-mysql php8.3-mbstring php8.3-xml php8.3-curl
php -v
# Make sure php is showing proper version
sudo systemctl start php8.3-fpm
sudo systemctl enable php8.3-fpm
sudo systemctl status php8.3-fpm
# Now we are going to remove the default conf and add our own in nginx
sudo rm -rf /etc/nginx/sites-enabled/default
sudo rm -rf /etc/nginx/sites-available/default
sudo nano /etc/nginx/sites-available/domain-name.com.conf
# Nano will open up and we set the config file
server {
listen 80;
server_name domain-name.com;
root /var/www/domain-name.com;
index index.php index.html;
location / {
try_files $uri #uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
}
}
#Done with Config
sudo ln -s /etc/nginx/sites-available/domain-name.com.conf /etc/nginx/sites-enabled/domain-name.com.conf
sudo nginx -t
sudo systemctl restart nginx
sudo ufw allow 80/tcp
sudo ufw app list
sudo ufw allow 'Nginx Full'
sudo ufw reload
sudo ufw status
cd /var/www/domain-name.com
sudo rm index.nginx-debian.html
sudo nano index.php
# Simple nano php check
# Type out the php_info() function check
sudo apt install python3-certbot-nginx
sudo certbot --nginx --agree-tos --redirect --email hello@example.com -d domain-name.com
sudo certbot renew --dry-run
sudo systemctl restart nginx
# Everything is working, let's make a cron job to upadte the system
mkdir /var/logs/cronlogs
crontab -e
0 2 * * * sudo apt update && sudo apt upgrade -y > /var/logs/cronlogs/update.log 2>&1
The Website
The website is built with HTML, CSS, PHP, images edited with Affinity Photo & Affinity Developer, and compressed with TinyPNG when necessary. I like the idea of keeping websites as compressed as possible (within' my ability of course).