Server-related thoughts

Changing "up" to a Raspberry Pi2 for use as my in-house webserver here in Technology Towers actually gives me a good opportunity / excuse to revisit the Neanderthalic way I've been doing things around here, to see if it's still the best (rather than simply [as I fear it may be] the laziest) approach. Though if forced to change my (forgive the word) "technology" I would currently face over 3,500 sets of edits just for the files that constitute this prolix ¬blog.

A mildly sobering thought.

The current...

... docs on configuration options for molehole's chosen internal webserver (lighttpd) say I'm still OK to carry on using mod_ssi and my four simple SSIs to finish building each page on the server before actually serving it back to me (by chucking it across the living room from the Pi to BlackBeast). Or wirelessly over to the Android Tablet wherever I happen to be in the house.

I can therefore, if I choose, simply ignore "the use of this module is strongly discouraged" because the four SSIs I use on each page are trivial, and thus pose no risk of overloading the Pi2. Which is, after all, known to be about 6x the CPU performance of the Pi that I already know from the last two years of daily use is perfectly adequate and fit for purpose.

However, there is actually an argument to be made for doing away with my use of SSIs completely, and thus making each of my web pages completely static. Read on!

Dynamic web pages?

The first two SSIs (Header 0 and Header 1) form the HTML header material that brackets the local page's title as I wish it to appear on the very top of your web browser's window:

Header 0:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<title>molehole.org | title of the web page goes here</title>

Header 1:

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"></meta>
<meta name="author" content="David Mounce"></meta>
<meta name="keywords" content="personal web site, PCs, books, music, videos, quotes, diary, writing, David Mounce, Christa Mounce"></meta>
<meta name="description" content="Personal, CSS-based web site of David Mounce"></meta>
<script type="text/javascript" src="/~david/scripts/magicthumb-packed.js"></script>
<link rel="stylesheet" href="/~david/css/2010.css" type="text/css" media="screen, projection"></link>
<link rel="stylesheet" href="/~david/css/magicthumb.css" type="text/css" media="screen, projection"></link>

	<style type="text/css"><!--
		.title { font-weight: bold; padding: 7px; margin: 0px; color: #000; }
		.odd { background-color: #d4ce9c; }
	--></style>

</head>
<body>
<hr class="topbar" />

Blimey! I don't seem to have touched my CSS file since 2010. See what I mean about laziness?

The third SSI (Header 2) fetches an appropriately-highlighted "navigation bar" to splash across the top of every web page. So, for example, every ¬blog page — including this one — has the word "diary" highlighted in orange:

diary nav bar

Header 2, for diary_navigation:

<div id="navcontainer">
<ul id="navlist">
	<li><a href="/~david/index.html" title="homepage">home</a></li>
	<li><a href="/~david/audio/index.html" title="Audio">audio</a></li>
	<li><a href="/~david/bits/index.html" title="Bits">bits</a></li>
	<li><a href="/~david/books/index.html" title="Books">books</a></li>
	<li id="active"><a href="/~david/diary/retiring.html" id="current" title="Diary">diary</a></li>
	<li><a href="/~david/texts/index.html" title="Quotes">quotes</a></li>
	<li><a href="/~david/dvdav/index.html" title="Video">video</a></li>
	<li><a href="/~david/dcm_autre.html" title="Other">other</a></li>
	<li><a href="/~david/help/help.html" title="Help">help</a></li>
	<li><a href="/~david/sitemap.html" title="Sitemap">sitemap</a></li>
</ul>
</div>

The final SSI just pulls in the copyright line at the foot of the page and terminates the HTML file:

Header 3, for the bottom copyright line:

</div>
<div class="footer">© <a href="/~david/help/dcm_contact.html">David Mounce</a>.
</div>
</body>
</html>

Anything that isn't an SSI is my scintillating page content, of course :-)

Static web pages?

If I could no longer use SSIs, but didn't want to change anything else, I would make every web page completely static by permanently importing the content of these four SSIs into each and every page at the appropriate points in each file. This would make no difference to the way serving occurs inside my living room. However, it would allow CloudFlare to have the full range of 'molehole' external web content to fall back on whenever the external server — the one in Texas that hosts a subset of my full web site — has to nip out for a measles vaccination, or some target practice shooting at immigrants with measles, or to put another dollar in the electricity meter.

Of course, it would also increase (by the combined size of these four SSIs) the total size of each web page that I fetch from, and put back on, either of the servers, though by a fairly trivial amount.

Junior continually gently nags advises me, from time to time, of the benefits (to him) of (my) going fully static. I suspect he's simply plotting to get the whole shooting match re-hosted on Amazon's AWS. [Pause] Just had a brief chat with him. He points out that actually it might be quite sensible to keep all my SSIs, but to write a script to 'expunge' them en route to the server, and re-insert them on the way back from the server. That way, I could still make quick global changes to the site. He's right, of course. Particularly if he volunteers1 (or can be bribed) to write the script.

The last major change to molehole's site "structure" was when I added the "bits" area (for stuff about PCs and tech toys other than audio or video). This meant tinkering with each of the nine "main navigation" SSIs that existed back then to add in the tenth. While I don't currently expect to perturb the structure any further, every page also carries the copyright date. And the SSI is very convenient for updating that in just the one file rather than many thousands of the things. (On the other hand, I could always just remove the date, of course.)

[Pause] Done!

  

Footnote

1  Having mentioned to him my new 40" 4K monitor (of which he thoroughly approves already, as he's been trying to persuade one of the bean counters at work to allow him to have one) and the fact that I therefore now have a spare pair of 27" monitors, I rather hope I may have baited my hook adequately.