Posts: 2
Joined: Fri Aug 17, 2012 3:54 am

thttpd under raspbian "wheezy"

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
pi@raspberrypi ~ $ mkdir thttpd
pi@raspberrypi ~ $ cd thttpd
pi@raspberrypi ~/thttpd $ wget
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) {
        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) ...
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
pi@raspberrypi ~ $ mkdir www
    make a test index.html in subdirectory www:
pi@raspberrypi ~ $ cat <<EOF >www/index.html
<title>Test thttpd</title>
Hello World!
    launch the web server:
pi@raspberrypi ~ $ sudo thttpd -d ~/www
    point your browser to the Raspberry Pi IP address (in
    my case and the test page should be served...

Posts: 1
Joined: Tue Dec 10, 2013 2:22 pm

Re: thttpd under raspbian "wheezy"

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!

Return to “Networking and servers”