07.06.2014 Views

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

2 - Raspberry PI Community Projects

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

11.2. Web Server (HTTP)<br />

The Falcot Corp administrators decided to use the Apache HTTP server, included in Debian<br />

Squeeze at version 2.2.16.<br />

ALTERNATIVE<br />

Other web servers<br />

Apache is merely the most widely-known (and widely-used) web server, but<br />

there are others; they can offer beer performance under certain workloads,<br />

but this has its counterpart in the smaller number of available features and<br />

modules. However, when the prospective web server is built to serve static<br />

files or to act as a proxy, the alternatives, such as nginx and lighpd, are worth<br />

investigating.<br />

11.2.1. Installing Apache<br />

By default, installing the apache2 package causes the apache2-mpm-worker version of Apache to<br />

be installed too. The apache2 package is an empty shell, and it only serves to ensure that one of<br />

the Apache versions is actually installed.<br />

The differences between the variants of Apache 2 are concentrated in the policy used to handle<br />

parallel processing of many requests; this policy is implemented by an MPM (short for Multi-<br />

Processing Module). Among the available MPMs, apache2-mpm-worker uses threads (lightweight<br />

processes), whereas apache2-mpm-prefork uses a pool of processes created in advance (the traditional<br />

way, and the only one available in Apache 1.3). apache2-mpm-event also uses threads,<br />

but they are terminated earlier, when the incoming connection is only kept open by the HTTP<br />

keep-alive feature.<br />

The Falcot administrators also install libapache2-mod-php5 so as to include the PHP support in<br />

Apache. This causes apache2-mpm-worker to be removed, and apache2-mpm-prefork to be installed<br />

in its stead, since PHP only works under that particular MPM.<br />

SECURITY<br />

Execution under the wwwdata<br />

user<br />

By default, Apache handles incoming requests under the identity of the wwwdata<br />

user. This means that a security vulnerability in a CGI script executed by<br />

Apache (for a dynamic page) won't compromise the whole system, but only<br />

the files owned by this particular user.<br />

Using the suexec modules allows bypassing this rule so that some CGI scripts<br />

are executed under the identity of another user. This is configured with a<br />

SuexecUserGroup usergroup directive in the Apache configuration.<br />

Another possibility is to use a dedicated MPM, such as the one provided by<br />

apache2-mpm-itk. This particular one has a slightly different behavior: it allows<br />

“isolating” virtual hosts so that they each run as a different user. A vulnerability<br />

in one website therefore cannot compromise files belonging to the<br />

owner of another website.<br />

QUICK LOOK<br />

List of modules<br />

The full list of Apache standard modules can be found online.<br />

➨ http://httpd.apache.org/docs/2.2/mod/index.html<br />

268 The Debian Administrator's Handbook

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!