First blog post - website woes

You'd think going from a test environment to a production would be easy, right?

First blog post! Hope this works out ok, stuck some snags with apt having a very old version of hugo when installing on ubuntu, but on debian had a much newer version so the theme didn’t work. Bugger!

First, hugo wouldn’t create the site, kept throwing errors about templates and layouts being missing. Thought that’s weird.. everything worked fine on my test setup.. I would get a 403 after compiling, checking the /var/www/ site directory would show that there was no index.html, just index.xml.

So I thought fuck it, I’ll just upload all the contents of public/*. That should work, right? Why wouldn’t that work. Hugo is a SSG, emphasis on Static! Played it ‘safe’ and uplaoded the entire project directory of my test, just to base on the safe sade. Eureka! It worked! Although hugo still complained.. but that’s not imporant, the site is running! Set about changing a bunch of configs, stuff to not point to ’test’ or ’localhost’ anymore. Ran my custom deploy script to build, copy, and restart nginx. Went through ok, refreshed my page.

But.. nothing changed. None of my changes worked? What the.. why not? Maybe some cached files, some old files still in the public/ directory or the /var/www. A couple rm-rfs later.. but now I’m back at the 403 error. What the heck!

Some quick research revealed that this is a common problem with some of the themese (the one I’m using specifically mentioned) and older versions of hugo. Which was odd to me because I literally did apt update and apt install before, so it should be the latest version.. right? wrong. Apparently the Ubuntu 22.04 repo is way out of date for hugo.

Oh well, clean up everything. Start over. This time with a fresh .tar file straight from the github repo, some 40 versions higher than what apt gave me. Thought everything would be good! Ran hugo command.. it complained there was no hugo in /usr/bin/hugo. which hugo even showed the correct directory - /usr/bin/local/hugo. That’s when I learnt that bash caches the location of commands for performance. A quick hash -r later and tada! Everything working as intended. Phew.

Looking forward to developing this a bit. Will likely be using it to document or tutorialise some of the FOSS stuff I set up / have set up. I’m also probably going to link a couple of services I have that are internet facing - owncast for now, maybe some more in the future. Stay tuned!

Built with Hugo
Theme Stack designed by Jimmy