Https redirection

From SME Server
Revision as of 06:39, 20 February 2010 by RayMitchell (talk | contribs) (added alternative method using custom template fragment and db commands)
Jump to navigationJump to search

https forced redirection using custom template

This is a link to an earlier Howto that is still applicable to sme7.x http://distro.ibiblio.org/pub/linux/distributions/smeserver/contribs/rmitchell/smeserver/howto/https%20ibay%20forced%20redirection%20HOWTO%20for%20sme%20server.htm

I will revise the Howto & add it here when time permits

Alternative method using custom template and db commands

Here is an alternative method based on this forum thread http://forums.contribs.org/index.php/topic,31772.new.html#new

At a command prompt do the following:

cp /etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess40ibays /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/90e-smithAccess40ibays

Edit the custom template fragment:

pico -w /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/90e-smithAccess40ibays

It should contain the following code:

$OUT .= "\n";
$OUT .= "#------------------------------------------------------------\n";
$OUT .= "# $key ibay directories ($properties{'Name'})\n";
$OUT .= "#------------------------------------------------------------\n";
$OUT .= "\n";
$OUT .= "<Directory /home/e-smith/files/ibays/$key/html>\n";
## custom code addition
       if($properties{'SSLRequireSSL'})
       {
       if($properties{'SSLRequireSSL'} eq 'on')
           {
           $OUT.="     SSLRequireSSL\n";
           }
       }
## / custom code addition

Save & exit:

Ctrl c
Ctrl x

Then for each ibay you wish to enable secure https access for do:

db accounts setprop ibayname SSLRequireSSL on

(where ibayname is the name of the applicable ibay)

Follow the above with:

expand-template /etc/httpd/conf/httpd.conf
sv t /service/httpd-e-smith