Sometimes it is inconvenient to share something in the local area network, especially when it is on the server, you can’t download it first, and then upload it, so you often use python to set up an http service on this machine, and then go to another machine to directly access it. , I am not satisfied with the test, so I will separate it
Python comes with an http server. Although it can't be used in a production environment like Apache, it can still be used for some tests or LAN file sharing, which is very convenient.
Start the http.server that comes with python:
$ python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
Then you can access it through a browser. Note that the default port number of this http server is 8000
python3
python -m http.server 80
Serving HTTP on 0.0.0.0 port 80 (http://0.0.0.0:80/) ...
python2
python -m SimpleHTTPServer 80
Serving HTTP on 0.0.0.0 port 80 ...
If it is a local access, you can directly enter in the browser: http://0.0.0.0