網路服務連線測試: Difference between revisions

Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
如何測試與排除網路服務連線問題。找出問題發生的地方:(1) 伺服器上的本地服務 (localhost) (2) 從區域網路到伺服器 (3) 從廣域網路到伺服器
如何測試與排除網路服務連線問題。找出問題發生的地方:(1) 伺服器上的本地服務 (localhost) (2) 從區域網路到伺服器 (3) 從廣域網路到伺服器


: [[Test connectivity for the web service]] in English
{{LanguageSwitcher | content = [[Test connectivity for the web service | EN]], [[網路服務連線測試 | 漢字]] }}


=== 如何連線到網路服務 (Web 服務) ===
=== 如何連線到網路服務 (Web 服務) ===
Line 32: Line 32:
# {{kbd | key = telnet 127.0.0.1 <PORT>}} 如果連接網頁服務失敗。它將顯示消息:"telnet: 無法連接到遠程主機:連接被拒絕"
# {{kbd | key = telnet 127.0.0.1 <PORT>}} 如果連接網頁服務失敗。它將顯示消息:"telnet: 無法連接到遠程主機:連接被拒絕"


如果安裝了Python,則使用替代網站服務
如果安裝了 Python 或 Node.js,則可使用替代網站服務


* (對於python 2.x) {{kbd | key=<nowiki>python -m SimpleHTTPServer <port></nowiki>}}<ref>[https://docs.python.org/2/library/simplehttpserver.html 20.19. SimpleHTTPServer 簡單HTTP請求處理器 — Python 2.7.17 文件]</ref>
* (適用 python 3.x) {{kbd | key=<nowiki>python -m http.server <port></nowiki>}} (預設 port: 8000)<ref>[https://docs.python.org/3/library/http.server.html http.server HTTP servers — Python 3.13.2 documentation]</ref>
* (對於python 3.x) {{kbd | key=<nowiki>python -m http.server <port></nowiki>}}<ref>[https://docs.python.org/3.8/library/http.server.html?highlight=http%20server#module-http.server http.server — HTTP伺服器 — Python 3.8.1 文件]</ref>
* (適用 Node.js) {{kbd | key=<nowiki>npx http-server -p <port></nowiki>}} (預設 port: 8080)<ref>[https://github.com/http-party/http-server http-server: a simple static HTTP server]</ref>


== 測試本地網路服務的連接性 ==
== 測試本地網路服務的連接性 ==
WAN &#9675; -------&gt; &#9675; LAN -------&gt; <span style="color:red">&#9679; 伺服器</span>
WAN &#9675; -------&gt; &#9675; LAN -------&gt; <span style="color:red">&#9679; 伺服器</span>


: [[Image:Owl icon.jpg]] 如果您有管理權限通過SSH或遠程桌面服務登錄伺服器。
{{Tips}} 如果您有管理權限通過SSH或遠程桌面服務登錄伺服器。


=== 檢查您的電腦/伺服器是否被指派了IP位址 ===
=== 檢查您的電腦/伺服器是否被指派了IP位址 ===
Line 100: Line 100:
// means the 80 port service is running
// means the 80 port service is running
</pre>
</pre>
* {{Win}}
** Using the software [http://www.nirsoft.net/utils/cports.html CurrPorts] to check the process and port. e.g. Apache will not running if the 80 port was occupied by skype<ref>[http://stackoverflow.com/questions/4705005/how-to-solve-wamp-and-skype-conflict-on-windows-7 How to solve WAMP and Skype conflict on Windows 7? - Stack Overflow]</ref>.


=== Check if a port is blocked by browser ===
=== Check if a port is blocked by browser ===

Navigation menu