Local Apache Instances for Fun and Utility
I’ve found all sorts of uses for running Web servers on my home network (not accessible to the outside world).
Local websites can be amazing user interfaces for shared data.
Browsers are near-universal UI engines accessible from a huge variety of devices, so when you put something on a web server on a network, you’re making an interface that pretty much anyone on that network can use from any device. Old-fashioned CGI Scripts are still an incredibly easy way to make quick user interfaces.
Running things on a local secured network means you can skip all of the security stuff like logins and passwords that you would normally need to create before exposing something on the Internet.
I hope it goes without saying that I’m not recommending exposing sensitive private data to your local network any more than I would suggest pinning confidential documents to the wall in the front entrance of your house.
Sometimes it’s really nice to do local Web development for its own sake as well. Being able to experiment locally is faster and safer than on a public-facing server.
The container page is authored in the AsciiDoc plaintext format
A script converts it to HTML
Editing happens over an SSH connection to another computer on my home network (see my article about that setup)
But I can serve the .adoc source directly and pretend it is HTML with these lines in my
# SERVE RATFACTOR LOCALLY <Directory "/home/dave/wiki/ratf/src/"> Require all granted </Directory> AddType text/html .adoc Alias / /home/dave/wiki/ratf/src/
And now I can just hit
http://phobos/foo.adoc and see my AsciiDoc source treated in the browser as if it were HTML.
Of course, the page is a total mess because the AsciiDoc content is not HTML, but the embedded HTML content renders just fine, which is all I need. This is a huge time-saver. Thank you to the browser creators who work so hard to have the browser render whatever it can.
Of course, I could also author the page as a plain HTML document, but that doesn’t play well with the rest of my website and makes authoring the text content less fun.