Testing: Difference between revisions

Jump to navigation Jump to search
6,686 bytes removed ,  23 March 2022
m
Line 1: Line 1:


== Test connectivity to the web service ==
== 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]]
 
 
=== Connecting from the local machine to local server 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>}}
*** [https://docs.oracle.com/cd/E19504-01/802-5753/6i9g71m3i/index.html netstat Command] {{kbd | key=<nowiki>netstat -tulpn | grep LISTEN</nowiki>}} e.g.
** {{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>.
 
<pre>
$ netstat -tulpn | grep LISTEN
 
tcp        0      0 0.0.0.0:80              0.0.0.0:*              LISTEN      -
 
// means the 80 port service is running
</pre>
 
* 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]]
 
=== Connecting from LAN to the server ===
WAN &#9675; -------&gt; <span style="color:red">&#9679; LAN -------&gt; &#9679; 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.
 
* Is the service alive?
* Connect to the internal IP eg: {{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]]
 
=== Connecting from WAN to the 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 ==
== Connection test ==
Anonymous user

Navigation menu