To spice things up a bit, I've decided to move from shared hosting into a VPS. I managed to find a cheap VPS service and paid for half a year. The OS is Debian 12, of course.
Before I began, I installed all the necessary packages with
apt install certbot nginx-light php-fpm python3-certbot-nginx
and created an operational user (called user
for simplicity) with
useradd -m user
I then copied the whole installation directory from the old server to the new server. For that, I simply tarred the whole thing into .tar.bz2
(the shared hosting does not have xz
for some reason) for ease of transport.
After unpacking the installation directory on the new server, I took a sample nginx config that came with the Grav installation (it's under sample_config/
) and copied it to /etc/nginx/sites-available
and renamed it to default
, without forgetting to save the original default
as with a different name. I also ensured to keep the line
listen 80 default_server;
listen [::]:80 default_server;
The reason to have my site on the default was simply because I didn't have my domain name directed at this server yet.
After I ensured the nginx runs with that new config, I opened up my browser and entered my new IP address. First thing I saw was... nothing. So I opened up the log and saw some permission issue, where I realized that the ownership of the site directory is messed up due to differences in how users are set in the old server.
This was easily fixed with
chown user:www-data -R site
I then went back to my browser and refreshed. To which I saw:
Which I simply fixed with:
apt install php-curl php-gd php-mbstring php-xml php-zip
I finally was able to see my regular front page.
But wait, my domain was still not pointing to the new IP!
I went to my domain name provider's control panel and changed the A Record.
I knew DNS propagation might take some time, but I sensed something off when it's been overnight. After a quick chat with the tech support, I learned I needed to change the nameservers as well to ns{1,2,3}.systemdns.com
.
After an hour break, I tested with certbot:
certbot certonly --nginx -d timkenhan.co --dry-run
When I see the successful result, I ran the above command without the --dry-run
and updated the nginx config to include the domain name, ssl certs, and logging. Oh, I also renamed with a more specific name.
And here we are!