Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Every once in a while when I'm debugging some web app, it would be useful for me to be able to serve a folder via a lightweight HTTP server. Something along the lines of

cd folder
httpserve -p 5000

in order to serve that folder over port 5000. Is there any tool to allow me to do this?

Thanks.

share|improve this question
    
Which operating system? –  Mark Henderson Aug 17 '10 at 21:12
    
I'm on a Mac, the Python thing from ax25 seems to work great for me. –  wxs Aug 17 '10 at 21:25

1 Answer 1

up vote 4 down vote accepted

python -m SimpleHTTPServer 5000

Or for cgi serving:

python -m CGIHTTPServer 5000

and browse to : http://localhost:5000/myscript.py

share|improve this answer
    
Exactly what I was looking for, thanks! –  wxs Aug 17 '10 at 21:25
    
You are welcome. Glad to have one to answer! –  ax25 Aug 20 '10 at 20:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.