Testing: Difference between revisions

Jump to navigation Jump to search
12,650 bytes removed ,  14 August 2023
m
no edit summary
mNo edit summary
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:


== troubleshooting steps for connection test ==
== Test connectivity for the web service ==
find the problem occurred: (1) local service at the server (localhost) (2) from LAN to server (3) from WAN to server
[[Test connectivity for the web service]]
 
 
=== (1) local service ===
WAN &#9675; -------&gt; &#9675; LAN -------&gt; <span style="color:red">&#9679; server</span>
 
Testing on localhost if you have the administrative permission to manage the server.
* Check if your computer/server Is being assigned the IP Address.
** {{Linux}}: (1) Check the IP Address. {{kbd | key = ifconfig}}. (2) Re-assign the IP Address and restart the networking service. {{kbd | key = service network restart}} for CentOS<ref>[http://askubuntu.com/questions/230698/how-to-restart-the-networking-service How to restart the networking service? - Ask Ubuntu]</ref>
** {{Win}}: Check the IP Address. {{kbd | key = ifconfig/all}}
** More on [[Network problem]]
* Is service alive? Is the port occupied by other process?
** {{Linux}}
*** [http://linux.die.net/man/1/nmap nmap] "Network exploration tool and security / port scanner." e.g. {{kbd | key = <nowiki>nmap -p 80,443 ip</nowiki>}}
*** [http://linux.die.net/man/8/ss ss] "utility to investigate sockets" e.g. {{kbd | key = <nowiki>ss -tnlp | grep 80</nowiki>}} or using OR operator<ref>[http://www.thegeekstuff.com/2011/10/grep-or-and-not-operators/ 7 Linux Grep OR, Grep AND, Grep NOT Operator Examples]</ref> {{kbd | key = <nowiki>ss -tnlp | grep '80\|443'</nowiki>}}
*** [http://linuxcommand.org/man_pages/ps1.html ps] List the current processes. Input {{kbd | key = <nowiki>ps -aux | grep "PORT_NUMBER"</nowiki>}} e.g. {{kbd | key = <nowiki>ps -aux | grep 443</nowiki>}}
** {{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>.
* Is the port opened for external users? OS firewall or protected by antivirus software.
** {{Linux}}
*** [http://linux.die.net/man/8/iptables iptables]: (1) {{kbd | key = iptables -L}} to list all rules<ref>[http://wiki.centos.org/HowTos/Network/IPTables HowTos/Network/IPTables - CentOS Wiki]</ref> (2) rule with smaller line-number will override the rule with larger line-number<ref>[https://fedoraproject.org/wiki/How_to_edit_iptables_rules?rd=User_talk:Rforlot How to edit iptables rules - FedoraProject]</ref>
*** [https://fedoraproject.org/wiki/FirewallD FirewallD] rules: (1) {{kbd | key = <nowiki>sudo firewall-cmd --get-default-zone</nowiki>}} return 'public' (2) {{kbd | key = <nowiki>sudo firewall-cmd --list-all --zone=public</nowiki>}}<ref>[https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-using-firewalld-on-centos-7 How To Set Up a Firewall Using FirewallD on CentOS 7 | DigitalOcean]</ref> (3) Allow port with FirewallD
*** [http://linux.die.net/man/8/semanage SELinux Policy Management]:  (1) After installed {{kbd | key =policycoreutils-python}}<ref>[http://sharadchhetri.com/2014/10/07/semanage-command-found-centos-7-rhel-7/ semanage command not found on CentOS 7 and RHEL 7]</ref>, input {{kbd | key = <nowiki>semanage port -l</nowiki>}} to list open ports. (2) Allow port with semanage.
** {{Win}} [https://technet.microsoft.com/en-us/library/cc754274.aspx?f=255&MSPPError=-2147217396 Windows Firewall with Advanced Security] -> configure firewall rules
** protected by antivirus software?
* connect to localhost ex: {{kbd | key= telnet 127.0.0.1 23}} where 23 is the port number where the service running
** [https://technet.microsoft.com/en-us/library/cc771275(v=ws.10).aspx Install Telnet Client] on {{Win}}
** if the local service is web server, you can also try  {{kbd | key = <nowiki>lynx http://127.0.0.1</nowiki>}} for {{Linux}}
* double [[Testing#check_the_server.2Fservice_logs | check the server/service logs]]
 
=== (2) from LAN to server ===
WAN &#9675; -------&gt; <span style="color:red">&#9679; LAN -------&gt; &#9679; server</span>
 
* testing on LAN (local network, subnet scope): Is service alive? The different servers between LAN or with the same ip class (ex: 1.2.3.*) may not have the firewall limit.
** connect to localhost ex: {{kbd | key= telnet 172.18.0.1 23}} (1) IP start with 172.18... is [http://www.itcom.itd.umich.edu/backbone/umnet/privateIP.html Private IP Network Numbers] (2) where 23 is the port number where the service running
*** If the local service is web server, you can also try to connect the internal ip e.g. {{kbd | key = <nowiki>lynx http://172.18.0.1</nowiki>}} for {{Linux}}
* double [[Testing#check_the_server.2Fservice_logs | check the server/service logs]]
 
=== (3)  from WAN to server ===
<span style="color:red">WAN &#9679; -------&gt; &#9679; LAN -------&gt; &#9679; server</span>
 
We met the trouble on WAN (wide area network). If we do no have the administrative permission, the tests we can do as follows:
*  [http://downforeveryoneorjustme.com/ Down for everyone or just me?] more on [[Web_Ping#同時從世界各處測試網站連線 | Web Ping]]
* Switch to different ISP? Is hardware firewall enabled?
* Is gateway alive?
* Is DNS alive?
* Is the external IP correct?
** If the firewall rule is IP specified, verify the IP if correct from [http://whatismyipaddress.com/ What Is My IP Address?] or web access log.
** Query the [http://ipinfo.io/ IP Address Details - ipinfo.io]. e.g. Input the command {{kbd | key = <nowiki>curl ipinfo.io/ip</nowiki>}}<ref>[https://askubuntu.com/questions/95910/command-for-determining-my-public-ip#comment1318649_95910 networking - Command for determining my public IP? - Ask Ubuntu]</ref> for {{Mac}} & {{Linux}}
* Is the port was opened for external users? [http://www.portchecktool.com/ Open Port Check Tool - Port Forwarding Port Check Tool]
* Is institutional/ISP firewall enabled? Contact your MIS. ([https://en.wikipedia.org/wiki/Management_information_system Management information system]) of your company or ISP?
 
other issue:
* bandwidth cost too much by certain users
* exceed the request limit of (hardware) firewall
* the external connection of updated Windows was down until reboot {{Win}}
* Amazon EC2 security group
* refresh browser cache: [http://refreshyourcache.com/en/cache/ Refresh your cache - When hitting F5 just isn't enough!]
 
== connection test ==
=== case 1: Access the server from outside network ex: WAN ===
Where are you? Access the server from outside network ex: Wide Area Network (WAN) or Local Area Network (LAN)
 
open the browser from outside network ex: Wide Area Network (WAN) or Local Area Network (LAN)
* and type the address: {{kbd | key =<nowiki>http://the.domain</nowiki>}} {{exclaim}} Note: Not [https://en.wikipedia.org/wiki/Private_network Private network] / Private IP address
* or use the remote website monitoring services: [[Web Ping]]
 
Using alternative web services
* (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>
 
Using telnet client
* (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}}
* telnet ''DOMAIN_or_IP'' ''PORT'' ex: {{kbd | key = telnet the.domain 80}}
** If connected. The console windows will show the message "Escape character is '^]'. " for {{Linux}}. Or show a blank window for {{Win}} If you want to end the telnet command. You can (1) press {{Kbd plus | key1 = Ctrl | key2 = ]}} and (2) keyin {{Kbd | key = quit}} to end the telnet.
** If failed. It will show the message: "telnet: Unable to connect to remote host: Connection refused"
 
curl
* {{kbd | key = curl -v -o /dev/null http://IP:Port}} If failed. It will show the message: "failed: Connection refused"
 
tools
# [http://check-host.net/ Check server: Check host - online website monitoring, Check IP] "checks the possibility of a TCP connection to host's specified port from different locations around the world." quoted from website. {{access | date=2015-08-02}}
 
=== case 2: Access the server from inside ex: localhost or Local LAN ===
If you has permission to log in the server via SSH or Remote desktop service.
* (1)open the browser, (2)type the address: {{kbd | key = <nowiki>http://127.0.0.1</nowiki> }}
* [http://www.canyouseeme.org/ Open Port Check Tool]: ''Using browser'' to check the specified port of local machine from canyouseeme.org. {{exclaim}} it may returned wrong result if the server hosted with shared external IP
* Linux 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>
*# {{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
# {{kbd | key = telnet 127.0.0.1 80}}
# (after telnet-ed the web 80 port, key in) {{kbd_plus | key1 = get | key2 = SPACE}}
# more on [http://www.simplescripts.de/http-check-port-80-telnet-command.htm HTTP Check Port 80 with the Telnet Command]
 
netstat ex: find MySQL 3306 port
# {{kbd | key = <nowiki>netstat -a | find "3306"</nowiki>}} (note: require the '''double quote''' symbol, not single quote symbol) for {{Win}}<ref>[http://technet.microsoft.com/en-us/library/bb490947.aspx Netstat]</ref> or {{kbd | key = <nowiki>netstat -npl | grep 3306</nowiki>}}<ref>[http://www.cyberciti.biz/faq/find-out-which-service-listening-specific-port/ Linux / UNIX Find Out What Program / Service is Listening on a Specific TCP Port]</ref> for {{Linux}}
# more on [http://www.techrepublic.com/blog/security/list-open-ports-and-listening-services/443 List open ports and listening services]
 
tools
# {{Gd}} [http://www.nirsoft.net/utils/cports.html CurrPorts: Monitoring TCP/IP network connections on Windows]
# [http://portforward.com/help/portcheck.htm PFPortCheck Program]: check TCP/UDP port from localhost(where you installed the program) to portforward.com
# [http://technet.microsoft.com/en-us/sysinternals/bb897437 TCPView for Windows]
 
 


== user client node ==
== user client node ==
Line 119: Line 15:
* Clear server cache ex: [http://www.smarty.net/manual/en/caching.php Smarty Caching]
* Clear server cache ex: [http://www.smarty.net/manual/en/caching.php Smarty Caching]


==== online IDE ====
==== Online IDE ====
code snippet web-based editor  / communication tools between developers/designers
[[Programming online (Online IDE)]]
* [http://codepad.org/ codepad] {{access | date=2012-10-02}} {{access | date = 2014-10-07}}
* [http://cssdesk.com/ CSSDesk] HTML, CSS {{access | date=2013-02-11}}
* [http://dabblet.com/ The first commented line is your dabblet’s title ✿ dabblet.com]: view the [http://dabblet.com/gist/2779082 sample] of html and css {{access | date = 2012-08-22}}
* [http://ideone.com/ Ideone.com] "Online IDE & Debugging Tool >> C/C++, Java, PHP, Python, Perl and 40+ compilers and interpreters"
* [http://jsbin.com/ JS Bin - Collaborative JavaScript Debugging]: HTML, CSS, Javascript<ref>[http://blog.miniasp.com/post/2013/06/30/Useful-tool-JS-Bin-Collaborative-JavaScript-Debugging.aspx The Will Will Web - 介紹好用工具:JS Bin ( 網站前端工程師的學習利器 )]</ref>
* [http://jsfiddle.net/ jsFiddle] {{access | date = 2014-10-07}}
* [http://plnkr.co/ Plunker] support JS, Angular, React, AngularJS & Preact {{access | date = 2018-08-08}}
* [https://implode.io/ Implode.io] for PHP {{access | date = 2018-03-15}}
* [https://rextester.com/ Rextester] {{access | date = 2019-01-13}}
* [https://codesandbox.io/ CodeSandbox: Online Code Editor Tailored for Web Application Development] Support Angular, React, Vanilla, Vue, Gatsby, Next.js, Node, Nuxt.js, Unibit, React + TS and Vanilla + TS
 
database testing
* [http://ideone.com/ Ideone.com] support SQL {{exclaim}} not support REGEXP function {{access | date = 2015-03-09}}
* [http://sqlfiddle.com/ SQL fiddle] support MySQL, MS SQL server, Oracle, PostgreSQL, SQLite ...  {{exclaim}} data may not showed in couple days {{access | date = 2015-03-09}}
 
Save or share source codes
* [http://pastie.org/ Pastie] with syntax highlighting
* [http://pastebin.com/ Pastebin.com - #1 paste tool since 2002!]
* [http://tny.cz/ Tinypaste - The easiest way to host your text]


=== browser plug-ins issue ===
=== browser plug-ins issue ===
Line 290: Line 167:
* [[Bug report template]]
* [[Bug report template]]


== references ==
== References ==
<references/>
<references/>


Line 306: Line 183:
[[Category:MySQL]]
[[Category:MySQL]]
[[Category:Linux]]
[[Category:Linux]]
[[Category:Testing]]
Anonymous user

Navigation menu