windows10 - Windows 10 安裝 nginx 出錯(cuò)
問(wèn)題描述
logs 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)
這里發(fā)現(xiàn)是因?yàn)?system占用80端口、system為系統(tǒng)進(jìn)程,又不能關(guān)閉,怎樣才能解決呢?我測(cè)試了一下 win7是好的。大家平常是怎樣解決的呢?
接上面,配置出現(xiàn)問(wèn)題,test.conf copy 一份 nginx.conf,配置如下, 為什么請(qǐng)求 www.hht.com(這里我在host里配置過(guò)了),為什么還是 80端口,配置里面的端口是32000,
這又是什么原因呢?
test.conf
#user nobody;worker_processes 1;error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;pidlogs/nginx.pid;events { worker_connections 1024;}http { include mime.types; default_type application/octet-stream; #log_format main ’$remote_addr - $remote_user [$time_local] '$request' ’ # ’$status $body_bytes_sent '$http_referer' ’ # ’'$http_user_agent' '$http_x_forwarded_for'’; #access_log logs/access.log main; sendfileon; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server {listen 32000;server_name www.hht.com;charset utf-8;location / { root deployed; index index.html index.htm;}error_page 404 /404.html;# redirect server error pages to the static page /50x.html#error_page 500 502 503 504 /50x.html;location = /50x.html { root html;} } server {listen 192.168.0.102:33000;server_name www.hhh.com;charset utf-8;access_log logs/host.access.log main;location / { root html; index index.html index.htm;}#error_page 404 /404.html;# redirect server error pages to the static page /50x.html#error_page 500 502 503 504 /50x.html;location = /50x.html { root html;} }}
問(wèn)題解答
回答1:1.system那個(gè)占用80端口的應(yīng)用或許可以使用net stop servicename關(guān)閉2.給nginx使用另外一個(gè)端口先跑起來(lái)再來(lái)其他方面的問(wèn)題(抓住重點(diǎn))
回答2:Check IIS or IIS Express.
回答3:一樓已經(jīng)說(shuō)的很清楚了,不過(guò)強(qiáng)烈建議在linux上面玩,別問(wèn)我怎么知道的,都是走過(guò)的坑啊。。。
回答4:綁在其他端口
排查端口占用
使用Docker :)
相關(guān)文章:
1. javascript - 能否讓vue-cli的express修改express重啟服務(wù)2. 解決Android webview設(shè)置cookie和cookie丟失的問(wèn)題3. javascript - gulp打包引入文件路徑在生產(chǎn)環(huán)境和開(kāi)發(fā)環(huán)境下的切換4. node.js - npm一直提示proxy有問(wèn)題5. python - 我想把下面代碼中的多余空白行去除該怎么做,如何用正則實(shí)現(xiàn)6. PHP單例模式7. 最新版本的微信web開(kāi)發(fā)者工具必須要APPID,會(huì)提供測(cè)試號(hào),但是像你一樣tabBar配置的話不會(huì)顯示首頁(yè)與日志,難道我要下載跟你一樣的版本?8. 網(wǎng)頁(yè)爬蟲(chóng) - python爬蟲(chóng)翻頁(yè)問(wèn)題,請(qǐng)問(wèn)各位大神我這段代碼怎樣翻頁(yè),還有價(jià)格要登陸后才能看到,應(yīng)該怎么解決9. python - tweepy 庫(kù) 連接Twitter API 報(bào)錯(cuò)10. python - 網(wǎng)頁(yè)title中包含換行,如何用正則表達(dá)式提取出來(lái)?
