I was trying to host a web page from my laptop. I followed the steps as mentioned below:
-
I used Apache Tomcat as Web Server; I have placed the webpage, which I wanted to host inside 'webapps' folder.
-
I tried to start the apache server manually by clicking the "startup" batch file.
- Then, when I tried to access the webpage from browser using the URL "localhost:8086/JK/JK.html", I was able to see the web page content successfully.
[ #Note: 8086 is the port, where the apache server is hosted JK is the folder inside the 'webapps' folder of Apache software JK.html is the web page name.]
- Now, I tried replacing 'localhost' with the local IP(i.e., 192.168.1.105) & I was able to access the same successfully.
- Also, I was able to access the same from all the computers/devices, which are connected to the same network.
- However, my intention to access that web page from a device, which doesn't belong to the same network from which the webpage is hosted.
- When I browsed about this, I found the concept of "port forwarding". So, I tried to access my router's homepage by visiting the default gateway page(i.e., 192.168.1.1) & I tried to do the port forwarding to the port-8086. Even after doing the port forwarding, I was not able to access the web page from a device, which is connected to another network. I tried using the following URLs: "103.66.79.147:8086/JK/JK.html" where, 103.66.79.147 - Public IP, obtained from whatismyip.com "100.71.18.106:8086/JK/JK.html" where, 100.71.18.106 - WAN IP address, obtained from Router's home page
Note: The WAN IP address(which is present in the router's home page) and public IP (obtained from whatismyip.com) are different. From this, it is simply evident that there is another router, which is present between my router and Internet.
As per my understanding, 'port forwarding' simply means that the router will forward the requests that it receives to a particular port(say, 8086) to a local computer in the network [say, 192.168.1.105(local IP) ; 8086(local port)].
If I'm correct, the connection is not complete, because the public IP and WAN IP address present in router's home page are different.
What could be the solution?
I'm just a beginner, who is curious in learning new stuffs.
Any help would be greatly appreciated.
Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire