Possible Blog Downtime For Server Migration

I’m getting ready to change the server that serves this blog from Arch Linux to Fedora Linux. At some point in the next day or so that will probably mean this blog is down for a bit. Of course, since it will be down, you probably won’t be able to read this notice. Luckily, the audience for this blog is probably in the 1-3 person range.

Fedora is Alive

The server is now running on Fedora 17.

It will be interesting to see whether I end up likeing an rpm based distro or not. I’ve almost always used apt based distros in the past for personal stuff except for forays into Arch and Slackware. But so far I like the experience.

It’s possible that all package managers have gotten to the point where there’s not really any issue with using any of them.

Simple Web Servers

With the new server online, I wanted to find a quick webserver that could just serve static pages out of a directory to get the blog back up. Since I had rewritten the blog generation in Perl, I kind of wanted to find something written in Perl to serve the content.

It turned out to be more difficult to get exactly what I wanted than I was hoping.

That may be because I had several requirements that I hadn’t made explicit.

  • I wanted a webserver that could run on port 80, but could drop priviledges to a normal user after being started.
  • I wanted it to be able to serve from an arbitrary directory.
  • I wanted it to be essentially a program or a runner for a program that I would write.

Basically I wanted something equivalent to the Node.js http-server that I had modified. Python’s SimpleHTTPServer came the closest to what I wanted initially, but I couldn’t figure out how to get it to meet my desire to have the process drop priviledges when started as root.

I would have thought that I could find a simple web server written in Perl that would do what I wanted. And I did eventually accomplish my goal. However, none of the Perl web server frameworks were quite as simple by default as I was hoping for.

The closest to what I wanted, and what I ended up using, is Starman. However, I still had to write a little PSGI app, and in so doing, couldn’t figure out how to get a default index page without having to map all pages and a default to their respective files.

There were two packages that came so close to doing what I wanted:

  • Plack::App:File
  • Plack::App::Directory

However, neither would show the default index.html when it wasn’t explicitly specified. Plack::App:File just returned a "file not found" type error and Plack::App::Directory returned a directory listing. Basically what I wanted, and what I might see if I could modify, is Plack::App::Directory, but with the default action to return an index.html if it exists instead of the directory listing.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s