15,050
edits
Tags: Mobile edit Mobile web edit |
|||
| (6 intermediate revisions by the same user not shown) | |||
| 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 | |||
{{LanguageSwitcher | content = [[Test connectivity for the web service | EN]], [[網路服務連線測試 | 漢字]] }} | |||
=== How to connect to the web service === | === How to connect to the web service === | ||
| Line 30: | Line 32: | ||
# {{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" | # {{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 or Node.js was installed | ||
* (for python | |||
* (for | * (for python 3.x) {{kbd | key=<nowiki>python -m http.server [port]</nowiki>}} (default port: 8000)<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 Node.js) {{kbd | key=<nowiki>npx http-server [-p port]</nowiki>}} (default port: 8080)<ref>[https://github.com/http-party/http-server http-server: a simple static HTTP server]</ref> | |||
== Test connectivity for the local web service == | == Test connectivity for the local web service == | ||
WAN ○ -------> ○ LAN -------> <span style="color:red">● server</span> | WAN ○ -------> ○ LAN -------> <span style="color:red">● server</span> | ||
{{Tips}} If you has administrative permission to log into the server via SSH or Remote desktop service. | |||
=== Check if your computer/server Is being assigned the IP Address === | === Check if your computer/server Is being assigned the IP Address === | ||
| Line 51: | Line 54: | ||
=== Check if MySQL has started successfully? === | === Check if MySQL has started successfully? === | ||
==== Using lsof command ==== | |||
* {{kbd | key = lsof -i:3306}} on {{Mac}} or {{Linux}} | * {{kbd | key = lsof -i:3306}} on {{Mac}} or {{Linux}} | ||
| Line 65: | Line 69: | ||
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME | COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME | ||
mysqld 93034 account 29u IPv4 0xxxx 0t0 TCP localhost:mysql (LISTEN) | mysqld 93034 account 29u IPv4 0xxxx 0t0 TCP localhost:mysql (LISTEN) | ||
</pre> | |||
==== Using ps command ==== | |||
* {{kbd | key = <nowiki>ps aux | grep mysql</nowiki>}} on {{Mac}} | |||
Example output if MySQL has started successfully: | |||
<pre> | |||
_mysql 11083 0.3 0.2 409657280 31424 ?? Ss 2:12下午 0:01.07 /usr/local/mysql/bin/mysqld --user=_mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --log-error=/usr/local/mysql/data/mysqld.local.err --pid-file=/usr/local/mysql/data/mysqld.local.pid --keyring-file-data=/usr/local/mysql/keyring/keyring --early-plugin-load=keyring_file=keyring_file.so | |||
ACCOUNT 12349 0.0 0.0 408645328 1648 s011 S+ 2:14下午 0:00.00 grep mysql | |||
</pre> | |||
Example output if MySQL has NOT started successfully: | |||
<pre> | |||
ACCOUNT 12349 0.0 0.0 408645328 1648 s011 S+ 2:14下午 0:00.00 grep mysql | |||
</pre> | </pre> | ||