Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Ad-hoc webserver" for static files on UNIX/MacOSX?

Is there such a thing as a tiny little webserver that I can invoke from the command line that just fetches files from the local filesystem and serves them via HTTP on specific port?

I'd like to be able to do something like this:

$ cd ~/Sites/mysite $ serve . 10.0.1.1 8080 

This should fire up a webserver that listens on 10.0.1.1:8080 and serves files from the current directory (".") – no PHP, ASP or any of that needed.

Any suggestion greatly appreciated.

like image 479
philippbosch Avatar asked Sep 26 '10 22:09

philippbosch


1 Answers

If you have python installed:

$ python -m SimpleHTTPServer Serving HTTP on 0.0.0.0 port 8000 ... 
like image 169
Mike Axiak Avatar answered Sep 19 '22 13:09

Mike Axiak