标签:
比较官方的参考 http://nginx.org/en/docs/windows.html
1. 下载windows下的版本 http://nginx.org/en/download.html, 我下载的是 1.9.9
2. 解压缩到 c\nginx-1.9.9
3. 管理运行cmd, 执行命令
cd c:\nginx-1.9.9
4. 执行 start nginx
正常情况应该执行完毕后,敲入 127.0.0.1,显示:
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
结果是,弹出一个命令框,然后就没有然后了。
执行:tasklist /fi "imagename eq nginx.exe"
会告诉你没有找到相关的。
这时候你需要 打开 c:\nginx-1.9.9\logs\error.log
会有一段话:
2015/12/17 23:54:55 [emerg] 7420#7416: bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)
简单说因为权限被禁止,百度一下才知道有人有相关问题,
参考文章:http://blog.csdn.net/love__coder/article/details/7421706
1、打开注册表:regedit
2、找到:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP
3、找到一个REG_DWORD类型的项Start,将其改为0
4、重启系统,System进程不会占用80端口
重启之后,start nginx.exe 。在浏览器中,输入127.0.01,即可看到亲爱的“Welcome to nginx!” 了
标签:
原文地址:http://www.cnblogs.com/mouse_in_beijing/p/5058544.html