1. 程式人生 > >windows下nginx啟動一閃而過(原因以及檢視和解決的辦法)

windows下nginx啟動一閃而過(原因以及檢視和解決的辦法)

解決問題的思路清晰比確切解決的辦法更加有效

原因:

這是80埠被佔用的緣故,修改下埠即可

得出此原因的方法:

執行“nginx.exe”檔案即可,執行後,介面一閃而過。

這是檢視log日誌,就能得到原因

 

2018/08/23 21:43:34 [emerg] 16612#13696: 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)

80:埠被佔用

具體的解決辦法:

解決的方法有很多種,但是不建議使用修改登錄檔

,因為不懂登錄檔東西 怕改壞

以下修改配置檔案,修改成如下

目錄:檔案conf/nginx.conf

    server {

        listen       8888;

        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {

            root   html;

            index  index.html index.htm;

        }

這時候再點選nginx,這時候會出現是否出現安全提示,然後在瀏覽器中輸入127.0.0.1:8888

同理輸入localhost就可以了

看到下面頁面即說明成功。

Welcome to nginx!

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 tonginx.org.

Commercial support is available at

nginx.com.

Thank you for using nginx.

Measure

Measure