tomcat 403 forbidden - unable to access my project deployed in webapps

I have deployed my war file in webapps folder and its gets unzipped when I start tomcat. Everything works fine on localhost. But when I try to access my webapps project html page from different machine I'm getting "403 fordidden". Please Note that this is not stardard tomcat, since the product that i'm working on is enterprise product, we have modified the tomcat(which im not aware of). I tried to change catalina.policy file with following changes

 grant codeBase "file:$/webapps/Visualization/-" < permission java.net.SocketPermission "*.us.companyname.com:8080", "connect"; permission java.net.SocketPermission "*.us.companyname.com", "connect"; permission java.net,SocketPermission "*.us.companyname.com:80", "connect"; >; 

Also the next guess that i had was changing the permissions in tomcat-user.xml file, but there does not exist any such file. Any pointers for the above problem is appreciated. Thanks,

asked Aug 11, 2016 at 0:22 107 1 1 gold badge 4 4 silver badges 12 12 bronze badges Commented Aug 11, 2016 at 0:26

All of these FAQ's point to configuring tomcat-users.xml file which in my case does not exits. I also tried grant< java.security.AllPermission; >; in catalina.policy, but that too didn't work

Commented Aug 11, 2016 at 0:45

I don't think that SecurityExceptions result in 403 responses. Anything in the log files? What kind of authentication and authorization are you using with your application?

Commented Aug 11, 2016 at 3:20

I was able to revolve this issue. We had a configuration in server.xml which restricted connections only from localhost

Commented Aug 11, 2016 at 21:03

2 Answers 2

Tomcat in my machine is already running on Port 8080 from Tomcat installation path directly (Apache Software Foundation\apache-tomcat-7.0.32\bin\startup.bat). Now I also need to run the same tomcat server from eclipse and changed the port to 8081 (as we can't run 2 different server instances with same port) which thrown the exception 403 Forbidden when tried launching my web application.

So changed the port number from 8080 to 8089 and started the server. Now I'm able to launch my web application successfully in eclipse with out any issue.

Note: Tomcat Server started with out any issues on port number 8081 which thrown 403 Forbidden exception when tried to launch my web application.