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.
Usage:
Press Ctrl+Alt+T to open a terminal window.
1. Use cd
command to navigate to a directory, :
cd ~/Downloads/
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.
SimpleHTTPServer
module has been merged into http.server
in 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:
python /PATH/TO/SimpleHTTPServerWithUpload.py
Link: SimpleHTTPServer
Đăng ký liền tay Nhận Ngay Bài Mới
Subscribe ngay
Cám ơn bạn đã đăng ký !
Lỗi đăng ký !
Add Comment