Test connectivity for the web service: Difference between revisions
| Line 5: | Line 5: | ||
WAN ○ -------> ○ LAN -------> <span style="color:red">● server</span> | WAN ○ -------> ○ LAN -------> <span style="color:red">● server</span> | ||
=== How to connect to local web service === | |||
: [[Image:Owl icon.jpg]] If you has administrative permission to log into the server via SSH or Remote desktop service. | |||
If the service is the web server: | |||
* (1) Open the browser, (2) Type the address: {{kbd | key = <nowiki>http://127.0.0.1</nowiki> }} | |||
* 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}} | |||
If the service is not the web server, use telnet instead | |||
# {{kbd | key = telnet 127.0.0.1 <PORT>}} e.g. {{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] | |||
Revision as of 18:05, 23 March 2022
find the problem occurred: (1) local service at the server (localhost) (2) from LAN to server (3) from WAN to server
Connecting from the local machine to web service at the same server
WAN ○ -------> ○ LAN -------> ● server
How to connect to local web service
If the service is the web server:
- (1) Open the browser, (2) Type the address: http://127.0.0.1
- Linux command:
If the service is not the web server, use telnet instead
- telnet 127.0.0.1 <PORT> e.g. telnet 127.0.0.1 80
- (after telnet-ed the web 80 port, key in) get + SPACE
- more on HTTP Check Port 80 with the Telnet Command
Check if your computer/server Is being assigned the IP Address
- Linux
: (1) Check the IP Address. ifconfig. (2) Re-assign the IP Address and restart the networking service. service network restart for CentOS[3] - Win
: Check the IP Address. ifconfig/all - More on Network problem
Is the service alive or the port was occupied by other process?
Check the port if used by other protocol
- Linux
- nmap "Network exploration tool and security / port scanner." e.g. nmap -p 80,443 ip
- ss "utility to investigate sockets" e.g. ss -tnlp | grep 80 or using OR operator[4] ss -tnlp | grep '80\|443'
- ps List the current processes. Input ps -aux | grep "PORT_NUMBER" e.g. ps -aux | grep 443
- netstat Command netstat -tulpn | grep LISTEN e.g.
- Win
Using the software CurrPorts to check the process and port. e.g. Apache will not running if the 80 port was occupied by skype[5].
$ netstat -tulpn | grep LISTEN tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN - // means the 80 port service is running
Is the port opened for external users?
Check the OS firewall or protected by antivirus software
- Linux
- iptables: (1) iptables -L to list all rules[6] (2) rule with smaller line-number will override the rule with larger line-number[7]
- FirewallD rules: (1) sudo firewall-cmd --get-default-zone return 'public' (2) sudo firewall-cmd --list-all --zone=public[8] (3) Allow port with FirewallD
- SELinux Policy Management: (1) After installed policycoreutils-python[9], input semanage port -l to list open ports. (2) Allow port with semanage.
- Win
Windows Firewall with Advanced Security -> configure firewall rules - protected by antivirus software?
- Linux
- connect to localhost ex: telnet 127.0.0.1 23 where 23 is the port number where the service running
- Install Telnet Client on Win
- if the local service is web server, you can also try lynx http://127.0.0.1 for Linux
- Install Telnet Client on Win
- double check the server/service logs
Connecting from LAN to the server
WAN ○ -------> ● LAN -------> ● server
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: telnet 172.18.0.1 23 (1) IP start with 172.18... is 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. lynx http://172.18.0.1 for Linux
- Double check the server/service logs
- Is the internal IP correct?
Connecting from WAN to the server
WAN ● -------> ● LAN -------> ● server
We met the trouble on WAN (wide area network). If we do no have the administrative permission, the tests we can do as follows:
- Down for everyone or just me? more on 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 What Is My IP Address? or web access log.
- Query the IP Address Details - ipinfo.io. e.g. Input the command curl ipinfo.io/ip[10] for macOS
& Linux
- Is the port was opened for external users? Open Port Check Tool - Port Forwarding Port Check Tool
- Is institutional/ISP firewall enabled? Contact your MIS. (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: Refresh your cache - When hitting F5 just isn't enough!
References
- ↑ Install and Use Lynx Browser on Ubuntu
- ↑ Lynx Users Guide v2.8.7
- ↑ How to restart the networking service? - Ask Ubuntu
- ↑ 7 Linux Grep OR, Grep AND, Grep NOT Operator Examples
- ↑ How to solve WAMP and Skype conflict on Windows 7? - Stack Overflow
- ↑ HowTos/Network/IPTables - CentOS Wiki
- ↑ How to edit iptables rules - FedoraProject
- ↑ How To Set Up a Firewall Using FirewallD on CentOS 7 | DigitalOcean
- ↑ semanage command not found on CentOS 7 and RHEL 7
- ↑ networking - Command for determining my public IP? - Ask Ubuntu
Troubleshooting of ...
- PHP, cUrl, Python, selenium, HTTP status code errors
- Database: SQL syntax debug, MySQL errors, MySQLTuner errors or PostgreSQL errors
- HTML/Javascript: Troubleshooting of javascript, XPath
- Software: Mediawiki, Docker, FTP problems, online conference software
- Test connectivity for the web service, Web Ping, Network problem, Web user behavior, Web scrape troubleshooting
Template