Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Steps for Python to quickly build http Server and FTP Server

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "the steps for Python to quickly build http server and FTP server". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The experiments are as follows:

Machine ip: 192.168.0.51

Steps to set up a http server:

# python-m SimpleHTTPServer

Serving HTTP on 0.0.0.0 port 8000...

192.168.254.8-[27/Dec/2018 13:59:27] "GET / HTTP/1.1" 200-

192.168.254.8-- [27/Dec/2018 13:59:36] code 404, message File not found

192.168.254.8-[27/Dec/2018 13:59:36] "GET / favicon.ico HTTP/1.1" 404-

Visit:

Http://192.168.0.51:8000/

Steps to set up a FTP server:

The Pyftpdlib module needs to be installed:

# pip install pyftpdlib

Collecting pyftpdlib

Downloading https://files.pythonhosted.org/packages/0d/64/eb0daca74956d0e6849b71c5ba99ab873ec59b888a1d7651d92fb686ee04/pyftpdlib-1.5.4.tar.gz (184kB)

100% | ██ | 194kB 1.3MB/s

Installing collected packages: pyftpdlib

Running setup.py install for pyftpdlib... Done

Successfully installed pyftpdlib-1.5.4

Suppose we need to share the directory / tmp as the FTP login directory and build an authenticated and writable FTP server with the user name dsf and password 123456

The command is as follows:

# python-m pyftpdlib-I 192.168.0.51-w-d / tmp/-u dsf-P 123456

[I 2018-12-27 14:15:58] > > starting FTP server on 192.168.0.51 starting FTP server on 2121, pid=4245

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report