How to access my local [WAMP] webserver from outside the LAN? - webserver

I am trying to access my local [WAMP] webserver from any remote devide. I am so far able to access it from a device inside the LAN, but fail to do so from outside it. As far as i know, port forwarding is how we achieve this. But currently unable to do that correctly.
Present error when trying to connect :
Some of the articles which i have followed so far are:
general-port-forwarding-guide
how-can-i-access-my-server-from-outside-of-my-lan
how-to-expose-a-local-development-server-to-the-internet
The main steps which i follow are as follows:
Make sure server is accessible inside LAN.
Open router's port forwarding settings and port forward the set static ip address (in step 1). Set port 80 and 8080 for communicating.
Access the server via my public ip (can check public ip and if forwarded port is accessible from here)

This is a temporary solution for testing purposes only with 8 hour server connection duration time limit (and a limited no. of server connections):
access_local_server_remotely_for-Development-And-Testing-Only and here is a video guide about how to use it.

Related

Dataplicity unable to access port

I am having a problem in accessing ports with my Pi. I am using dataplicity to access it online.
I can access my page with this URL.
https://my_id.dataplicity.io
Can't access when I use this
https://my_id.dataplicity.io:9090/
But I can access it in my local.
http://localhost:9090/
What could possibly be the problem here?
Thanks!
At the present time wormhole forwards HTTP traffic to port 80 on your device but forwarding to other ports is not something that can be achieved by default.
The port forwarding feature is coming as part of our PRO pricing plan in future.
As an interim workaround, it is possible to redirect port 80 on your Pi to another local port on your Pi using a reverse proxy (for example using nginx). Although wormhole itself will still communicate with port 80 on your device, nginx could listen on port 80 and forward this to another local port of your choosing. Here's a nice article that could get you started:
https://www.keycdn.com/support/nginx-reverse-proxy/

Server Connection with public IP

I have setup a simple HTTP java server running locally on port 8000. It simply prints a message "Hello world" when a request comes. When I try to ping it from the browser by running http://localhost:8000/test I get my message printed.
I want to get the same results from another computer that is not local. When I try to use my public IP lets say http:/43.xxx.xxx.xxx:8000/test (even from the same machine) I get an ERR_CONNECTION_REFUSED .
I probably suspect that has something to do with the firewall. Can anyone guide me a little more because I lack the experience?
Thanks in advance
You don't specify what host OS your server/firewall is running so I'll keep this generic...
Without knowing your application, it seems like the server is sending a reset (RST packet) when the first SYN packet shows up indicating that the port (on that interface [your external]) is closed. You can do a quick port scan from here (https://mxtoolbox.com/PortScan.aspx) if you don't have access to a remote machine to test with. Odds are, TCP/8000 will not be open.
If it is, in fact, closed, you'll have to look at the firewall that your host OS is running and find out how to allow TCP/8000 to your host. In a major firewall vendor, your rule would look similar to this:
Source: Any
Destination: Your Public IP Address
Service: TCP/8000
Action: Allow
Logging: Full
That being said, you mentioned this was a PC so look into "iptables" (if you're running *nix) or the Windows Firewall (if you're running Windows) on adding firewall rules (Unfortunately I just joined and can't ask questions/comments, yet).
If you really want to find out what packet is being sent, run a tcpdump on your external interface (let's say eth1) (assuming your remote IP is 1.2.3.4 and your home public IP is 4.5.6.7):
tcpdump -nn -vvv -e -s 0 -X -c 100 -i eth1 host 1.2.3.4 and host
4.5.6.7 and port 8000
Here you're looking for the SYN/SYN-ACK/ACK for a successful TCP negotiation or SYN/RST if there is a firewall rejecting (not dropping) the TCP stream to the port.
Once the port is open on the host OS firewall, take a look at the application to make sure it's configured properly. If this were a standard webserver, you could take a look at the configuration files for the "Allow from" directives to make sure that everyone can access the site. If this is a custom application that you've created, you'll have to check this yourself.
I finally solved my problem. I needed to open a forwarding port in my router that maps my local ip address to the public. My router is TP Link so this what I did:
http://www.tp-link.com/us/faq-72.html
Also in order for this to work every time and not to have to reconfigure this every time I reconected to the router (because I get a new local IP), I have created a static local ip for my server following this guide:
http://www.tp-link.com/us/faq-182.html
Thanks for all the replies.

Connect Local Host from Web Service

I have a Laptop, with msSql sever 2005, and it is connected to my Wifi router which gets the internet. So My laptop get connected to internet. But I need to access my msSql Sever from internet to connect my webpage which I made using ASP.Net.
Please Help me... And please give a solution for this...
You'll need your IP adress to connect, then open the SQL-Port in your router. (default is 3306)
When you connect to the server just use your current ip adress.
Maybe you want a static ip or something like http://dyndns.org
you want to write web service and host that service in sql machine
First setup a static IP address on your laptop and after that you need to set up port forwarding in your router. This process differs slightly depending on your routers manufacturer and model.
After this is set up properly make sure that SQL Servers port is open on your laptops firewall.
By using Dynamic DNS you can point to your possibly changing IP address with static name so you don't have to change this constantly in your connection string.

Connecting to Local Web Server when I am Outside my LAN

I have a web server running out of my home. I have assigned it an address such as 192.168.1.123 on port 80.
I understand that this is running on my local network. If I go to another computer on my network and type in the server's ip address, I can see the server.
Is there a way to access this server from outside my LAN?
Yes, you need to set your router to forward connections to port 80 to your internal IP address (192.168.1.123). Look for Port Forwarding on your router admin screen which I would imagine you access by going to http://192.168.1.1
Keep in mind that your ISP may block port 80 completely in which case you can run your web server on a different port (for example por 8180) and have your router forward connections to port 8180 to your internal IP.
To access your server from outside, you just need to point your browser to your external IP address which you can find out by going to http://www.ipchicken.com
Assuming you have a connection to the internet:
https://github.com/progrium/localtunnel
is a quick way to access your local server from the internet. There might be similar implementations in other languages/platforms. This is just the one I know about.
Remember that security issues need to be carefully considered when opening your local network to the world.
If you use a PHP Webserver you can set it this way:
php -S <YourIPAdresse>:<SomePortNumber> <StartPHPpage>
Example: „php -S 192.168.1.123:9000 index.php"

Get ServiceDefinition.csdef from an Azure instance

I need to get the original endpoint configurations from the .csdef file, how can I do it?
I cannot use RoleEnvironment.CurrentRoleInstance.InstanceEndpoints, because it gives me the internal/local port in the virtual IP. But I need to know which is the port is being shown to the public.
For example I have a FTP server with a tcp 21 end point, but when I check at runrime to that collection it can has something like tcp 5100. When I bind the FTP server to tcp 5100 and access the server through, for example, 127.0.0.1:21 it works perfectly.
But for example, when I need to establish the PASV mode, I have to send back the IP and port where the client should connect. I'll work out the IP, but how could I know the port that has been configured for PASV? the port in the previous collection is not ensured to be the same that is exposed in the public interface.
So basically, how may I get the original .csdef configuration?
Cheers.
I'm not sure if this works with FTP but when using HTTP, it will returned the inner address and port if using HttpContext.Requst.Url. I was using Header["Host"] instead. Hope this helps.