1

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:${catalina.base}/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,

Vishal
  • 107
  • 1
  • 4
  • 12
  • Check out some of these similar Q&As: [How to fix access to the requested resource which has been denied for Tomcat webapp?](http://serverfault.com/questions/426848/how-to-fix-access-to-the-requested-resource-which-has-been-denied-for-tomcat-web), [How to fix Tomcat HTTP Status 403: Access to the requested resource has been denied?](http://stackoverflow.com/questions/5808206/how-to-fix-tomcat-http-status-403-access-to-the-requested-resource-has-been-den), [403 access denied on tomcat 7.0.42](http://stackoverflow.com/questions/19325636/403-access-denied-on-tomcat-7-0-42) – chickity china chinese chicken Aug 11 '16 at 00: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 – Vishal Aug 11 '16 at 00: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? – Christopher Schultz Aug 11 '16 at 03:20
  • I was able to revolve this issue. We had a configuration in server.xml which restricted connections only from localhost – Vishal Aug 11 '16 at 21:03

2 Answers2

0

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

user2807083
  • 2,962
  • 4
  • 29
  • 37
Vishal
  • 107
  • 1
  • 4
  • 12
0

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.

Suresh
  • 1,491
  • 2
  • 22
  • 27