Apache httpd + suEXEC + chroot + FastCGI + PHP

Piqued your interest ? Excellent. For the moment, I’ll assume that you read the title of this post and immediately asked yourself (or rather, me) : “What are you talking about ? Why would anybody do that ? How exactly one get the above to work ? Be specific !”.

Well, I will answer each in turn. Even if you did not ask those questions. Even if you really wanted to read about the carrot-needs of bunnies, instead. No way out, honest !

What ?

Apache httpd
is the most popular web-server-application today. The page you are reading has been served by it; chances are, so have most others you have been reading recently. It is available for most operating systems, free, and well documented. People often refer to it simply as “Apache” since it’s arguably the most prominent Apache Software Foundation project. Indeed, I will be referring to it like that in this post.
suEXEC
is Apache’s solution to privilege separation with regard to CGI- and similarly run programs external to Apache. A popular example of a CGI-script would be a counter.
chroot
In *ix (and POSIX)-parlance, chroot is a systemcall which will change the current process’ root directory to a different one; for instance, this can be used to constrain a program’s access to a specific part of the filesystem.
FastCGI
is an evolution of the CGI. In the regular CGI-model, processes die after a request is handled; in FastCGI, persistent processes are possible; Since startup- and teardown-costs of programs may be substantial, this can provide a sizable boost in performance and allows for things like object-caching and the like.
PHP
is a popular scripting/programming-language used for web-pages (and other things). It is also a popular example of a program that may be run as a CGI process.

Continue reading ‘Apache httpd + suEXEC + chroot + FastCGI + PHP’ »

Rendering TeX & Graphs to SVG in WordPress

When you start a blog site, the first thing you think about is how the math will look.

Well OK, if you are anything like me, the first thing you think about is how the math will look. And the graphs. And the plots. And possibly how difficult it will be to create them — after all, if it’s a lot of work, you might forego illustrating your points with easy-to-grasp figures or enlighteningly set formulas and go with a less-than-optimal textual representation instead.

One of the first things I did after installing WordPress was sifting through the plug-ins looking for one that would make this task simple and fun. There are a few dealing with LaTeX (WP LaTeX being the obvious choice), though graphing and plotting are represented less. No matter, at least LaTeX is working …

But what’s that, a rasterized image ? Isn’t there a better way that’ll also display beautifully when scaled up or displayed on different-sized screens ? Vector graphics are nothing new, and Scalable Vector Graphics is an open standard published by the W3C quite some time ago; by now, browsers will surely support it …

(imagine me carrying on this train of thought for a bit and, as if by magic, arriving at …)

Continue reading ‘Rendering TeX & Graphs to SVG in WordPress’ »

Cross-Browser SVG Issues

While getting this page ready to display good-looking math, graphs, and figures, I ran into a few problems with how the current browsers handle SVG. I was somewhat surprised considering the age of some of the associated bugs. To give a little bit of background on what I am talking about, let’s first consider the problem I am trying to solve (and how one could go about it). I will choose a simple term as an example : the sum of all cubes from 1 to 100. While there is a markup-language called MathML which could be used to render it, the browser-support is very shaky — and the output is often not pretty. The alternative I’d like to pursue is to embed a rendering of the term as a graphics-file. The easiest way to do that is to just use a rasterized image like so (this works in any browser, including backward ones from Redmond) :

sum_{i=1}^{100}i^3

<img src="term.png" alt="sum_{i=1}^{100}i^3" />

This solution is not very elegant however. The author has to guess the resolution and screensize of the reader (so as to provide a properly-sized image), and zooming or printing makes the term really ugly :
sum_{i=1}^{100}i^3

<img src="term.png" alt="sum_{i=1}^{100}i^3" width="78" height="96" />

You may have noticed that the width- and height-attributed are given here; this is not necessary if you want to use the intrinsic size of the image (as in the first example), and no browser requires it for proper display; in the second example, these attributes are used to illustrate the effect of scaling of a rasterized image.

To avoid such problems when the originating image is clearly scalable/vectorized, I want to use Scalable Vector Graphics instead. All modern browsers support this open standard, at least in name. The handling of that support, however, differs.

Continue reading ‘Cross-Browser SVG Issues’ »

Welcome

Welcome to e.metaclarity.org.

This is a blog. It is shiny and new. It’s about whatever I deem it to be about at any given time; I will try to keep it interesting to at least some non-trivial subset of the population; this subset may change from post to post.

eike_synLet me start by introducing myself: Hi, my name is Eike. I’m a computer and computer science fanatic. I’m a guy. I’m 27 years of age. I’ve done some stuff and missed some other stuff.

Since this is not MySpace, I’ll not delve into all my likes and dislikes. Suffice it to say I have them. Some of them I will shed some light on in this blog.

I’ll be writing posts and pages in English for the most part — meaning that a German one could slip in every now and then. Don’t hold that against me, Google Translate, Yahoo Babelfish, etc. can help you understand the text next to the pretty pictures.

This site is part of metaclarity, a collection of blogs by different people. We all know one another, though that is not to say we are alike.

If you would like to comment on something I write, feel free to. Depending on the level of spam and abuse, comments may be moderated or disabled at any given time. Please try to make your comments useful to other readers and keep them on topic. While I certainly appreciate criticism and praise, they alone are not very interesting to anybody but myself unless they are constructive or add something new. If you just want to talk to me, contact me directly. Comments may be censored, edited, deleted, etc.; if you cannot agree with that, post on your own blog or do not comment here, please. While I won’t go overboard, it bears saying.

For the so-inclined, credits citing some of the used Software and technologies to make this happen are given on a separate page.