THTTPD FROM SOURCE

grab the latest source tarball

wget https://acme.com/software/thttpd/thttpd-2.29.tar.gz
sha256sum thttpd-2.29.tar.gz
# 99c09f47da326b1e7b5295c45549d2b65534dce27c44812cf7eef1441681a397  thttpd-2.29.tar.gz

tar xzf thttpd-2.29.tar.gz
cd thttpd-2.29/

eventually add index without extension. note index.cgi is already in the list

vi config.h

#define INDEX_NAMES "index", "index.html", "index.htm", "index.xhtml", "index.xht", "Default.htm", "index.cgi"

eventually make text/html the default for serving files w/o extension

vi libhttpd.c

char* default_type = "text/html; charset=%s";

build

./configure --sysconfdir=/etc --localstatedir=/var
echo $MAKEFLAGS
make

install

grep ^www /etc/group
groupadd -g 32 www

# slackware
ls -ld /usr/local/man/man1/
mkdir -p /usr/local/man/man1/

make install
cp -i contrib/redhat-rpm/thttpd.conf /etc/
chmod 644 /etc/thttpd.conf

decide what user the daemon will use

grep ^no /etc/passwd # --> nobody will be used by default

grep ^no /etc/group  # --> nogroup

as an alternative

groupadd thttpd
useradd --system -s /sbin/nologin -k /dev/null -d /noexist -g thttpd -u 32766 thttpd
grep ^thttpd /etc/group
grep ^thttpd /etc/passwd

HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun