Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Jan 242010

Serve current directory using HTTP with a single command


Sometimes, you want to share some files in a given directory in your Linux system to other people, you might consider setup a NFS, Samba, FTP or so.

However, the easiest method is to export the directory using HTTP, with the help of Python.


 # cd /data/
python -m SimpleHTTPServer
Serving HTTP on port 8000 ...

Now people can access the web server at port 8000 of your system's IP address, to access the /data directory.

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>