Python build HTTP server and FTP server

Source: Internet
Author: User

The default installation version is pytho2.7

HTTP Server Setup:

Enter the directory you want to open access to, execute the command: python-m simplehttpserver 9000

The above indicates that the installation was successful and the HTTP service port is: 9000, not with port default 80 port

To access the HTTP service through a browser:

http://localhost:9000

The page appears in the following:

The server side is displayed as follows:

Indicates that the receive request was successful.

FTP Server Setup:

Python does not own the FTP service library, so you need to install the plugin:

Enter the Python27\scripts directory, execute: Pip install pyftpdlib Command, shown below, indicating successful installation

Enter the FTP service directory that needs to be opened, execute: python-m pyftpdlib-p 21, shown below, indicating that the FTP service was built successfully

Access via browser ftp://localhost:21, shown below, indicates successful access:

The server is displayed as follows to indicate that the request was successful:

Python build HTTP server and FTP server

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.