1.MacOS 自带Apatch 服务器。在safari中输入 http://127.0.0.1/ ,如果页面出现 it works,则代表访问成功。
2.如果失败输入sudo apachectl start 然后输入密码(重启命令:apachesudo apachectl restart 关闭:apachesudo apachectl stop)
- Apache的路径/Library/WebServer/Documents 在这个路径下存放自己的文件
4.然后用自己的ip地址访问例如http://10.1.138.92/demo2 ip地址+文件名(不需要后缀)