Pages

Wednesday, February 24, 2016

http to https auto redirect for webmin virtualhosts



*** WE have a site  http://mail.tayabkhan.com and we need to redirect https://mail.tayabkhan.com

IF we use virtualmin then edit Virtual Host-> eanble features -> tick  SSL website enabled?
If  there is not virtualmin, webmin then generate ssl.cert and ssl.key and use in virtualhost.

Edit httpd.conf file...

NameVirtualHost *:80
NameVirtualHost 192.168.10.10:443


<VirtualHost 192.168.10.10:443>
ServerAdmin webmaster@tayabkhan.com
ServerName  mail.tayabkhan.com
DocumentRoot /home/tayabkhan/public_html
ErrorLog /var/log/virtualmin/tayabkhan.com_error_log
CustomLog /var/log/virtualmin/tayabkhan.com_access_log combined


    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile    /home/tayabkhan/ssl.cert
    SSLCertificateKeyFile /home/tayabkhan/ssl.key
    SetEnvIf User-Agent ".*MSIE.*" \
        nokeepalive ssl-unclean-shutdown \
        downgrade-1.0 force-response-1.0
</VirtualHost>

<VirtualHost *:80>
    ServerName mail.tayabkhan.com
    Redirect / https://mail.tayabkhan.com/
</VirtualHost>

<IfDefine SSL>
<IfDefine !NOSSL>


</IfDefine>
</IfDefine>


1 comment:

  1. The King Casino: The New King & The World of Gaming
    The King https://jancasino.com/review/merit-casino/ Casino is the new place where the real money gambling is https://deccasino.com/review/merit-casino/ legal in communitykhabar Florida and Pennsylvania. We febcasino.com love the new casino. We've got some great worrione

    ReplyDelete