Busybox httpd with basic auth
For very simple websites, nothing beats running ‘busybox httpd’.
To build it, download the latest source from the download page of busybox.net.
To compile:
make defconfig
make
To run with basic authentication:
- Find out the hash of the password you want to use, for example, if you want to use the password ‘secret’:
$ busybox httpd -m secret
$1$gDqyrCR.$6MSG2JC9CBWRNypWVfuC81
- Add the login information to your httpd.conf file. For example, to use user ‘fred’:
echo '/:fred:$1$gDqyrCR.$6MSG2JC9CBWRNypWVfuC81' > httpd.conf
- Start busybox httpd as follows:
busybox httpd -v -f -p 5005 -r "Identify yourself:" -c httpd.conf
Options used:
-v: be verbose
-f: stay in foreground (don't daemonize)
-p: port number
-r: authentication realm (i.e. string you want to show the users)
-c: configuration file