If you need a simple Web Server, but you don't want to download and install the complex HTTP service programs, such as: Apache,iss,nodejs. 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. The only thing you need to do is install a python (if you're using a Mac system, you've got Python, and the installation is saved).
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. Here is the command line:
Shell Code
1 cd/desktop/website2 python-m simplehttpserver
That's fine, and our HTTP service listens on port No. 8000. You will get the following information:
Serving HTTP on 0.0.0.0 Port 8000 ...
You can open your browser (ie or chrome) and enter the following URL:
http://127.0.0.1:8000
LAN other users can use the native IP plus 8000 port to access
If your website directory has a file name named Index.html, then the file will become a default page, and if there is no such file, then the directory list will be displayed.
If you want to change the port number, you can use the following command:
Python-m simplehttpserver 8080
Use Python to quickly build a local site