初音ミクの消失

利用python搭建简易http服务器

字数统计: 249阅读时长: 1 min
2019/06/13 Share

正文

原料

linux系统(虚拟机),python

方法

首先cd到你想开服务器的目录下,再

sudo python -m SimpleHTTPServer [port]

e.g. sudo python -m SimpleHTTPServer 80

这样就在80端口开启了服务器

ubuntu:~/Desktop$ sudo python -m SimpleHTTPServer 80
Serving HTTP on 0.0.0.0 port 80 …
192.168.133.1 - - [13/Jun/2019 05:05:26] “GET /x.jpg HTTP/1.1” 200 -
192.168.133.1 - - [13/Jun/2019 05:05:26] code 404, message File not found
192.168.133.1 - - [13/Jun/2019 05:05:26] “GET /favicon.ico HTTP/1.1” 404 -
192.168.133.1 - - [13/Jun/2019 05:06:32] “GET /x.jpg HTTP/1.1” 200 -
192.168.133.1 - - [13/Jun/2019 05:07:00] “GET /x.jpg HTTP/1.1” 200 -
192.168.133.1 - - [13/Jun/2019 05:15:58] “GET /x.jpg HTTP/1.1” 200 -
192.168.133.1 - - [13/Jun/2019 05:18:36] “GET /x.jpg HTTP/1.1” 200 -
192.168.133.1 - - [13/Jun/2019 05:20:23] “GET /x.jpg HTTP/1.1” 200 -
192.168.133.1 - - [13/Jun/2019 05:37:08] “GET /x.jpg HTTP/1.1” 200 -
192.168.133.1 - - [13/Jun/2019 05:38:55] “GET /x.jpg HTTP/1.1” 200 -

正常读取到http服务器下面的x.jpg

原文作者:mrh929

原文链接:https://mrh1s.top/posts/cbf6a417/

发表日期:June 13th 2019, 8:54:11 pm

更新日期:June 13th 2019, 8:57:20 pm

版权声明:本文采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可

CATALOG
  1. 1. 正文
    1. 1.1. 原料
    2. 1.2. 方法