Pages

17 October 2022

A web server written in bash

I had wanted to try a web server written in bash for years, well the wish just came true with bashttpd available at  https://github.com/avleen/bashttpd     

It is pretty easy to use, you only need to download the script, make  it executable and launch it. There are several launch options, one single connection or accepting multiple connections. At launch time a default config file is created, bashttpd.conf, you can configure several things, especially the files you want to serve.     

In order to connect to the server, ie, to see the file it is serving use the address of the machine using port number 8080. For example if  the server has the following ip: 10.100.120.2 open a web browser and type http://10.100.120.2:8080 and that's it.     

Two important considerations here:

 - Never use it on the web, it is highly dangerous and insecure. Use it at home or in a private network (Its main use is for testing stuff)   

- "If anyone installs that anywhere, they might meet a gruesome end  with a rusty fork" --- BasHTTPd creator, maintainer    

 Enjoy it