Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
394 views
in Technique[技术] by (71.8m points)

websphere - WLP :: Change default context root on http

When I do a http get on my websphere liberty profile v8.5.5 (let's assume http://my.domain.com) I'm presented with a nice page that says amongs other things "Welcome to the WebSphere Application Server V8.5 Liberty Profile"

It looks like this http://rdt1.demos.ibm.com/

How do I configure my server to not display this page and perhaps redirect my request to a login page on https?

Is this a configuration related to a new context root of a new app to be installed? Like this answer below? How to make "HTTPS redirect" work on WebSphere Application Server Liberty Profile? I feel like this should be something configured on server.xml but I can't find any reference to this.

Thanks in advance!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can turn that page off by adding the following to your server.xml file:

<httpDispatcher enableWelcomePage="false" />

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

edit:

I should clarify, the other answer is also correct. If you install an application with "/" as the context root, it will be used instead of the main page.

If you add something like the following to that application's 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>

You will get the https redirect that you're asking for.

Additional edit (per comment), the following is a more complete example of how to set up the redirect: How to make "HTTPS redirect" work on WebSphere Application Server Liberty Profile?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...