zoukankan      html  css  js  c++  java
  • Mac自带的本地服务器的使用

    1. 打开终端,开启Apache:

    //开启apache: sudo apachectl start

    //重启apache: sudo apachectl restart

    //关闭apache: sudo apachectl stop

    回车会提示输入密码,也就是你电脑的密码,http://127.0.0.1/测试一下,成功则如下图:

    2. 点击Finder,然后Command+Shift+G,前往如下路径(mac下Apache服务器的文件路径)

    /Library/WebServer/Documents

    在步骤1中只输入一个http://127.0.0.1其实默认打开的是index.html.en(html是一个网页文件),该文件的内容就是在步骤1中测试时浏览器所显示的内容.


    此时如果我在浏览器的网址框输入的是http://127.0.0.1/PoweredByMacOSX.gif, 浏览器就便会显示PoweredByMacOSXLarge.gif图片.

    3. 使用过后,记得关闭服务器,要不然会一直消耗你电脑内存,后果你懂的。

  • 相关阅读:
    IO
    mouseover,mouseout和mouseenter,mouseleave
    【译】addEventListener 第二个参数
    Git 常用命令
    我对Backbone中url属性的理解
    小失误引起大失败
    收集各大网站的登录页面
    随笔2
    随笔1
    创建数据库
  • 原文地址:https://www.cnblogs.com/cxying93/p/6940845.html
Copyright © 2011-2022 走看看