Build an HTTP server and an FTP server using Python

Source: Internet
Author: User
This article describes how to set up an HTTP server and an FTP server in Python for reference, interested friends can refer to this article for details about how to build an HTTP server and an FTP server in Python, which has some reference value, for more information, see

This tutorial describes how to set up an HTTP server and an FTP server in Python for your reference. The details are as follows:

The default installation version is pytho2.7.

Http server constructionTutorial:

Go to the directory where you want to open the access and run the command: python-m SimpleHTTPServer 9000

If the preceding information is displayed, the installation is successful, and the http service port is 9000. port 80 is not followed by the default port.

Access the http service through a browser:

Http: // localhost: 9000

The page is displayed as follows:

The server displays the following information:

The request is successfully received.

Below isFtp server constructionTutorial:

Python does not have an ftp service library, so you need to install the plug-in:

Go to the Python27 \ scripts directory and run the pip install pyftpdlib command. the following command is displayed, indicating that the installation is successful.

Go to the ftp service directory to be opened and run python-m pyftpdlib-p 21, as shown below, indicating that the ftp service is successfully set up.

Access via ftp: // localhost: 21 in the browser. The following is displayed, indicating that the access is successful:

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

The above describes how to set up an HTTP server and an FTP server in Python. For more information, see other related articles in the first PHP community!

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.