WLP ::在http上更改默认上下文根

Sil*_*lva 2 websphere websphere-liberty

当我在我的websphere liberty profile v8.5.5(让我们假设http://my.domain.com)上进行http get时,我会看到一个很好的页面,其中包括"欢迎使用WebSphere Application Server V8.5" Liberty Profile"

它看起来像这样http://rdt1.demos.ibm.com/

如何将我的服务器配置为不显示此页面,并可能将我的请求重定向到https上的登录页面?

这是与要安装的新应用程序的新上下文根相关的配置吗?喜欢下面这个答案? 如何使"HTTPS重定向"在WebSphere Application Server Liberty Profile上运行? 我觉得这应该是在server.xml上配置的东西,但我找不到任何对此的引用.

提前致谢!

小智 5

您可以通过将以下内容添加到server.xml文件来关闭该页面:

<httpDispatcher enableWelcomePage="false" />
Run Code Online (Sandbox Code Playgroud)

http://www-01.ibm.com/support/knowledgecenter/api/content/nl/en-us/SSRTLW_9.0.0/com.ibm.websphere.wlp.nd.multiplatform.doc/autodita/rwlp_metatype_4ic.html# mtFile119

编辑:

我应该澄清一下,另一个答案也是正确的.如果安装带有"/"作为上下文根的应用程序,则将使用它来代替主页面.

如果您向该应用程序的web.xml添加以下内容:

<security-constraint>
    <display-name>Some constraint</display-name>
    <web-resource-collection>
        <web-resource-name>All</web-resource-name>
        <description>All URLs</description>
        <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <description>All users</description>
        <role-name>User</role-name>
    </auth-constraint>
    <user-data-constraint>
        <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
</security-constraint>
Run Code Online (Sandbox Code Playgroud)

您将获得您要求的https重定向.

附加编辑(每条评论),以下是如何设置重定向的更完整示例: 如何使"HTTPS重定向"在WebSphere Application Server Liberty Profile上运行?