Novell Cool Solutions

Disabling HTTP but Keeping HTTPS for WebAccess

coolguys

By:

September 25, 2007 2:46 am

Reads:10,385

Comments:0

Score:Unrated

Print/PDF

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.

0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.
Loading...Loading...

Categories: Uncategorized

0

Disclaimer: This content is not supported by Novell. 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 it thoroughly before using it in a production environment.

Comment

RSS