zoukankan      html  css  js  c++  java
  • linux简单快速启用web

    Python的SimpleHTTPServer
    需要先安装python,然后执行
    $ python -m SimpleHTTPServer     //当前目录为根目录,端口在8000的服务
    $ python -m SimpleHTTPServer 9000     //当前目录为根目录,端口在9000的服务
    为了更快速的使用,我们可以在.bashrc或者.zshrc里alias一下
    alias servehere="python -m SimpleHTTPServer"
    在命令行里,执行一下 $ servehere 就可以开启服务
    $ python2
    Python 2.7.17 (default, Mar 21 2020, 00:47:07)
    [GCC 9.3.0] on linux2
    Type "help", "copyright", "credits" or "license" for more information.

    注意: python3 改为下面的命令了
    $ python -m http.server
    Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
    $ python
    Python 3.8.2 (default, Feb 26 2020, 22:21:03)
    [GCC 9.2.1 20200130] on linux
    Type "help", "copyright", "credits" or "license" for more information.


    serve 这是一个npm的模块,首先需要先安装 nodejs 和 npm,然后安装
    $ npm install -g serve
    $ serve     //当前目录为根目录,默认端口在3000的服务
    $ serve --port 8000      //当前目录为根目录,指定端口在8000的服务
    $ npm info serve
    serve@11.3.0 | MIT | deps: 9 | versions: 133
    Static file serving and directory listing
    https://github.com/zeit/serve#readme


    需要域名绑定的时候可以用apache或者nginx
    jser.me/2013/11/22/快速启动web服务的两种方式.html
    https://blog.csdn.net/hzhsan/article/details/44677867
    https://blog.csdn.net/sun172270102/article/details/50820683
    添加虚拟网卡
    http://blog.51cto.com/mengzhaofu/1846545

    ===============

  • 相关阅读:
    关于同步解释
    dll 问题 (转)
    SQL SERVER 触发器中如何调用外部程序
    SQL SERVER所有表、字段名、主键、类型、长度、小数位数等信息
    variant 和 Stream 的互換
    Variant的相关函数
    使用 wxPython 创建“目录树”(5)
    wxPython 绘图演示——模拟雷达信号图(2)
    wxpython 实现简易画板(1)
    使用 wx.tools.img2py (4)
  • 原文地址:https://www.cnblogs.com/sztom/p/10184599.html
Copyright © 2011-2022 走看看