zoukankan      html  css  js  c++  java
  • my clound test / ooxx.com

    s

    用Python建立最简单的web服务器

    http://www.cnblogs.com/xuxn/archive/2011/02/14/build-simple-web-server-with-python.html

    利用Python自带的包可以建立简单的web服务器。在DOS里cd到准备做服务器根目录的路径下,输入命令:

    • python -m Web服务器模块 [端口号,默认8000]

    例如:

    • python -m SimpleHTTPServer 8080

    然后就可以在浏览器中输入

    • http://localhost:端口号/路径

    来访问服务器资源。 
    例如:

    • http://localhost:8080/index.htm(当然index.htm文件得自己创建)

    其他机器也可以通过服务器的IP地址来访问。

    这里的“Web服务器模块”有如下三种:

    • BaseHTTPServer: 提供基本的Web服务和处理器类,分别是HTTPServer和BaseHTTPRequestHandler。
    • SimpleHTTPServer: 包含执行GET和HEAD请求的SimpleHTTPRequestHandler类。
    • CGIHTTPServer: 包含处理POST请求和执行CGIHTTPRequestHandler类。

     

    http://mirrors.163.com/centos/7/isos/x86_64/CentOS-7.0-1406-x86_64-Everything.iso

    https://www.apachefriends.org/xampp-files/5.5.19/xampp-linux-x64-5.5.19-0-installer.run

    http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.9/bin/apache-tomcat-8.0.9.tar.gz

    http://download.oracle.com/otn-pub/java/jdk/8u40-b26/jdk-8u40-linux-x64.tar.gz

    http://download.oracle.com/otn-pub/java/jdk/8u40-b26/jdk-8u40-linux-x64.rpm

    http://softlayer-sng.dl.sourceforge.net/project/pcre/pcre/8.36/pcre-8.36.tar.gz

    http://jaist.dl.sourceforge.net/project/pcre/pcre2/10.00/pcre2-10.00.zip

    http://nginx.org/download/nginx-1.7.11.tar.gz

     

     

     

     

     

    end

  • 相关阅读:
    HDU5418.Victor and World(状压DP)
    POJ2686 Traveling by Stagecoach(状压DP)
    POJ3254Corn Fields(状压DP)
    HDU5407.CRB and Candies(数论)
    CodeForces 352D. Jeff and Furik
    CodeForces 352C. Jeff and Rounding(贪心)
    LightOj 1282 Leading and Trailing
    Ural 1057. Amount of Degrees(数位DP)
    HDU 2089 不要62 (数位DP)
    HDU5366 The mook jong (DP)
  • 原文地址:https://www.cnblogs.com/lindows/p/14390228.html
Copyright © 2011-2022 走看看