# <font color=#0019ff>額外補充</font> ## <font color=#0099ff>本地端網址與IP對應(設定host檔)</font> ### 位址 C:\Windows\System32\drivers\etc ![](https://i.imgur.com/kz7PvVd.png) ### 編輯檔案的IP和網址對應(使用#字號註解) ![](https://i.imgur.com/XNY5izL.png) === ## <font color=#0099ff>找到佔用 port 的 process</font> ### powershell 此例為找到 80 port 的 process ~~~ Get-Process -Id (Get-NetTCPConnection -LocalPort 80).OwningProcess ~~~ 執行後的畫面 ![](https://i.imgur.com/5HcMFtv.png) 如果看到 ProcessName 還是看不出是哪個程式 可開啟 Windows 工作管理員的"詳細資料"頁籤找到和 Id 一樣的 PID,它就是兇手! ### cmd(Administrator) ~~~ C:\> netstat -a -b ~~~ #### 參考網址:[stackoverflow](https://stackoverflow.com/questions/48198/how-can-you-find-out-which-process-is-listening-on-a-port-on-windows) --- ## <font color=#0099ff>簡易查看是否 port 有被佔用</font> 以 port 9050 為例 ~~~ netstat -aon|findstr "9050" ~~~ --- ## <font color=#0099ff>Apache 開不起來或連不進去 </font> 1. 確定 Apache 服務正常開啟 2. 看 log ![](https://i.imgur.com/6BLjcsK.png) 3. 看事件檢視器 ![](https://i.imgur.com/nuZrf8B.png) --- ### CORS 相關 https://blog.techbridge.cc/2018/08/18/cors-issue/ ~~~ Vary: Origin ~~~ ~~~ <script>加上 crossorigin="anonymous",讓<script>發出去的 request 也有 origin header! ~~~ https://zhuanlan.zhihu.com/p/38972475