1 AUTHOR: Richard A Downing FBCS CITP <richard at linuxfromscratch dot org>
5 LICENSE: Creative Commons Deed (Attribution-NonCommercial-ShareAlike 2.0)
7 SYNOPSIS: Gatling - an easy, superfast, http and ftp server.
11 Gatling, by Felix von Leitner, is small, superfast and is very easy to set up. For the arguments for and against, see the website http://www.fefe.de/gatling. Gatling is built using the dietlibc and libowfat libraries, which we will also build. The executable is statically linked and about 120 Kbytes in size (i686 gcc-4).
15 I assume you have a working LFS of recent vintage (say, LFS-6.1). You could probably use this hint with any other modern Linux too.
19 I don't take any responsibility for what you do with these instructions. They are meant to be helpful, but you take full responsibilty for any action you take after reading them. The internet is a dangerous place.
23 I came across Gatling by accident (I was looking for a small getty), an hour later it was my webserver. If you like elegant solutions, you'll like it too.
25 The work divides into four parts.
29 4) Test gatling with your website
34 Dietlibc is a very small, static-link only, libc. It's actually a major subset of the full libc, but it has all the important things in it. It's designed to be fast, and to reduce the size of executables. It's worthy of some study.
36 Download the latest dietlibc from http://www.fefe.de/dietlibc/ (I don't give a version as it will be out of date in 3 months). Unpack this and change to the dietlibc directory. These are not GNUautotool packages, so if you want to change the installation directory - edit the Makefile. A regular build will install dietlibc in /opt/diet, this is a good place for it. Install dietlibc:
39 make install (as a user with write access to /opt, I use root)
41 Note: There WILL be a number of errors during the 'make install' phase, these are, and can be, ignored.
46 Libowfat is von Leitner's collection of simple APIs. It collects together the subroutines that he uses in many of his programs, and makes them available with under the GPL.
48 Download the latest libowfat from http://www.fefe.de/libowfat. Unpack it and build it with:
51 make install (as, say, root)
53 Note: This installs libowfat in the /opt/diet hierarchy, neatly keeping all your von Leitner stuff on one place. Note also that the regular Makefile will build libowfat.a linked statically to dietlibc.
58 Gatling is von Leitner's other http/ftp server (The other one is fnord, but you need daemontools or runit for that.) Gatling is described as 'experimental', but I've seen lots of so called 'stable' applications that are a lot less stable than gatling. A gatling server offers both ftp and http access from one server at the same time.
60 Download the latest gatling from http://www.fefe.de/gatling. Unpack it and build it with:
63 make install (as, say, root)
65 Note: This installs gatling in the /opt/diet hierarchy. Access it as:
67 /opt/diet/bin/gatling.
69 4) Test the gatling installation.
70 =================================
72 Warning: Don't do this on an internet-connected box without a firewall (you don't run one of those, do you?). Think about your security, and don't trust me blindly. At least get iptables installed and set up (see BLFS). Know which ports you have open. End-Warning.
74 As an unprivileged user: change to a directory containing some html files. As an ex-apache user mine are in ~richard/public_html. Run the following command:
78 Gatling will start up with the http server on port 8000 and the ftp server on port 2121 - you will also get a useful log output to the tty. Run a browser and check out http://localhost:8080. Run an ftp client and checkout ftp://localhost:2121. For everything else the gatling man page is in /opt/diet/man/man1/gatling.1 ('man gatling' should work with a regular /etc/man.conf setup).
80 There is a mailing list for Gatling, see the website for details.
84 * Felix von Leitner wrote all the software. He writes cool code.