新之助meow

Kratos
专注于用户阅读体验的响应式博客主题
  1. 首页
  2. 未分类
  3. 正文

使用jboss 作为web服务器发布静态页面,解决直接放到 welcome-content 目录时http响应信息的Content type为空的问题

2019年7月26日 483点热度 17人点赞 0条评论

我要在腾讯云申请亚信的免费证书,把验证文件直接放到了jboss 的welcome-content目录,但是亚信验证时报应答没有Content type,搜了一下说welcome-content的静态资源是没有Content type的,要换一种方式,用应用发布的方式来发布静态资源就正常了。
如下

  1. 停止jboss服务

  2. 修改配置文件stanalone.xml,将 enable-welcome-root 改为 false

    <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
      <configuration>
      <mime-mapping name="manifest" value="text/xml"/>
      </configuration>
    <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
    <virtual-server name="default-host" enable-welcome-root="false">
    <alias name="localhost"/>
    </virtual-server>
    </subsystem>
  3. 在应用发布目录 创建一个 ROOT.war 文件夹
    然后照如下创建子目录和jboss-web.xml文件

               ROOT.war
               ROOT.war/WEB-INF
               ROOT.war/WEB-INF/jboss-web.xml

    编辑jboss-web.xml 添加如下内容,将这个应用发布到 / 路径

    <?xml version="1.0" encoding="UTF-8"?>
    <jboss-web>
    <context-root>/</context-root>
    </jboss-web>
  4. 在发布目录添加 ROOT.war.dodeploy 文件,我这个是自动发布的,不需要手工创建

  5. 重启jboss服务

  6. ROOT.war目录就对应 web服务器的 /了,在他下面创建的目录和文件都可以访问了

参考文档
Content type of xml files in welcome-content is empty
https://developer.jboss.org/message/760819#760819

标签: 暂无
最后更新:2019年7月26日

tjccn_wx@hotmail.com

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

归档

  • 2026 年 10 月
  • 2024 年 2 月
  • 2023 年 7 月
  • 2023 年 1 月
  • 2022 年 10 月
  • 2022 年 9 月
  • 2022 年 6 月
  • 2022 年 4 月
  • 2022 年 3 月
  • 2022 年 2 月
  • 2021 年 11 月
  • 2021 年 10 月
  • 2021 年 9 月
  • 2021 年 1 月
  • 2020 年 12 月
  • 2020 年 11 月
  • 2020 年 10 月
  • 2020 年 9 月
  • 2020 年 7 月
  • 2020 年 6 月
  • 2020 年 5 月
  • 2020 年 4 月
  • 2020 年 3 月
  • 2020 年 2 月
  • 2019 年 10 月
  • 2019 年 8 月
  • 2019 年 7 月
  • 2019 年 4 月
  • 2019 年 3 月
  • 2018 年 12 月
  • 2018 年 11 月
  • 2018 年 10 月
  • 2018 年 6 月
  • 2018 年 5 月
  • 2018 年 4 月
  • 2018 年 3 月
  • 2018 年 2 月
  • 2018 年 1 月
  • 2017 年 12 月
  • 2017 年 11 月
  • 2017 年 10 月
  • 2017 年 9 月
  • 2017 年 8 月
  • 2017 年 7 月
  • 2017 年 6 月
  • 2017 年 5 月
  • 2017 年 4 月
  • 2017 年 3 月
  • 2017 年 2 月
  • 2017 年 1 月
  • 2016 年 12 月
  • 2016 年 11 月
  • 2016 年 10 月
  • 2016 年 9 月
  • 2016 年 8 月
  • 2016 年 7 月
  • 2016 年 6 月
  • 2016 年 5 月
  • 2016 年 4 月
  • 2016 年 3 月
  • 2015 年 12 月
  • 2015 年 8 月

分类

  • android
  • mysql
  • nethunter
  • proxmark
  • 未分类

COPYRIGHT © 2026 新之助meow. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang