httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Mehler <dave.meh...@gmail.com>
Subject Re: [users@httpd] Redirecting virtual host to https in Apache 2.4
Date Wed, 19 Feb 2014 04:43:19 GMT
Hello,

My thanks to everyone who helped. What I did was set up an additional
virtual host which points to the https one with a rewrite. It's
probably not the best way, but it does work. Here's my config:


<VirtualHost *:443>
     ServerAdmin xxx
     ServerName webmail.example.com
     ServerAlias webmail.example.com
     DocumentRoot /srv/http/webmail
     ErrorLog "/var/log/httpd/webmail.example.com_error_log"
     CustomLog "/var/log/httpd/webmail.example.com_access_log" common
SSLEngine on
SSLCipherSuite HIGH
SSLCertificateFile "/etc/ssl/certs/server.crt"
SSLCertificateKeyFile "/etc/ssl/private/server.key"
<Directory /srv/http/webmail>
Options FollowSymLinks
AllowOverRide Limit
Require all granted
</Directory>
</VirtualHost>

<VirtualHost *:80>
     ServerName webmail.example.com
     ErrorLog "/var/log/httpd/webmail.example.com_error_log"
     CustomLog "/var/log/httpd/webmail.example.com_access_log" common
  RewriteEngine  on
  RewriteCond    %{HTTPS} !=on
  RewriteRule (.*) https://%{HTTP_HOST}
</VirtualHost>

Thanks.
Dave.


On 2/18/14, Eric Covener <covener@gmail.com> wrote:
> On Tue, Feb 18, 2014 at 4:27 PM, David Mehler <dave.mehler@gmail.com>
> wrote:
>> <VirtualHost webmail.example.com:80>
>
> That hostname instead of * or an IP is almost always the source of these
> errors.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message