Wamp server is unable to access using public ip address - networking

I have trying to connect my phone with the wampserver I created and is looking forward for an OTP based application. I aim to have a different network for both the PC and mobile and look forward to use public IP for accessing. To enable port forwarding I have changed the port in httpd.conf to
Listen 8080
and in my router settings I have added separate entries: one for TCP and one for UDP packets.
Lastly, I have also enabled
# onlineoffline tag - don't remove
Require all granted
in the httpd.conf file as well. Technically, I should be able to access my wampserver by
http://{public IP address}:{8080}/
I have also given access to the port 8080 in my firewall, but when I do check online the status of port in public IP, it shows 8080 port is closed on the {public IP address}. Unfortunately, I am not able to access the following server. I am bit confused at the moment and I guess I am stuck with something really silly. I will be deeply obliged if anyone could help me with the issue.

If your port is still closed / blocked you probably have another router / firewal / ... blocking it. Does your internt providor maybe have a router of their own in front of your router?

Related

Can I use any other port than the default for MQTT with TLS-authentication?

I have set up a mosquitto-broker on my raspberry pi which I have running on my local network. I've tested this locally using the paho-mqtt package in python which is working, however I want to access this broker remotely (outside my local network).
From what I understand, the safest way to do this is to use TLS-authentication and configure mosquitto to listen on port 8883, rather than opening the un-encrypted 1883 port, where login credentials can be sniffed. This is where my problems start, as I suspect my ISP doesn't allow forwarding port 8883 to the (static) IP-address of my RPi. (Port wont open no matter what I try, and I've tried googling this specific issue.)
So my question is:
Is it possible to use another port than the default 1883 or 8883 (which my ISP hopefully allows to be opened) for accessing my locally hosted mosquitto-broker? For example one of the higher-valued ports, which I understand is not reserved for anything.
I'm imagining connecting to the broker by using my external IP-address with this port (xxx.xxx.xxx.xxx:yyyyy) and either tunneling this data to the 8883-port on the local network, or configuring mosquitto to listen on the selected port. Any tips on how I can solve this issue?
EDIT
Thanks for your answers! I just got off the phone with my ISP, and unfortunately they don't allow opening ANY ports because I live in a university dorm, so opening a different port won't work either. I guess using a cloud broker is the only option.
You can use any ports you want (or that your operating system will permit). MQTT uses certain ports by convention but is not restricted to using those ports. You're even welcome to encrypt on port 1883 if you want.
You'll need to do four things:
write the listener configuration directive correctly to use the port you want to use and make sure that you're listening on 0.0.0.0 in order to listen on all network interfaces, or the IP address of a specific network interface to listen on.
correctly configure encryption after the listener directive
ensure that the port you chose is accessible through any firewall your server may be running
properly configure any clients to use the port you configured and work with the encryption you configured
If you want to make it accessible over the Internet you'll need to open a port on your router as well.
If you do make it accessible over the Internet, please require authentication. Encryption won't stop strangers from connecting to your broker, it will just stop eavesdropping on them. Turn off allow_anonymous and set up some Mosquitto accounts.

What could be the reason behind "ERR_CONNECTION_TIMED_OUT"?

I am using (airtel xstream fiber) connection and trying to do port forwarding. I forwarded port 3000 of wan and direct it to my system ip address 192.168.1.2 on port 3001.
Node server is running on my system on port 3001. And I can access my hello world website locally using 192.168.1.2:3001. But when I am trying to access using public ip, it show this error code "ERR_CONNECTION_TIMED_OUT".
Also, I found my router port 3001 is open using online port checking tool/website.
So, Can anyone please tell what could be reason behind this ? Is this the problem with windows.
You first need to check what ports are open by your ISP. If your ISP is giving you a local ip at the router. Basically, creating a ppp connection. It may be using a cg nat. In that case you need to buy a static ip, without that none of the traffic will be Directed to your router. Let me know if you find something, I'm currently looking to get xstream airtel as well.
No there is no need for static IP to be access server remotely. As of now, What I see is airtel allocates new ip every 24 hr or when router got disconnected. To access your server remotely you can do two things. First one is more secured.
Change Primary IP adress of your airtel router and use Portforwarding so that its port 80 will be free for you.
Enable DMZ and point it to your local server IP. [192.168.X.X]. In this case all of your ports of the device are exposed to internet. If you want to be secure. Make sure add another router between server and airtel router and enable port forwarding.
But in this case there is a catch, When you try to access your local website using public ip (which you can see on google search) it will redirect you to airtel router panel. But when you try to access it using other device (not server otherwise server will get disconnected) connected to internet using other network(other that your current airtel router like JIO sim, Airtel Sim, etc), It will work excellently.
To get rid of dynamic ip use no-ip services. Its website will help you more. Basically, It is dynamic dns server where you will get free domain. That will get update regularly while its service running on your system. To use other dns provider service like godaddy you must need an static ip.

Port-forwarding and website hosting: Two domains, same ip, different computer

So I have two domains:
http://firstexample.com
http://secondexample.com
on my router I currently have portforwarding so that when someone goes to http://firstexample.com, they see the website that my computer with internal IP 192.168.0.15 is hosting
How can I set it up so that if someone goes to http://secondexample.com, they would see the website that my other computer, with internal ip 192.168.0.16 is hosting?
Both of my computers have the same public IP.
Is it a setting on my router I would change? Or would godaddy allow me to configure something?
No it is not possible to listen for two domains on the same IP/port configuration, using just Layer3/4 functionality alone. Most of the web servers do it based on the Host field in the request. If you are okay with using two ports on your router, that's possible eg. you can do something like following port forwarding
<router_ip>:80 -> 192.168.0.15:80
<router_ip>:8080 -> 192.168.0.16:80
But the problem with that is anyone trying to access http://secondexample.com should always access it as http://secondexample.com:8080 which is very inconvenient.
Here's another alternative you can do -
run a webserver on say 192.168.0.15 like nginx or something and create two backends one for each http://firstexample.com and http://secondexample.com . Refer nginx docs for how to do it. You'd not need three machines for that firstexample.com can run on 192.168.0.15 (except not on a standard port 80 but on a port 8080 say) and secondexample.com would run on another machine. And then add only following entry on your router port forwarding
<router_ip>:80 -> 192.168.0.15:80 # assuming ngninx is listening on port 80.
I am assuming both firstexample.com and secondexample.com do resolve to your router IP address.

HttpListener working on local network, but not externally

I am attempting to spin up an application that listens on a port and responds to HTTP requests. I am on a Windows 8 machine connecting through a Netgear router that provides port forwarding. I have:
modified my DNS zone file of one of my domains to point to the IP address that is assigned to my cable modem
Added a port-forwarding rule to my router that sends requests to port 8080 to port 8081 on my computer
Opened port 8081 on my Windows Firewall
Executed netsh http add urlact http://+:8081/ user=Everyone listen=yes as administrator
Started up my app which uses the simple webserver solution found at http://codehosting.net/blog/BlogEngine/post/Simple-C-Web-Server.aspx which uses an HttpListener object with a prefix of http://+:8081/.
From any machine on my local network, I can browse to http://home.example.com:8080/blah/blah and everything works great. Whenever I attempt the same URL from a machine connected elsewhere on the Internet, the connection times out. I have tried using the IP address instead the domain name, and have tried disabling my Windows Firewall (temporarily), still with no luck.
I'm sure this is more of a network setup issue than a code issue, but I thought I would ask anyway to see if there is anything I can do. Sorry for the spaces in the urls above. This is my first post to SO, and I apparently don't have enough of a reputation to post more than a single link.
By "elsewhere on the Internet", I am assuming you are attempting to access it from a different ISP.
The thing about some ISPs is that unless you are paying for a "business class" connection, they will do all sorts of tricks to ensure that you remain a "consumer". What you need is an unNATed static IP address.
By this I mean that the IP address that you may have at your home may not be accessible to the outside world because the ISP is actually NATing (or other) that address to you. This is a fairly common practice because of limited IP4 addresses. If you really want a service accessible via the WWW, I would suggest moving your product to a VPN, or at least a commodity hosting provider.
Edit: Try a VPN service like Hamachi

Can network admin change the default port for http

I gave an answer to following thread. but in the comment a user suggested that network admin can change the default port of http from 80 to something else.
As for as I know if I open a page eg. http://www.example.com without port that means it is running on port 80.
I just want to clarify that is it possible for network admin to change default port?
When using a browser, http://www.example.com will always try and connect to the server's TCP port 80, like it's port 443 for HTTPS connections. These port numbers (defined here) are hard coded in any browser.
Yet a web server can be configured to listen to any other port, which rarely makes sense though. If it does, the browser will be unable to connect (unless the port no. is explicitly given as in http://myserver.com:81).

Resources