如何为 NetBeans 设置 Tomcat 管理器应用程序用户名和密码? [英] How do I set Tomcat Manager Application User Name and Password for NetBeans?

查看:23
本文介绍了如何为 NetBeans 设置 Tomcat 管理器应用程序用户名和密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试按照教程在 NetBeans 中制作一个非常基本的 Java Web 应用程序.

I'm trying to follow a tutorial to make an extremely basic Java web application in NetBeans.

当我尝试运行它时,会出现一个标题为需要身份验证"的对话框.在对话框内有标题Tomcat Manager Application"以及用户名"和密码"字段.

When I try to run it, a dialogue box appears title "Authentication Required". Inside the dialogue box there the heading "Tomcat Manager Application" and fields for "User Name" and "Password."

调查这个,我开始明白我应该编辑文件

Investigating this, I've come to understand that I should edit the file

TOMCAT_HOMEconf	omcat-users.xml

包括以下内容:

<user username="user" password="password" roles="standard,manager"/>

所以我已经这样做了,但还没有帮助.

so I've done that, but it hasn't helped yet.

谁能提供一些见解?我使用的是 Tomcat 6.0.20、NetBeans 6.7.1 和 Windows Vista.我用的是jdk1.7.0,但是Java还没有真正进入这个项目.

Can anyone provide some insight? I'm using Tomcat 6.0.20, NetBeans 6.7.1, and Windows Vista. I'm using jdk1.7.0, but Java hasn't really entered into this project yet.

推荐答案

当您从 netbeans IDE 启动 tomcat 服务器时,您需要在 tomcat 服务器的连接选项卡上的菜单工具->服务器"中检查 - 有 catalina 基础目录.您需要包含以下内容:

When you're launching tomcat server from netbeans IDE you need to check in menu "tools->servers" on connection tab for tomcat server - there is catalina base directory. And you need to include something like:

 <role rolename="manager"/>
  <user username="admin" password="admin" roles="manager"/>

在文件

CATALINA_BASEconf	omcat-users.xml

或使用 IDE 自动生成的用户名,描述已放置在此文件或连接选项卡上

or use username automatically generated by IDE with description already placed in this file or on connection tab

对于 Manager 应用程序:GUI 访问:

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

这篇关于如何为 NetBeans 设置 Tomcat 管理器应用程序用户名和密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆