Re: Redirecting virtual host to https in Apache 2.4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> wrote:
> On Tue, Feb 18, 2014 at 4:27 PM, David Mehler <dave.mehler@xxxxxxxxx>
> 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@xxxxxxxxxxxxxxxx
> For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx





[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux