webapps with SSL

Awd

Verified User
Joined
Aug 9, 2015
Messages
316
Assume you have custombuild 2, You need to edit custombuild/options.conf and set

Code:
redirect_host=your.server.name
redirect_host_https=yes
 

gate2vn

Verified User
Joined
Nov 9, 2004
Messages
298
I should write that I tried that already too. It didn't resolve the issue.
 

Awd

Verified User
Joined
Aug 9, 2015
Messages
316
Do you have a SSL certificate for your servername?
Can you access your Directadmin login anyway through https?
 

gate2vn

Verified User
Joined
Nov 9, 2004
Messages
298
Yes I do. I installed wildcard SSL. And yes, DA is working fine with https.
 

Awd

Verified User
Joined
Aug 9, 2015
Messages
316
Okay, let´s start at the beginning: First
Code:
cd /usr/local/directadmin/custombuild
./build update
./build set use_hostname_for_alias yes
./build set redirect_host_https yes
./build rewrite_confs
to be sure you build everything right.

If you access it directly through https://your.server.name/roundcube, do you see a secured connection?

because maybe you mean that you want to FORCE http to https if anypone try to access through unsecured http, then add (Credit goes to zEitEr) near the bottom of the /etc/httpd/conf/extra/httpd-includes.conf the following:

Code:
################################################################################
#                          HTTP to HTTPS Rewrite
################################################################################
<location /phpMyAdmin>
  RewriteEngine On
  RewriteCond %{HTTPS} off
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</location>
<location /webmail>
  RewriteEngine On
  RewriteCond %{HTTPS} off
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</location>
<location /squirrelmail>
  RewriteEngine On
  RewriteCond %{HTTPS} off
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</location>
<location /roundcube>
  RewriteEngine On
  RewriteCond %{HTTPS} off
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</location>
<location /atmail>
  RewriteEngine On
  RewriteCond %{HTTPS} off
  RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</location>
then restart httpd (Apache)
 
Last edited:

gate2vn

Verified User
Joined
Nov 9, 2004
Messages
298
Thanks for suggestion. If using httpd-includes.conf, yes, now it's working. Without it, redirect is not working. A bug in CB for redirect_host_https?
 
Top