Article

coolguys's picture
article
Reads:

7351

Score:
0
0
 
Comments:

0

Disabling HTTP but Keeping HTTPS for WebAccess

Author Info

25 September 2007 - 1:46am
Submitted by: coolguys

(View Disclaimer)

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.


Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).

It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.




User Comments

© 2013 Novell