Test connectivity for the web service: Difference between revisions
Jump to navigation
Jump to search
no edit summary
No edit summary |
|||
| Line 1: | Line 1: | ||
find the problem occurred: (1) local service at the server (localhost) (2) from LAN to server (3) from WAN to server | find the problem occurred: (1) local service at the server (localhost) (2) from LAN to server (3) from WAN to server | ||
=== How to connect to | === How to connect to the web service === | ||
If the service is the web server: | If the service is the web server: | ||
* (1) Open the browser, (2) Type the address: {{kbd | key = <nowiki>http://127.0.0.1</nowiki> }} | * (1) Open the browser, (2) Type the address: {{kbd | key = <nowiki>http://127.0.0.1</nowiki> }} or {{kbd | key =<nowiki>http://the.domain</nowiki>}} | ||
* Linux command: | |||
* Linux lynx command: | |||
*# (optional if lynx was not installed) {{kbd | key = <nowiki>yum install lynx</nowiki>}} for CentOS / {{kbd | key = <nowiki>sudo apt-get install lynx</nowiki>}} for Ubuntu<ref>[http://www.addictivetips.com/ubuntu-linux-tips/install-and-use-lynx-on-ubuntu/ Install and Use Lynx Browser on Ubuntu]</ref> | *# (optional if lynx was not installed) {{kbd | key = <nowiki>yum install lynx</nowiki>}} for CentOS / {{kbd | key = <nowiki>sudo apt-get install lynx</nowiki>}} for Ubuntu<ref>[http://www.addictivetips.com/ubuntu-linux-tips/install-and-use-lynx-on-ubuntu/ Install and Use Lynx Browser on Ubuntu]</ref> | ||
*# {{kbd | key = <nowiki>lynx http://127.0.0.1</nowiki>}} <ref>[http://lynx.isc.org/lynx2.8.7/lynx2-8-7/lynx_help/Lynx_users_guide.html Lynx Users Guide v2.8.7]</ref> for {{Linux}} | *# {{kbd | key = <nowiki>lynx http://127.0.0.1</nowiki>}} <ref>[http://lynx.isc.org/lynx2.8.7/lynx2-8-7/lynx_help/Lynx_users_guide.html Lynx Users Guide v2.8.7]</ref> for {{Linux}} | ||
* telnet command | |||
# {{kbd | key = telnet 127.0.0.1 <PORT>}} e.g. {{kbd | key = telnet 127.0.0.1 80}} | *# {{kbd | key = telnet 127.0.0.1 <PORT>}} e.g. {{kbd | key = telnet 127.0.0.1 80}} or {{kbd | key = telnet the.domain 80}} | ||
# (after telnet-ed the web 80 port, key in) {{kbd_plus | key1 = get | key2 = SPACE}} | *# (after telnet-ed the web 80 port, key in) {{kbd_plus | key1 = get | key2 = SPACE}}<ref>[http://www.simplescripts.de/http-check-port-80-telnet-command.htm HTTP Check Port 80 with the Telnet Command]</ref> | ||
* curl: {{kbd | key = <nowiki>curl -v -o /dev/null http://IP:Port</nowiki>}} If failed. It will show the message: "failed: Connection refused" | |||
* use the third-party website monitoring the services: [[Web Ping]] | |||
If the service is not the web server, use telnet instead | |||
# (optional) [https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc771275(v=ws.10) Install Telnet Client | Microsoft Docs] on {{Win}}. [https://medium.com/@blackSource/bring-telnet-back-on-macos-high-sierra-11de98de1544 Bring telnet back on macOS high Sierra – Ayuth Mangmesap (blackSource) – Medium] on {{Mac}} | |||
# {{kbd | key = telnet 127.0.0.1 <PORT>}} If failed to connect the web service. It will show the message: "telnet: Unable to connect to remote host: Connection refused" | |||
Using alternative web services if the Python was installed | Using alternative web services if the Python was installed | ||
* (for python 2.x) {{kbd | key=<nowiki>python -m SimpleHTTPServer <port></nowiki>}}<ref>[https://docs.python.org/2/library/simplehttpserver.html 20.19. SimpleHTTPServer — Simple HTTP request handler — Python 2.7.17 documentation]</ref> | * (for python 2.x) {{kbd | key=<nowiki>python -m SimpleHTTPServer <port></nowiki>}}<ref>[https://docs.python.org/2/library/simplehttpserver.html 20.19. SimpleHTTPServer — Simple HTTP request handler — Python 2.7.17 documentation]</ref> | ||
* (for 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 servers — Python 3.8.1 documentation]</ref> | * (for 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 servers — Python 3.8.1 documentation]</ref> | ||
| Line 84: | Line 77: | ||
WAN ○ -------> <span style="color:red">● LAN -------> ● server</span> | WAN ○ -------> <span style="color:red">● LAN -------> ● server</span> | ||
Testing on LAN (local network, subnet scope): The different servers between LAN or with the same ip class (ex: 1.2.3.*) may not have the firewall limit. | Testing on LAN (local network, subnet scope): The different servers between LAN or with the same ip class (ex: 1.2.3.*) and may not have the firewall limit. [https://en.wikipedia.org/wiki/Private_network Private network] / Private IP address | ||
* Is the service alive? | * Is the service alive? | ||