Home  >  Article  >  Backend Development  >  Python builds HTTP server and FTP server

Python builds HTTP server and FTP server

高洛峰
高洛峰Original
2017-03-10 19:11:311402browse

This article mainly introduces the relevant information of Python to build HTTP server and FTP server in detail. It has certain reference value. Interested friends can refer to it.

This tutorial is shared with everyone. The specific steps to build HTTP server and FTP server in Python are for your reference. The specific content is as follows

The default installation version is python2.7

http server setupTutorial

Enter the directory to be opened for access and execute the command: python -m SimpleHTTPServer 9000

Python builds HTTP server and FTP server

## If the above is displayed, the installation is successful and the http service is The port is: 9000, the default port is 80 if not used

Access the http service through the browser:

http://localhost:9000

The page is displayed as follows:

Python builds HTTP server and FTP server

The server side displays as follows:

Python builds HTTP server and FTP server

indicates that the request was received successfully.

The following is the

ftp server setup tutorial:

python does not come with its own ftp service library, so you need to install the plug-in:

Enter the Python27\scripts directory, Execute: pip install pyftpdlib command, the display is as follows, which means the installation is successful

Python builds HTTP server and FTP server

Enter the ftp service directory that needs to be opened, execute: python -m pyftpdlib -p 21, the display is as follows, Indicates that the ftp service is successfully established

Python builds HTTP server and FTP server

Access through the browser ftp://localhost:21. The following display indicates that the access is successful:

Python builds HTTP server and FTP server

The server displays the following, indicating that the request was received successfully:

Python builds HTTP server and FTP server


The above is the detailed content of Python builds HTTP server and FTP server. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn