I was searching for a lightweight but robust HTTP server which I can run with any arbitrary directory as root. And configuration should be as easy as possible. I found Boa. It is written in C with embedded systems in mind. Believe it or not, it’s just ~300KB in size! Here’s a step by step guide on how to install and use it on Ubuntu. The procedure should be similar for other Linux distros as well.
- Install boa.
$ sudo apt-get install boa
- Navigate to the directory which should be the http root.
- Copy the boa configuration file to the directory.
$ cp /etc/boa/boa.conf .
- Change the DocumentRoot.
DocumentRoot /var/www to DocumentRoot .
- Change ErrorLog and AccessLog configs to a location where you have access. You can also comment them out if it’s just a temporary server.
- Save conf and run boa with current directory as server root.
$ sudo boa -c .
If everything goes fine, your http server should be up and running by now. Run localhost in your browser to access your site. If you have a static IP and your router/firewall settings/ISP permit your friends can access your server over the internet as well.