`

HTTP Status 403 - Access to the requested resource

阅读更多
刚刚解压版的apache-tomcat-5.5.23,启动setup.bat后,通过浏览器访问:http://127.0.0.1:8080/manager/html
在登录界面输入用户名 both 和密码 tomcat 后出现下面的错误提示:

HTTP Status 403 - Access to the requested resource has been denied


--------------------------------------------------------------------------------

type Status report

message Access to the requested resource has been denied

description Access to the specified resource (Access to the requested resource has been denied) has been forbidden.
问题原因:

D:\apache-tomcat-5.5.25\conf 目录下的

tomcat-users.xml 文件内容如下:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="role1" password="tomcat" roles="role1"/>
</tomcat-users>
问题修改:将tomcat-users.xml 文件内容改为

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager"/>
<role rolename="admin"/>
<user username="admin" password="admin" roles="admin,manager"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="role1" password="tomcat" roles="role1"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
</tomcat-users>


分享到:
评论

相关推荐

    servlet2.4doc

    Causes the next filter in the chain to be invoked, or if the calling filter is the last filter in the chain, causes the resource at the end of the chain to be invoked. doFilter(ServletRequest, ...

    acpi控制笔记本风扇转速

    Added #pragma pack(8/4) to acobject.h to ensure that the structures in this header are always compiled as aligned. The ACPI_OPERAND_OBJECT has been manually optimized to be aligned and will not work ...

    a project model for the FreeBSD Project.7z

    They are also the developers who elect the core team, and they have access to closed discussions. The project can be grouped into four distinct separate parts, and most developers will focus their ...

    完美解决axios跨域请求出错的问题

    Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://localhost:9000’ is therefore not ...

    LCTF软件备份VariSpec™ Liquid Crystal Tunable Filters

    In earlier revisions, the error status light was cleared after a VsSetWavelength() call failed, so the user did not see the light turn red to alert that an error had occurred. This has been fixed in ...

    Delphi7.1 Update

    * This update can not be removed after it is installed.* You will need the original Delphi 7 installation CD available to install this update.* To install this update from the CD, insert the CD, and ...

    PHP AJAX 实现跨域保存数据的问题(网页留言表单提交数据的问题).rar

    header('Access-Control-Allow-Headers: X-Requested-With, Content-Type'); ``` 3. **Access-Control-Allow-Credentials**:如果需要在跨域请求中携带Cookie,需要设置`Access-Control-Allow-Credentials`为`...

    Nginx跨域配置.zip

    add_header Access-Control-Allow-Headers 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; if ($request_method = 'OPTIONS') { return 204; } ``` ...

    Spring Cloud出现Options Forbidden 403问题解决方法

    response.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); response.setHeader("Access-Control-Expose-Headers", "Location"); chain.doFilter(req, res); } ...

    terraform-aws-api-gateway-enable-cors:轻松向API网关资源添加OPTIONS方法以启用CORS

    "method.response.header.Access-Control-Allow-Headers" = "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,x-requested-with'" } } ``` 这段代码首先创建了一个API Gateway REST API和一个资源,然后定义了...

    10种跨域解决方案.docx

    当尝试跨域访问时,通常会遇到以下错误消息:“No 'Access-Control-Allow-Origin' header is present on the requested resource”。 **2. 同源示例** 要确定两个URL是否同源,需要检查它们的三个关键组成部分:...

    JAVA通过Filter实现允许服务跨域请求的方法

    response.setHeader("Access-Control-Allow-Headers", "Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Content-Type"); response.setHeader("Access-Control-...

    JS跨域访问解决方案总结

    为了解决跨域访问问题,W3C工作组发布了一个名为**Cross-Origin Resource Sharing (CORS)**的推荐标准。CORS提供了更安全、更灵活的方式来处理跨域数据交换,其核心机制是通过HTTP头部信息来控制哪些资源可以被其他...

    乐优商城.xmind

    CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. 跨域问题 浏览器对于ajax请求的一种安全限制:一个页面发起的ajax请求,只能是于当前页同域名的路径,这能有效的...

    ajax上传图片,PHP上传图片,PHP上传图片跨域,跨域上传图片,上传图片缩览图

    header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With"); ``` 最后,创建图片缩览图通常是为了优化显示和节省服务器存储空间。在PHP中,我们可以...

    springmvc跨域处理和过滤器方式跨域处理主要代码

    response.setHeader("Access-Control-Allow-Headers", "x-requested-with"); if ("OPTIONS".equalsIgnoreCase(request.getMethod())) { response.setStatus(HttpServletResponse.SC_OK); } else { chain....

    SS7、PRI Cause定义.txt

    Response to STATUS ENQUIRY - **定义**:对STATUS ENQUIRY的响应。 - **应用场景**:当网络收到STATUS ENQUIRY消息后返回的状态信息。 - **技术背景**:这用于提供有关网络状态的信息。 #### 22. Normal, ...

    layui-table-cros:layui表格跨域请求

    response.setHeader("Access-Control-Allow-Headers", "X-Requested-With, Content-Type, Accept, Origin, Authorization"); // 设置允许的自定义头部 response.setHeader("Access-Control-Allow-Credentials", ...

Global site tag (gtag.js) - Google Analytics