Novell Home

Disabling HTTP but Keeping HTTPS for WebAccess

Novell Cool Solutions: Tip

Digg This - Slashdot This

Posted: 25 Sep 2007
 

Problem

A Forum reader recently asked:

"I have enabled https with certificate for my GroupWise7 system running on SLES 10 sp1. I can access WebAccess login via https, but I can also access it via http. If I go to yast and disable the http interface yet keep https enabled, it breaks apache2.

Does anyone know how to disable http but keep https?"

And here's the response from Kathy and from Tommy Mikkelsen ...

Solution

Kathy

This works - place it in the /etc/Apache2/https_redirect.conf file:
#########################################
#### XXX: BEGIN EDIT FOR MOD_REWRITE ####
#### This is intended to force HTTPS ####
#### for all inbound HTTP requests ####

####

    ####
    # This module (mod_rewrite) simply tells Apache2 that all connections 
to
    # port 80 need to go to port 443 - SSL - No exceptions
    ####

    <IfModule !mod_rewrite.c>
    LoadModule rewrite_module /usr/lib/apache2-prefork/mod_rewrite.so
    </IfModule>
    <IfModule mod_rewrite.c>
    RewriteEngine on

    ####
    # The line below sets the rewrite condition for mod_rewrite.so.
    # That is, if the server port does not equal 443, then this condition 
is true
    ####

    ReWriteCond %{SERVER_PORT} !^443$

    ####
    # The line below is the rule, it states that if above condition is 
true,
    # and the request can be any url, then redirect everything to https:// 
plus
    # the original url that was requested.
    ####

    RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
    </IfModule>

    #### XXX: END EDIT FOR MOD_REWRITE ####
    #######################################

Tommy Mikkelsen

For NetWare ...

In Apache2/conf, edit the httpd.conf file with this:

LoadModule rewrite_module modules/rewrite.nlm
<VirtualHost default:80>
      RewriteEngine On
      RewriteCond %{REQUEST_URI} ^\/gw
      RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]
</VirtualHost>

That way, all requests for server/gw will be redirected towards https. Remember to search and set the ServerName in the conf-file as well.


Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com

© 2014 Novell