Configuring redirects from http to https

classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

Configuring redirects from http to https

Jack M. Nilles
I have the following configuration file covering two virtual hosts:

# http redirect
<VirtualHost aaa.bbb.ccc.ddd:80>
 ServerName www.host1.com
 ServerAlias host1.com *.host1.com 
   Redirect "/" "https://www.host1.com"
</VirtualHost>

<Virtualhost *:80>
 ServerName www.host2.com
 ServerAlias host2.com *.host2.com
   Redirect / https://www.host2.com
</VirtualHost>

# https versions
<VirtualHost aaa.bbb.ccc.ddd:443>
  ServerAdmin . . .
  ServerName www.host1.com
  ServerAlias . . .
. . .

The https parts work well but if people try to get http://host1.com or http://host2.com they get connection (111) errors indicating that the redirects aren't working. I've tried different versions of the redirects -- with and without double quotes -- and it doesn't seem to make a difference.

How to I get the redirects to function?
Reply | Threaded
Open this post in threaded view
|

Re: Configuring redirects from http to https

Jonathon Koyle
Can you reproduce the issue and provide some logs, and maybe more information about the actual response?  the 1xx range isn't supposed to be an error code in HTTP.

On Thu, Nov 29, 2018 at 3:25 PM Jack M. Nilles <[hidden email]> wrote:
I have the following configuration file covering two virtual hosts:

# http redirect
<VirtualHost aaa.bbb.ccc.ddd:80>
 ServerName www.host1.com
 ServerAlias host1.com *.host1.com 
   Redirect "/" "https://www.host1.com"
</VirtualHost>

<Virtualhost *:80>
 ServerName www.host2.com
 ServerAlias host2.com *.host2.com
   Redirect / https://www.host2.com
</VirtualHost>

# https versions
<VirtualHost aaa.bbb.ccc.ddd:443>
  ServerAdmin . . .
  ServerName www.host1.com
  ServerAlias . . .
. . .

The https parts work well but if people try to get http://host1.com or http://host2.com they get connection (111) errors indicating that the redirects aren't working. I've tried different versions of the redirects -- with and without double quotes -- and it doesn't seem to make a difference.

How to I get the redirects to function?


--
Jonathon Koyle
Reply | Threaded
Open this post in threaded view
|

Re: Configuring redirects from http to https

Frank Gingras
The (111) is a networking issue because you're not matching the trailing slashes with your redirects.

On Thu, Nov 29, 2018 at 6:06 PM Jonathon Koyle <[hidden email]> wrote:
Can you reproduce the issue and provide some logs, and maybe more information about the actual response?  the 1xx range isn't supposed to be an error code in HTTP.

On Thu, Nov 29, 2018 at 3:25 PM Jack M. Nilles <[hidden email]> wrote:
I have the following configuration file covering two virtual hosts:

# http redirect
<VirtualHost aaa.bbb.ccc.ddd:80>
 ServerName www.host1.com
 ServerAlias host1.com *.host1.com 
   Redirect "/" "https://www.host1.com"
</VirtualHost>

<Virtualhost *:80>
 ServerName www.host2.com
 ServerAlias host2.com *.host2.com
   Redirect / https://www.host2.com
</VirtualHost>

# https versions
<VirtualHost aaa.bbb.ccc.ddd:443>
  ServerAdmin . . .
  ServerName www.host1.com
  ServerAlias . . .
. . .

The https parts work well but if people try to get http://host1.com or http://host2.com they get connection (111) errors indicating that the redirects aren't working. I've tried different versions of the redirects -- with and without double quotes -- and it doesn't seem to make a difference.

How to I get the redirects to function?


--
Jonathon Koyle
Reply | Threaded
Open this post in threaded view
|

Re: Configuring redirects from http to https

Jack M. Nilles
In reply to this post by Jonathon Koyle
The error I mentioned turns out to be a Squid error.

I'm beginning to think I'm getting a false alarm from the browser since, if I connect through a different network, I have no problem with the redirects. I'll have to test some more from different locations. So forget it for now, thanks.

> On 29 Nov 2018, at 15:06, Jonathon Koyle <[hidden email]> wrote:
>
> Can you reproduce the issue and provide some logs, and maybe more information about the actual response?  the 1xx range isn't supposed to be an error code in HTTP

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Configuring redirects from http to https

Jack M. Nilles
In reply to this post by Frank Gingras
I tried adding trailing slashes as follows, but the result was the same: a 111 error. Did I misinterpret your comment?

# http redirect
<VirtualHost aaa.bbb.ccc.ddd:80>
 ServerName www.host1.com
 ServerAlias host1.com *.host1.com 
   Redirect "/" "https://www.host1.com/" # Here
</VirtualHost>

<Virtualhost *:80>
 ServerName www.host2.com
 ServerAlias host2.com *.host2.com
   Redirect / https://www.host2.com/ # and here
</VirtualHost>

# https versions
<VirtualHost aaa.bbb.ccc.ddd:443>
  ServerAdmin . . .
  ServerName www.host1.com
  ServerAlias . . .
. . .

On 29 Nov 2018, at 15:12, Frank Gingras <[hidden email]> wrote:

The (111) is a networking issue because you're not matching the trailing slashes with your redirects.

On Thu, Nov 29, 2018 at 6:06 PM Jonathon Koyle <[hidden email]> wrote:
Can you reproduce the issue and provide some logs, and maybe more information about the actual response?  the 1xx range isn't supposed to be an error code in HTTP.

On Thu, Nov 29, 2018 at 3:25 PM Jack M. Nilles <[hidden email]> wrote:
I have the following configuration file covering two virtual hosts:

# http redirect
<VirtualHost aaa.bbb.ccc.ddd:80>
 ServerName www.host1.com
 ServerAlias host1.com *.host1.com 
   Redirect "/" "https://www.host1.com"
</VirtualHost>

<Virtualhost *:80>
 ServerName www.host2.com
 ServerAlias host2.com *.host2.com
   Redirect / https://www.host2.com
</VirtualHost>

# https versions
<VirtualHost aaa.bbb.ccc.ddd:443>
  ServerAdmin . . .
  ServerName www.host1.com
  ServerAlias . . .
. . .

The https parts work well but if people try to get http://host1.com or http://host2.com they get connection (111) errors indicating that the redirects aren't working. I've tried different versions of the redirects -- with and without double quotes -- and it doesn't seem to make a difference.

How to I get the redirects to function?


--
Jonathon Koyle

Reply | Threaded
Open this post in threaded view
|

Re: Configuring redirects from http to https

Jeff Cox
Try it like this.  This is mine except my server name and server alias are reversed.

<VirtualHost *:80>
    ServerName www.abc.com
    ServerAlias abc.com
    Redirect 301 / https://www.abc.com/
</VirtualHost>

--
Jeff Cox
[hidden email]



On Fri, Nov 30, 2018 at 1:40 PM Jack M. Nilles <[hidden email]> wrote:
I tried adding trailing slashes as follows, but the result was the same: a 111 error. Did I misinterpret your comment?

# http redirect
<VirtualHost aaa.bbb.ccc.ddd:80>
 ServerName www.host1.com
 ServerAlias host1.com *.host1.com 
   Redirect "/" "https://www.host1.com/" # Here
</VirtualHost>

<Virtualhost *:80>
 ServerName www.host2.com
 ServerAlias host2.com *.host2.com
   Redirect / https://www.host2.com/ # and here
</VirtualHost>

# https versions
<VirtualHost aaa.bbb.ccc.ddd:443>
  ServerAdmin . . .
  ServerName www.host1.com
  ServerAlias . . .
. . .

On 29 Nov 2018, at 15:12, Frank Gingras <[hidden email]> wrote:

The (111) is a networking issue because you're not matching the trailing slashes with your redirects.

On Thu, Nov 29, 2018 at 6:06 PM Jonathon Koyle <[hidden email]> wrote:
Can you reproduce the issue and provide some logs, and maybe more information about the actual response?  the 1xx range isn't supposed to be an error code in HTTP.

On Thu, Nov 29, 2018 at 3:25 PM Jack M. Nilles <[hidden email]> wrote:
I have the following configuration file covering two virtual hosts:

# http redirect
<VirtualHost aaa.bbb.ccc.ddd:80>
 ServerName www.host1.com
 ServerAlias host1.com *.host1.com 
   Redirect "/" "https://www.host1.com"
</VirtualHost>

<Virtualhost *:80>
 ServerName www.host2.com
 ServerAlias host2.com *.host2.com
   Redirect / https://www.host2.com
</VirtualHost>

# https versions
<VirtualHost aaa.bbb.ccc.ddd:443>
  ServerAdmin . . .
  ServerName www.host1.com
  ServerAlias . . .
. . .

The https parts work well but if people try to get http://host1.com or http://host2.com they get connection (111) errors indicating that the redirects aren't working. I've tried different versions of the redirects -- with and without double quotes -- and it doesn't seem to make a difference.

How to I get the redirects to function?


--
Jonathon Koyle

Reply | Threaded
Open this post in threaded view
|

Re: Configuring redirects from http to https

Jack M. Nilles
This doesn't work for me either with or without the trailing slash. I'll try it with the name and alias lines interchanged.

On 30 Nov 2018, at 12:27, Jeff Cox <[hidden email]> wrote:

Try it like this.  This is mine except my server name and server alias are reversed.

<VirtualHost *:80>
    ServerName www.abc.com
    ServerAlias abc.com
    Redirect 301 / https://www.abc.com/
</VirtualHost>

--
Jeff Cox
[hidden email]



On Fri, Nov 30, 2018 at 1:40 PM Jack M. Nilles <[hidden email]> wrote:
I tried adding trailing slashes as follows, but the result was the same: a 111 error. Did I misinterpret your comment?

# http redirect
<VirtualHost aaa.bbb.ccc.ddd:80>
 ServerName www.host1.com
 ServerAlias host1.com *.host1.com 
   Redirect "/" "https://www.host1.com/" # Here
</VirtualHost>

<Virtualhost *:80>
 ServerName www.host2.com
 ServerAlias host2.com *.host2.com
   Redirect / https://www.host2.com/ # and here
</VirtualHost>

# https versions
<VirtualHost aaa.bbb.ccc.ddd:443>
  ServerAdmin . . .
  ServerName www.host1.com
  ServerAlias . . .
. . .

On 29 Nov 2018, at 15:12, Frank Gingras <[hidden email]> wrote:

The (111) is a networking issue because you're not matching the trailing slashes with your redirects.

On Thu, Nov 29, 2018 at 6:06 PM Jonathon Koyle <[hidden email]> wrote:
Can you reproduce the issue and provide some logs, and maybe more information about the actual response?  the 1xx range isn't supposed to be an error code in HTTP.

On Thu, Nov 29, 2018 at 3:25 PM Jack M. Nilles <[hidden email]> wrote:
I have the following configuration file covering two virtual hosts:

# http redirect
<VirtualHost aaa.bbb.ccc.ddd:80>
 ServerName www.host1.com
 ServerAlias host1.com *.host1.com 
   Redirect "/" "https://www.host1.com"
</VirtualHost>

<Virtualhost *:80>
 ServerName www.host2.com
 ServerAlias host2.com *.host2.com
   Redirect / https://www.host2.com
</VirtualHost>

# https versions
<VirtualHost aaa.bbb.ccc.ddd:443>
  ServerAdmin . . .
  ServerName www.host1.com
  ServerAlias . . .
. . .

The https parts work well but if people try to get http://host1.com or http://host2.com they get connection (111) errors indicating that the redirects aren't working. I've tried different versions of the redirects -- with and without double quotes -- and it doesn't seem to make a difference.

How to I get the redirects to function?


--
Jonathon Koyle


Reply | Threaded
Open this post in threaded view
|

Re: Configuring redirects from http to https

Jack M. Nilles
The interchange also had no effect. Nor did changing the line to:
RedirectPermanent / https://www.host1.com


On 30 Nov 2018, at 13:52, Jack M. Nilles <[hidden email]> wrote:

This doesn't work for me either with or without the trailing slash. I'll try it with the name and alias lines interchanged.

On 30 Nov 2018, at 12:27, Jeff Cox <[hidden email]> wrote:

Try it like this.  This is mine except my server name and server alias are reversed.

<VirtualHost *:80>
    ServerName www.abc.com
    ServerAlias abc.com
    Redirect 301 / https://www.abc.com/
</VirtualHost>

--
Jeff Cox
[hidden email]



On Fri, Nov 30, 2018 at 1:40 PM Jack M. Nilles <[hidden email]> wrote:
I tried adding trailing slashes as follows, but the result was the same: a 111 error. Did I misinterpret your comment?

# http redirect
<VirtualHost aaa.bbb.ccc.ddd:80>
 ServerName www.host1.com
 ServerAlias host1.com *.host1.com 
   Redirect "/" "https://www.host1.com/" # Here
</VirtualHost>

<Virtualhost *:80>
 ServerName www.host2.com
 ServerAlias host2.com *.host2.com
   Redirect / https://www.host2.com/ # and here
</VirtualHost>

# https versions
<VirtualHost aaa.bbb.ccc.ddd:443>
  ServerAdmin . . .
  ServerName www.host1.com
  ServerAlias . . .
. . .

On 29 Nov 2018, at 15:12, Frank Gingras <[hidden email]> wrote:

The (111) is a networking issue because you're not matching the trailing slashes with your redirects.

On Thu, Nov 29, 2018 at 6:06 PM Jonathon Koyle <[hidden email]> wrote:
Can you reproduce the issue and provide some logs, and maybe more information about the actual response?  the 1xx range isn't supposed to be an error code in HTTP.

On Thu, Nov 29, 2018 at 3:25 PM Jack M. Nilles <[hidden email]> wrote:
I have the following configuration file covering two virtual hosts:

# http redirect
<VirtualHost aaa.bbb.ccc.ddd:80>
 ServerName www.host1.com
 ServerAlias host1.com *.host1.com 
   Redirect "/" "https://www.host1.com"
</VirtualHost>

<Virtualhost *:80>
 ServerName www.host2.com
 ServerAlias host2.com *.host2.com
   Redirect / https://www.host2.com
</VirtualHost>

# https versions
<VirtualHost aaa.bbb.ccc.ddd:443>
  ServerAdmin . . .
  ServerName www.host1.com
  ServerAlias . . .
. . .

The https parts work well but if people try to get http://host1.com or http://host2.com they get connection (111) errors indicating that the redirects aren't working. I've tried different versions of the redirects -- with and without double quotes -- and it doesn't seem to make a difference.

How to I get the redirects to function?


--
Jonathon Koyle



Reply | Threaded
Open this post in threaded view
|

Re: Configuring redirects from http to https

Filipe Cifali
Turn log level and attach log outputs in pastebin/gist or even here (just the text) of a full access, from begin to end of the request.

Also, use cURL locally at the httpd server to try to reproduce it 

On Fri, 30 Nov 2018 at 20:14 Jack M. Nilles <[hidden email]> wrote:
The interchange also had no effect. Nor did changing the line to:
RedirectPermanent / https://www.host1.com


On 30 Nov 2018, at 13:52, Jack M. Nilles <[hidden email]> wrote:

This doesn't work for me either with or without the trailing slash. I'll try it with the name and alias lines interchanged.

On 30 Nov 2018, at 12:27, Jeff Cox <[hidden email]> wrote:

Try it like this.  This is mine except my server name and server alias are reversed.

<VirtualHost *:80>
    ServerName www.abc.com
    ServerAlias abc.com
    Redirect 301 / https://www.abc.com/
</VirtualHost>

--
Jeff Cox
[hidden email]



On Fri, Nov 30, 2018 at 1:40 PM Jack M. Nilles <[hidden email]> wrote:
I tried adding trailing slashes as follows, but the result was the same: a 111 error. Did I misinterpret your comment?

# http redirect
<VirtualHost aaa.bbb.ccc.ddd:80>
 ServerName www.host1.com
 ServerAlias host1.com *.host1.com 
   Redirect "/" "https://www.host1.com/" # Here
</VirtualHost>

<Virtualhost *:80>
 ServerName www.host2.com
 ServerAlias host2.com *.host2.com
   Redirect / https://www.host2.com/ # and here
</VirtualHost>

# https versions
<VirtualHost aaa.bbb.ccc.ddd:443>
  ServerAdmin . . .
  ServerName www.host1.com
  ServerAlias . . .
. . .

On 29 Nov 2018, at 15:12, Frank Gingras <[hidden email]> wrote:

The (111) is a networking issue because you're not matching the trailing slashes with your redirects.

On Thu, Nov 29, 2018 at 6:06 PM Jonathon Koyle <[hidden email]> wrote:
Can you reproduce the issue and provide some logs, and maybe more information about the actual response?  the 1xx range isn't supposed to be an error code in HTTP.

On Thu, Nov 29, 2018 at 3:25 PM Jack M. Nilles <[hidden email]> wrote:
I have the following configuration file covering two virtual hosts:

# http redirect
<VirtualHost aaa.bbb.ccc.ddd:80>
 ServerName www.host1.com
 ServerAlias host1.com *.host1.com 
   Redirect "/" "https://www.host1.com"
</VirtualHost>

<Virtualhost *:80>
 ServerName www.host2.com
 ServerAlias host2.com *.host2.com
   Redirect / https://www.host2.com
</VirtualHost>

# https versions
<VirtualHost aaa.bbb.ccc.ddd:443>
  ServerAdmin . . .
  ServerName www.host1.com
  ServerAlias . . .
. . .

The https parts work well but if people try to get http://host1.com or http://host2.com they get connection (111) errors indicating that the redirects aren't working. I've tried different versions of the redirects -- with and without double quotes -- and it doesn't seem to make a difference.

How to I get the redirects to function?


--
Jonathon Koyle



--
[ ]'s

Filipe Cifali Stangler
Reply | Threaded
Open this post in threaded view
|

Re: Configuring redirects from http to https

Jack M. Nilles
I have an access log and an error log. The error log doesn't show much for today. The access log is full of entries from those who have used the https address. What should I be looking for to detect the http failures?



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Configuring redirects from http to https

Filipe Cifali
grep -i “mismatch” on it may provide something, your config seems correct, which is weird

On Fri, 30 Nov 2018 at 21:17 Jack M. Nilles <[hidden email]> wrote:
I have an access log and an error log. The error log doesn't show much for today. The access log is full of entries from those who have used the https address. What should I be looking for to detect the http failures?



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

--
[ ]'s

Filipe Cifali Stangler
Reply | Threaded
Open this post in threaded view
|

Re: Configuring redirects from http to https

Jack M. Nilles
I got nothing out of that filter. I note that response to my queries  produced: [30/Nov/2018:14:57:10 -0800] "-" 408 - "-" "-" on a few occasions.


On 30 Nov 2018, at 15:48, Filipe Cifali <[hidden email]> wrote:

grep -i “mismatch” on it may provide something, your config seems correct, which is weird

On Fri, 30 Nov 2018 at 21:17 Jack M. Nilles <[hidden email]> wrote:
I have an access log and an error log. The error log doesn't show much for today. The access log is full of entries from those who have used the https address. What should I be looking for to detect the http failures?



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

--
[ ]'s

Filipe Cifali Stangler

Reply | Threaded
Open this post in threaded view
|

Re: Configuring redirects from http to https

Richard
Do you have logging on the port 80 "redirect" virtualhost, and is
that what you are looking at? If you are seeing entries from use of
the https instance it sounds like you are reviewing the port 443
virtualhost logging, not the logs for port 80.


> Date: Friday, November 30, 2018 16:37:02 -0800
> From: "Jack M. Nilles" <[hidden email]>
>
> I got nothing out of that filter. I note that response to my
> queries  produced: [30/Nov/2018:14:57:10 -0800] "-" 408 - "-" "-"
> on a few occasions.
>
>
>> On 30 Nov 2018, at 15:48, Filipe Cifali <[hidden email]>
>> wrote:
>>
>> grep -i “mismatch” on it may provide something, your config
>> seems correct, which is weird
>>
>> On Fri, 30 Nov 2018 at 21:17 Jack M. Nilles <[hidden email]>
>> wrote: I have an access log and an error log. The error log
>> doesn't show much for today. The access log is full of
>> entries from those who have used the https address.
>> What should I be looking for to detect the http failures?
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Configuring redirects from http to https

Jack M. Nilles
Good point. I will add logging to port 80 and see what happens.




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Configuring redirects from http to https

Jack M. Nilles
I have checked the port 80 logs: they are empty. I concluded that the problem might lie not with Apache but with the server port configuration.

 So I checked the ports on the server (netstat -nat | grep LISTEN):  80 is not listed among the listening. I checked the firewall configuration on the server and port 80 should be open -- but clearly isn't. So I tried 'nc -l 80' to force the port open; it hung.

I have exhausted my linux expertise.

> On 1 Dec 2018, at 8:47, Jack M. Nilles <[hidden email]> wrote:
>
> Good point. I will add logging to port 80 and see what happens.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Configuring redirects from http to https

Jonathon Koyle
Is there a Listen 80 directive anywhere in your configuration files?

On Sat, Dec 1, 2018, 15:22 Jack M. Nilles <[hidden email] wrote:
I have checked the port 80 logs: they are empty. I concluded that the problem might lie not with Apache but with the server port configuration.

 So I checked the ports on the server (netstat -nat | grep LISTEN):  80 is not listed among the listening. I checked the firewall configuration on the server and port 80 should be open -- but clearly isn't. So I tried 'nc -l 80' to force the port open; it hung.

I have exhausted my linux expertise.

> On 1 Dec 2018, at 8:47, Jack M. Nilles <[hidden email]> wrote:
>
> Good point. I will add logging to port 80 and see what happens.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Configuring redirects from http to https

Jack M. Nilles
I just added a Listen 80 line at the top of my config file, changed both <VirtualHost lines to include the full IP address and voila! All seems to work well now.

Thanks all for your help and patience.

 [Internal reminder: when troubleshooting start with the fundamentals such as: are you connected?]

Jack



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Configuring redirects from http to https

William A Rowe Jr
In reply to this post by Jack M. Nilles
On Fri, Nov 30, 2018 at 1:40 PM Jack M. Nilles <[hidden email]> wrote:
# http redirect
<VirtualHost aaa.bbb.ccc.ddd:80>

<Virtualhost *:80>
Note you have an error there, the incoming request will be matched to
only one list of matching VirtualHosts, host1.com alone on the first, 
and host2 alone on the second list. You surely meant these to share
the same name-based virtual host lists?
Reply | Threaded
Open this post in threaded view
|

Re: Configuring redirects from http to https

Jack M. Nilles
I quickly discovered that when a test of host2 returned the host1 index page. So I changed the second VirtualHost address to be the same as host1 (aaa.bbb.ccc.ddd:80). That seems to have solved the problem. So now the actually working  *.conf is as follows (as a template?):

Listen 80
# Listen 443 not included since it was already listening

# http redirect
<VirtualHost aaa.bbb.ccc.ddd:80>
 ServerName www.host1.com
 ServerAlias host1.com *.host1.com
 Redirect / https://www.host1.com/
 ErrorLog /var/log/apache2/host1.com-error80_log
 CustomLog /var/log/apache2/hos1.com-access80_log combined
</VirtualHost>

<Virtualhost aaa.bbb.ccc.ddd:80>
 ServerName www.host2.com
 ServerAlias host2.com *.host2.com
 Redirect / https://www.host2.com/
 ErrorLog /var/log/apache2/host2.com-error80_log
 CustomLog /var/log/apache2/host2.com-access80_log combined
</VirtualHost>

# https version
<VirtualHost aaa.bbb.ccc.ddd:443>

 ServerAdmin [hidden email]
 ServerName www.host1.com
 ServerAlias host1.com *.host1.com
 DocumentRoot "/<wherever your root is>"
 SSLEngine on
 SSLProtocol all -SSLv2
 SSLCertificateFile /etc/apache2/ssl.crt/<certificate>.crt
 SSLCertificateKeyFile /etc/apache2/ssl.key/<key>.key
 SSLCertificateChainFile /etc/apache2/ssl.crt/<chain file>.txt
 RewriteEngine On
 RewriteOptions Inherit

et cetera



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Configuring redirects from http to https

@lbutlr
On Mon Dec 03 2018 12:17:01 Jack M. Nilles <[hidden email]> said:
>
> <VirtualHost aaa.bbb.ccc.ddd:80>
> <Virtualhost aaa.bbb.ccc.ddd:80>
> <VirtualHost aaa.bbb.ccc.ddd:443>

<VirtualHost *:80>
<Virtualhost *:80>
<VirtualHost *:443>

Should be just fine.


--
And I was grounded while you filled the skies I was dumbfounded by
truth; you cut through lies


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]