Say you want to serve the contents of a single directory on your local machine but don't want the hassle of
installing and configuring a full HTTP Server like Apache or similar. Perhaps you're building a simple website
such as this one? What can you do? You could use busybox
. That's what I do.
The following instructions are applicable for Ubuntu because that's that's what I use, but it will also apply to
other Debian based Linux distrubutions that use the apt
package manager.
$ sudo apt install busybox
Navigate to the directory from where you want to serve the website. For example this is how I use busybox to serve this website on port 9000 for local development.
$ cd ~/Development/github/trcooke.github.io
$ busybox httpd -f -p 9000
Now I can access my website locally at http://localhost:9000