默认安装版本为pytho2.7

http服务器搭建:

进入要开放访问的目录下,执行命令:python -m SimpleHTTPServer 9000

python 搭建http服务器和ftp服务器

显示上述表示安装成功,且http服务的端口为:9000,不跟端口默认80端口

通过浏览器访问该http服务:

http://localhost:9000

页面显示入下:

python 搭建http服务器和ftp服务器

服务器端显示如下:

python 搭建http服务器和ftp服务器

表示接收请求成功。

 

ftp服务器搭建:

python不自带ftp服务库,因此需要安装插件:

 进入Python27\Scripts目录,执行:pip install pyftpdlib命令,显示如下,表示安装成功

python 搭建http服务器和ftp服务器

进入需要开放的ftp服务目录下,执行:python -m pyftpdlib -p 21,显示如下,表示ftp服务搭建成功

python 搭建http服务器和ftp服务器

通过浏览器ftp://localhost:21访问,显示如下,表示访问成功:

python 搭建http服务器和ftp服务器

服务端显示如下,表示接收请求成功:

python 搭建http服务器和ftp服务器

 

相关文章:

  • 2022-01-15
  • 2021-11-26
  • 2021-06-28
猜你喜欢
  • 2021-12-30
  • 2022-12-23
  • 2021-09-08
  • 2022-01-12
  • 2021-08-30
  • 2021-12-05
  • 2021-12-10
相关资源
相似解决方案