SourceForge.net Logo

4.6. Hyper Text Transfer Protocol (HTTP) (optional)

The HyperText Transfer Protocol (HTTP) is one of the main protocols used to convey information on the World Wide Web. The original intend was to publish and receive HTML pages.

Download and unpack the sources.

wget -P $DL_DIR http://www.acme.com/software/mini_httpd/mini_httpd-1.19.tar.gz
tar -C $PRJ_DIR/apps -xvzf $DL_DIR/mini_httpd-1.19.tar.gz
cd $PRJ_DIR/apps/mini_httpd-1.19

The daemon links with the ssh library described in Section 2.3.2, “Crypto (openssl)”. Compile and install to rootfs.d.

make clean
make CC=${TOOLCHAIN_CROSS}gcc \
     SSL_TREE=$ROOTFS_DIR/usr/openssl \
     SSL_DEFS="-DUSE_SSL -I" \
     SSL_INC="-I$TOOLCHAIN_DIR/include -I$ROOTFS_DIR/usr/include" \
     SSL_LIBS="-L$ROOTFS_DIR/usr/lib -lssl -lcrypto" \
     BINDIR=$ROOTFS_DIR/usr/sbin \
     MANDIR=$ROOTFS_DIR/usr/man \
     install
# 2BD should be stripped (/usr/bin/openssl)

Create the user nobody.

grep ^nobody: $ROOTFS_DIR/etc/passwd
[[ $? -eq 0 ]] || echo "nobody:x:99:99:Nobody:/var/http:/sbin/nologin" \
                       >> $ROOTFS_DIR/etc/passwd
grep ^nobody: $ROOTFS_DIR/etc/group
[[ $? -eq 0 ]] || echo "nobody:x:99:" >> $ROOTFS_DIR/etc/group

Create a home directory for the httpd, and create a certificate (using your own information).

install -d -m 755 $ROOTFS_DIR/var/httpd
htpasswd -cb $ROOTFS_DIR/var/httpd/.htpasswd admin admin
make cert <<EOF
US
Oregon
Portland
.
.
siso.vonk
EOF
mkdir -p $ROOTFS_DIR/etc/sysconfig/mini_httpd
install -m 644 mini_httpd.pem $ROOTFS_DIR/etc/sysconfig/mini_httpd/

An example configuration can be found at: