thttpd under raspbian "wheezy"


2 posts
by robackrman » Fri Aug 17, 2012 4:07 am
Steps I took to make and install thttpd (lightweight HTTP server) under raspbian "wheezy:"
Code: Select all
pi@raspberrypi ~ $ pwd
/home/pi
pi@raspberrypi ~ $ mkdir thttpd
pi@raspberrypi ~ $ cd thttpd
pi@raspberrypi ~/thttpd $ wget http://www.acme.com/software/thttpd/thttpd-2.25b.tar.gz
pi@raspberrypi ~/thttpd $ tar -zxf thttpd-2.25b.tar.gz
pi@raspberrypi ~/thttpd $ cd thttpd-2.25b
pi@raspberrypi ~/thttpd/thttpd-2.25b $ ./configure
    ignore "Invalid configuration ..." warnings
    --- a bunch of omitted output ---
pi@raspberrypi ~/thttpd/thttpd-2.25b $ cd extras
pi@raspberrypi ~/thttpd/thttpd-2.25b/extras $ chmod 644 htpasswd.c
pi@raspberrypi ~/thttpd/thttpd-2.25b/extras $ vi htpasswd.c
    there are two places where "getline" is found.  Change "getline" to
    "getlin" in both places to avoid a global name conflict:
        static int getline(char *s, int n, FILE *f) {
                  change to
        static int getlin(char *s, int n, FILE *f) {
                     and
        while(!(getline(line,MAX_STRING_LEN,f))) {
                  change to
        while(!(getlin(line,MAX_STRING_LEN,f))) {
pi@raspberrypi ~/thttpd/thttpd-2.25b/extras $ cd ..
pi@raspberrypi ~/thttpd/thttpd-2.25b $ make
    --- a bunch of omitted output ---
pi@raspberrypi ~/thttpd/thttpd-2.25b $ sudo addgroup --system www
Adding group `www' (GID 109) ...
Done.
pi@raspberrypi ~/thttpd/thttpd-2.25b $ sudo mkdir /usr/local/man/man1
pi@raspberrypi ~/thttpd/thttpd-2.25b $ sudo make install
    --- a bunch of omitted output ---
pi@raspberrypi ~/thttpd/thttpd-2.25b $ cd
pi@raspberrypi ~ $ pwd
/home/pi
pi@raspberrypi ~ $ mkdir www
    make a test index.html in subdirectory www:
pi@raspberrypi ~ $ cat <<EOF >www/index.html
<html>
<head>
<title>Test thttpd</title>
</head>
<body>
Hello World!
</body>
</html>
EOF
    launch the web server:
pi@raspberrypi ~ $ sudo thttpd -d ~/www
    point your browser to the Raspberry Pi IP address (in
    my case http://10.90.0.92) and the test page should be served...
Posts: 2
Joined: Fri Aug 17, 2012 3:54 am
by vd12scbc » Tue Dec 10, 2013 2:25 pm
Thanks for this information, it was very helpful. I found a pre-compiled .deb version of the the armhf thttpd which did not work. This worked like a charm!
Posts: 1
Joined: Tue Dec 10, 2013 2:22 pm