user3117841
user3117841

Reputation:

How to avoid application access using IP in network?

I have application named MailSys. When I run it's login page it's url is something like this :

http://localhost:8080/MailSys/login.jsp

This application is on my computer. But my PC is connected to network, so anyone can access my application using my IP like:

192.168.0.18:8080/MailSys/login.jsp

So is there any way to avoid this access to my application? I am developing application in JAVA using Eclipse.

Upvotes: 0

Views: 637

Answers (3)

user3117841
user3117841

Reputation:

iptables -A INPUT/ -p tcp --dport 8080 -j DROP

You can blocking a port using Iptables,

Which is quite secured consider it's on OS level,

or you can modify tomcat config,

<Connector port="8080" address="127.0.0.1" maxHttpHeaderSize="8192"

to only allow localhost access 8080, (in case you want to use the manager app etc)

link

Upvotes: 1

bmanvelyan
bmanvelyan

Reputation: 159

IP addresses is used to access to computers in IP networks. so if you want to provide public access to your application you can't restrict access to is using only domain names. If you are going to restrict access to your application during development and allow access only for yourself you need ether configure firewall to restrict access to 8080 port of your computer, or configure your servlet container to listen only local host IP address 127.0.0.1 for i.e. see here

Upvotes: 0

Husman
Husman

Reputation: 6909

Yes, block port 8080 on your firewall. Or even better do it at the router level.

If your on windows, you can go to the windows firewall in control panel and go to advanced setting, where you can set a rule, to block port 8080 incoming.

Upvotes: 0

Related Questions