Ubuntu 14.04 tip for beginners: set up a basic file server based on HTTP protocol for temporary use without installing any web server application.
Python 2.7, a programming language comes pre-installed on Ubuntu, has a SimpleHTTPServer module which can be used to set up a very basic web server serving files relative to the current directory.
Press Ctrl+Alt+T to open a terminal window.
cd command to navigate to a directory, :
2. Start a http file server on default 8000 port:
python -m SimpleHTTPServer
Or use a defined port:
python -m SimpleHTTPServer 8088
3. To access the file server, go to http://serverip:port in client’s browser.
SimpleHTTPServermodule has been merged into
http.serverin Python 3.
HTTP file server with upload
There’s a third-party script created by bones7456. It sets up a http server that allows uploading.
1. Create a empty file named
SimpleHTTPServerWithUpload.py and open it with your favorite text editor.
2. Copy and paste the code below and save the file.
3. After navigated to target directory in terminal. Start the http server on port 8000: