Access to Tomcat server has not been authorized

后端 未结 8 2005
遇见更好的自我
遇见更好的自我 2021-01-04 03:01

I have used glassfish server in netbeans, now I changed to tomcat and when I run my web application that I have created in glassfish gives me the error :

D         


        
相关标签:
8条回答
  • 2021-01-04 03:58

    In Ubuntu with Tomcat 7 and Netbeans 7:

    Follow @Satya instructions:

    Check the tomcat-users.xml of the "Catalina Base" directory. (Right-click Apache Tomcat 7.xx (under Servers) and look for the connection tab).

    Then you should make sure that your tomcat-users.xml has something like this:

    <user username="admin" password="admin" roles="manager-script"/>
    

    (if you want to be REALLY sure, although it is NOT RECOMMENDED, you can put in roles="manager-script,manager-gui,manager-status,manager-jmx")

    Additionally, you can look for the file build-impl.xml under nbproject folder and go to line:

    <nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
    

    Change debugmode from "false" to "true". This will allow you to see the errors in Netbeans directly.

    Finally, I had to add read permissions tomcat-users.xml for tomcat7 ** (it seems that when editing as root the permissions changed) and in the **logs folder of tomcat, add permissions to the user that runs Netbeans (usually your user). I did it creating a "development" group and added my user and tomcat7 to that group, then I changed the group of the logs giving reading permissions.

    Last tip: start Tomcat doing right-click in the Servers section in Netbeans instead of running /etc/init.d/tomcat7 start. That way you will see the logs in the Netbeans console.

    0 讨论(0)
  • 2021-01-04 04:04

    Complementing the other answers - I was adding the user line i.e.

    <user password="123" roles="manager-script,admin" username="pir fahim" />
    

    as people said, but I what I was missing was to simply restart tomcat after that.

    Don't forget to restart tomcart service or the changes won't take effect.

    0 讨论(0)
提交回复
热议问题