1. 程式人生 > >Nginx啟動報錯:10013: An attempt was made to access a socket in a way forbidden

Nginx啟動報錯:10013: An attempt was made to access a socket in a way forbidden

Nginx在win7,win2008下啟動報錯: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) 。

原因是Win7下nginx預設80埠被System佔用,造成nginx啟動報錯的解決方案。

在cmd視窗執行如下命令: [plain] C:\Users\Administrator>netstat -aon | findstr :80   看到80埠果真被佔用。發現佔用的pid是4,名字是System。怎麼禁用呢? 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.360sdn.com/Nginx/2014/0807/4044.html