Hello! This webpage serves to document how I made my website so that somebody who does not know how (like me, once I have forgotten) can find out how. It's broken into 3 sections:
- The software I used to host the website
- The tools I used to make the website
- The resources I used to learn how to do this
The software
My website consists of a folder of folders of PHP and CSS files. These are served by a Caddy server on an old desktop I acquired that's running FreeBSD.
This website is written using PHP, mostly for reusable components like the header, navigation bar and footer. So, I need a PHP server running on my server too. Because I'm already using Caddy, it makes sense to use FrankenPHP. You would think. It turns out it's a right pain to install this if you don't want to use Docker and you have to build Caddy from scratch. Not what "plug-in" brought to my mind but anyway.
On my laptop, which I developed this on: I gave up trying to do the custom build of Caddy because it kept complaining about different C libraries not being available. Then I tried to install the FrankenPHP binary they provide, and that didn't work because there's a mistake in the release (bug fix pending). I eventually got it to work by using version 1.1.33 instead of 1.1.34.
On my laptop, I run the server by navigating to the site's root directory, and running sudo frankenphp php-server
. Then I open localhost:80
in my browser. It doesn't appear to read my Caddyfile, so I can't change the port from 80, which requires root privilges to bind to??
On my server: I should hopefully, eventually get it working using the xcaddy port and after lot of tinkering which I'll detail here when it's actually done.
I don't like FrankenPHP very much.
The tools
My text editor of choice is NeoVim. Most of my configuration is to make it play nicely with the Dvorak keyboard layout I use... yes, I am one of those people. I use maybe 3% of what (Neo)Vim can do by itself, so I don't feel the need for many plugins. It works really well for what I need.
Any images are edited using Krita, unless it's an SVG, then I used Inkscape.
The Learning
The most helpful resource for making this website happen, in terms of putting it all together, was HTML for the people by Blake Watson. Thank you, Blake, for making such a helpful guide!
If I ever have a specific question about HTML, CSS or JavaScript, then I first check the Mozilla Developer Network Web Docs (MDN Web Docs, the expansion of the acronym has been deprecated). Then I type a more general problem into duckduckgo and hope there's a Stack Exchange answer addressing it. I try very hard not to have PHP problems.
Is that it?
Yup!Resources
You probably want these pages in arms reach: