tomcat-maven-plugin 403 error

前端 未结 21 1271
礼貌的吻别
礼貌的吻别 2020-12-07 18:05

When I use mvn tomcat:deploy of tomcat-maven-plugin there is a 403 error:

Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.0:deploy (default-cli) on pr

相关标签:
21条回答
  • 2020-12-07 18:30

    You can have a 403 error if you try to use the codehouse tomcat plugin version 1.1 to deploy on a Tomcat 7 server. Version 1.1 doesn't support Tomcat 7 yet.

    If you are using Tomcat 7 you should use Cargo.

    0 讨论(0)
  • 2020-12-07 18:30

    If you are facing a problem regarding user name and password please do not worry, there is a file in tomcat directory named tomcat-user.xml, go there and see the name and password attributes and use when the prompt ask for user name and password.

    If still you are unable to open apache home page do one thing, in the tomcat directory there is another file named server.xml go and change port 8080 to this

    0 讨论(0)
  • 2020-12-07 18:32

    If you are using version 7, there's a catch: the access to the /manager/text resource is not enabled by default.

    You must create a user with the role mananger-script, as it says in the documentation

    It would be quite unsafe to ship Tomcat with default settings that allowed anyone
    on the Internet to execute the Manager application on your server.
    Therefore, the Manager application is shipped with the requirement that anyone
    who attempts to use it must authenticate themselves, using a username and
    password that have the role manager-script associated with them.
    Further, there is no username in the default users file
    ($CATALINA_BASE/conf/tomcat-users.xml) that is assigned this role.
    Therefore, access to the Manager application is completely disabled by default.
    
    To enable access to the Manager web application, you must either create a new
    username/password combination and associate the role name manager-script with it,
    or add the manager-script role to some existing username/password combination.
    

    Hope it helps :)

    0 讨论(0)
  • 2020-12-07 18:33

    I discovered that I had to use the following string instead of "html":

    http://localhost:8080/manager/text
    
    0 讨论(0)
  • 2020-12-07 18:34

    For Tomcat7, in tomcat-users.xml you need rolename manager-script also:

    <role rolename="manager-gui"/>
    <role rolename="manager-script"/>
    <user username="tomcat" password="s3cret" roles="manager-script,manager-gui"/>
    

    and in project's POM.xml

    <plugin>
       <groupId>org.codehaus.mojo</groupId>
       <artifactId>tomcat-maven-plugin</artifactId>
       <configuration>
            <url>http://localhost:8080/manager/text</url>
            <server>myserver</server>
            <path>/sw</path>
       </configuration>
    </plugin>
    

    and maven's settings.xml:

    <servers>
     <server>
      <id>myserver</id>
      <username>tomcat</username>
      <password>s3cret</password>
     </server>
    </servers>
    
    0 讨论(0)
  • 2020-12-07 18:35

    I also get the 403 error, but only when I connect via Apache 2. When I use port 8080 and deploy to tomcat directly it works. So: try to add port 8080 to the URL

    I am still trying to figure out why it does not work via Apache. I am using ProxyPass / ajp://localhost:8009/ and

    <Location "/manager" >
         Order allow,deny
         Allow from 62.245.147.202
         Satisfy Any
       </Location>
    
    0 讨论(0)
提交回复
热议问题