Access Tomcat server Outside network - java

I have tomcat 8 server and I want my friend who is in another country to look my web application. I saw many answers regarding such question and followed everything (changing connector port address, router forwarding and firewall too). I am using Zyxel router and did forwarding and added my public ip address in Hosts file as well.
Can you please suggest me what step I am missing or doing anything wrong? Please note: while adding application in router (Port forwarding) I used server I address as my IP Address and Service Name as HTTP and Port 80.

Related

Access Jenkins from the Internet on Windows

I am new to Jenkins and I have been trying to access my Jenkins server from the Internet, so that you can access it from anywhere.
I set up a no-ip DNS server to be able to bind my public ip and create a Hostname which I added Jenkins URL, but I can't access it. Do I have to add any additional configuration to Jenkins? Could someone guide me how to access it? I am really new to this.
Note: Adding port 8080 to my firewall allows me to access my localhost from any device I have on my network.
Note 2: I am using Windows 10.
You should first check if it's accessible with IP and port from the Internet. If it's not you should configure your network to allow the port and route it to the server.
Your network router has to be configured to route the incoming requests on the given port from the Internet to your server. Or your server must have a public IP assigned.
Open a windows command prompt, and execute command ipconfig to see the IP addresses assigned to the system, if you don't see your public IP here that means your system is behind a router, and without proper router configuration this system can't be accessed from the Internet.
If your system receives its IP from a router, that router must be accessible from the Internet, meaning that router should be directly connecting to the Internet, and it must have "Port Forwarding" feature through which it can be configured to forward the incoming requests to a host in its network. Or if you can connect to the Internet directly without a network router from your system it will have a publicly accessible IP address.

Getting wrong ip address in java [duplicate]

This question already has answers here:
How do I get the remote address of a client in servlet?
(11 answers)
Closed 3 years ago.
I am sending request from my machine to server. Ip address of my machine is 192.168.1.217.
At server side I am printing the client Ip address, but when I am printing Ip address with request.getRemoteAddr() I am getting it as 192.168.0.5.
When I am printing Ip address with request.getHeader("X-FORWARDED-FOR") I am getting it as null.
I am using apache tomcat server.
If that IP address (192.168.0.5) is the (or a) firewall, then it is the right IP address. Your server-side code is reporting the "client" IP address that it sees, and it can't do any better.
In general, there are a couple of possible explanations as to what is going on:
The firewall could be running an HTTP proxy, and your client machine could be configured send all HTTP requests through the proxy. If the client is capable of talking directly to the server, then you may be able to modify the client's proxy settings to treat the server as an exception.
The firewall could be providing a NAT service that is isolating one part of you networks from another part (for example). If this is the issue, then you will need your network administrators' help.
It is common (and often "good practice") to run a Tomcat server on (say) port 8080, and put it behind a reverse proxy on port 80.
In your case, the first explanation is most likely.
#andrucz suggests using the Tomcat Remote IP Filter. That will work in some circumstances, but not all, and it is using information that can easily be "spoofed"
The bottom line is that it is common for a webserver to not be able to see the real IP addresses of clients. So it is inadvisable to implement your services to depend on this.
You can use Tomcat Remote IP Filter: http://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#Remote_IP_Filter
Maybe you will need network administrators' help to configure firewall to include "X-Forwarded-For" header.

run glassfish on home web server

This is the first time I set up a home web server and I use Glassfish for this.
I already did port forwarding to the computer in router I use as server.
I changed the port of glassfish( using netbean ) to 80
I changed address in network listener to the current ip address (192.168.1.xxx) that router forwards to
I don't know what I need to do next. what I am trying to do is that when I type router ip address into browser, it will be able to see my welcome page. However, what I've got so far is connection time out error.
My question is how can I config (my machine, glassfish server) to make it possible to access to glassfish server.

Can I access my application running on localhost:8080 from WAN..?

I developed an application in my home machine. Now I want to show application that i made to client through WAN. I have TP-Link WiFi router at my home. Is it possible using port forwarding or other solution ?
Yes, you can use port forwarding to make your application accessible from the Internet. Essentially, what you want to do is redirect traffic coming into your public IP on port 80 to the internal machine running tomcat on port 8080.
There are public guides available for configuring port forwarding on different routers.
Edit: Port forwarding however might not be the only problem. There are other things to consider:
1. You should use a static external IP and map it to a DNS name, so users will be able to access the site by typing the name in the address bar.
2. You should make sure that the machine running tomcat allows external connections to port 8080, so these aren't blocked by the firewall.

Incoming connection on port 80 to webserver application

I made a Java web application running on tomcat, what I'm trying to do now is letting people outside my net acceding my application.
I've read lot of guides and I understood I need to forward incoming traffic on port 80 to the raspberry hosting it (listening on port 8080).
What I did was going to the router panel and make a port forwarding with the following parameters:
Are all the parameters right?
What should i put in the remote IP address?
What I meant to do is redirecting request on port 80 to local port 8080 on which the raspberry is listening (if tomcat is listening to port 8080 if i write something like ip/webappname will I access my application?)
By the way, with the following settings, if I write my "outside" ip as url, I get prompted with a user\password form. I tried to make some tcpdump to try to understand if it's raspberry or router related, but I got tons of packets and couldn't find a way out, what could it be? Thanks.

Categories