WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Trying to use multiple virtual domain for redirect

    Posted 12/06/21 07:56 PM

    Trying to configure multiple virtual domains with only one virtual domain configured to be SSL, rest are configured only on Port 80 (non-SSL).

    Everything is good with xyz.org but when user access https://abc.org its provided with xyz.org certificate. We expect users to get an SSL error rather being server with xyz.org certificate (still error) and let them proceed.

    <VirtualHost *:80>

    ServerName xyg.org

    RewriteEngine on

    RewriteRule "^/(.*)" "https://www.xyz.org/$1" [L,R,NE]

    </VirtualHost>

    <VirtualHost *:443>

    ServerName xyg.org

    SSLEnable

    SSLCompression off

    SSLProtocolEnable TLSv12

    SSLProtocolDisable SSLv2 SSLv3 TLSv10 TLSv11

    SSLServerCert xyg.org

    KeyFile /usr/IBM/HTTPServer/keys/pdsrv.kdb

    CustomLog logs/access.log SSL

    </VirtualHost>

    <VirtualHost *:80>

    ServerName abc.org

    ServerAlias abc.org

    RewriteEngine on

    RewriteCond "%{HTTP_HOST}" "^www.abc.org" [OR]

    RewriteCond "%{HTTP_HOST}" "^abc.org"

    RewriteRule "^(.+)" "https://www.abc.org/redirect" [L,R,NE]

    </VirtualHost>



    #Support
    #SupportMigration
    #WebSphereHTTPServer


  • 2.  RE: Trying to use multiple virtual domain for redirect

    Posted 12/06/21 08:01 PM

    If you are using IHS 8.5.5, you have to specify the following too globally (best to do it before the first port 80 vhost)

    NameVirtualHost *:80

    You also want in the abc.org vhost:

    ServerAlias www.abc.org



    #Support
    #SupportMigration
    #WebSphereHTTPServer


  • 3.  RE: Trying to use multiple virtual domain for redirect

    Posted 12/06/21 08:17 PM

    Tried this and didn't work and getting an error:

    # /usr/IBM/HTTPServer/bin/apachectl start

    AH00548: NameVirtualHost has no effect and will be removed in the next release /usr/IBM/HTTPServer/conf/virtualhost1.conf:24

    NameVirtualHost *:80

    <VirtualHost *:80>

    ServerName abc.org

    ServerAlias www.abc.org

    RewriteEngine on

    RewriteCond "%{HTTP_HOST}" "^www.abc.org" [OR]

    RewriteCond "%{HTTP_HOST}" "^abc.org"

    RewriteRule "^(.+)" "https://www.abc.org/redirect" [L,R,NE]

    </VirtualHost>



    #Support
    #SupportMigration
    #WebSphereHTTPServer


  • 4.  RE: Trying to use multiple virtual domain for redirect

    Posted 12/06/21 08:21 PM

    OK, that is 9.0 so it's not your problem.


    Going back to what you first wrote.


    "but when user access https://abc.org its provided with xyz.org"


    There is only 1 port 443 virtual host, so there is only 1 certificate this webserver can ever use. If you want to serve two different certificates for the same IP and port combination, you'll need to configure SNI. There are two ways to structure it:


    https://publib.boulder.ibm.com/httpserv/manual24/mod/mod_ibm_ssl.html#SNI



    #Support
    #SupportMigration
    #WebSphereHTTPServer


  • 5.  RE: Trying to use multiple virtual domain for redirect

    Posted 12/06/21 08:30 PM

    Yes its 9.0.5.7


    I tried SNI but again second virtual host (abc.org) is not configured with 443 and https should simple fail (since its only Port 80). However xyz.org cert is being given to users when access abc.org


    How can I avoid that when user access abc.org, server does not to provide them with xyz.org certificate but simple fail when accessing over https.



    #Support
    #SupportMigration
    #WebSphereHTTPServer


  • 6.  RE: Trying to use multiple virtual domain for redirect

    Posted 12/06/21 08:34 PM

    It is not possible to "just fail". When the user types https://abc.org the browser resolves it to the servers IP address and starts a handshake on port 443. IHS is listening on this IP and port, and the handshake has to be completed.



    #Support
    #SupportMigration
    #WebSphereHTTPServer