In the application of distributed systems often in the test environment upload a package, or why, the company's server comparison bug, only to LDAP permissions, each time only SCP to their own personal directory, and then into the public account down CP, more trouble. At this time if you need a simple Web Server, but you do not want to download and install the complex HTTP service programs, such as: Apache,iss. Well, Python might help you. Use Python to complete a simple built-in HTTP server. As a result, you can display your directories and files in HTTP. Just one thing to do is install a python, which is already installed by default on Linux or Mac.
In fact, this is a very useful way to share files. It is simple to implement a tiny HTTP service program, which requires only one command line under Python. For example, if you want to share the TMP directory in the home directory, first CD to the directory, execute the following command:
CD ~/-M simplehttpserver
The default is 8000 port, you can specify the port, open the browser input http://127.0.0.1:8080 can list out the TMP directory all files.
This command usually knocks up for a few seconds and suggests adding to alias.
Vim ~/. Bash_profilealias http='python-m simplehttpserver 20000 ' # Open 20000 port source ~/ ~/tmphttp # Open Service
Open the browser input http://127.0.0.1:20000, the TMP directory files are shared, on the server directly through the wget convenient download your files