You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by me <in...@limohere.com> on 2019/08/07 23:23:35 UTC

[users@httpd] apache 2.4.29 ubuntu 18.04 VirtualHost ssl redirect not working?

target url: "http://www.cart.example.com/" works fine.
SSL target url: "https://www.cart.example.com/" redirect to /var/www/html

However, "/var/www/html" is not a DocumentRoot for any virtual hosts.
Output of "apachectl -S":
VirtualHost configuration:
*:443                  is a NameVirtualHost
          default server example2.com 
(/etc/apache2/sites-enabled/000-default.conf:55)
          port 443 namevhost example2.com 
(/etc/apache2/sites-enabled/000-default.conf:55)
                  alias www.example2.com
          port 443 namevhost ycart.com 
(/etc/apache2/sites-enabled/ycart.conf:55)
                  alias cart.example.com
                  alias www.cart.example.com
          port 443 namevhost yh.com (/etc/apache2/sites-enabled/yh.conf:57)
                  alias hice.example.com
                  alias www.hice.example.com
                  wild alias *.yh.com
*:80                   is a NameVirtualHost
...


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


Re: [users@httpd] apache 2.4.29 ubuntu 18.04 VirtualHost ssl redirect not working?

Posted by "@lbutlr" <kr...@kreme.com>.
On 13 Aug 19, at 10:48 , gene me <in...@limohere.com> wrote:
> Solution: My mistake was leaving "DocumentRoot" commented out. I thought the root specification in "80" section might suffice, but no. Once I fixed that - everything works. All correct pages are shown.
> 
> I think at least a warning from Apache should be visible for "apachectl -t" or "apachectl -S" options, but ...
> 

I think the DocumentRoot defaults to that specified for the primary domain (that is, in http.conf outside Andy VirtualHost) if otherwise unset, so there is no syntax error for Apache to detect.



-- 
if you ever get that chimp off your back, if you ever find the thing
you lack, ah but you know you're only having a laugh. Oh, oh here we
go again -- until the end.


Re: [users@httpd] apache 2.4.29 ubuntu 18.04 VirtualHost ssl redirect not working?

Posted by gene me <in...@limohere.com>.
No. Just 200

Solution: My mistake was leaving "DocumentRoot" commented out. I thought 
the root specification in "80" section might suffice, but no. Once I 
fixed that - everything works. All correct pages are shown.

I think at least a warning from Apache should be visible for "apachectl 
-t" or "apachectl -S" options, but ...

|| BTW, what is the right way of marking a question/thread solved?


On 8/13/19 8:52 AM, Frank wrote:
> Do you get a 302 or 301 with curl, since you mention a redirection?
>
> On 07/08/19 07:23 PM, me wrote:
>> target url: "http://www.cart.example.com/" works fine.
>> SSL target url: "https://www.cart.example.com/" redirect to /var/www/html
>>
>> However, "/var/www/html" is not a DocumentRoot for any virtual hosts.
>> Output of "apachectl -S":
>> VirtualHost configuration:
>> *:443                  is a NameVirtualHost
>>           default server example2.com
>> (/etc/apache2/sites-enabled/000-default.conf:55)
>>           port 443 namevhost example2.com
>> (/etc/apache2/sites-enabled/000-default.conf:55)
>>                   alias www.example2.com
>>           port 443 namevhost ycart.com
>> (/etc/apache2/sites-enabled/ycart.conf:55)
>>                   alias cart.example.com
>>                   alias www.cart.example.com
>>           port 443 namevhost yh.com (/etc/apache2/sites-enabled/yh.conf:57)
>>                   alias hice.example.com
>>                   alias www.hice.example.com
>>                   wild alias *.yh.com
>> *:80                   is a NameVirtualHost
>> ...
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>

Re: [users@httpd] apache 2.4.29 ubuntu 18.04 VirtualHost ssl redirect not working?

Posted by Frank <th...@apache.org>.
Do you get a 302 or 301 with curl, since you mention a redirection?

On 07/08/19 07:23 PM, me wrote:
> target url: "http://www.cart.example.com/" works fine.
> SSL target url: "https://www.cart.example.com/" redirect to /var/www/html
> 
> However, "/var/www/html" is not a DocumentRoot for any virtual hosts.
> Output of "apachectl -S":
> VirtualHost configuration:
> *:443                  is a NameVirtualHost
>          default server example2.com
> (/etc/apache2/sites-enabled/000-default.conf:55)
>          port 443 namevhost example2.com
> (/etc/apache2/sites-enabled/000-default.conf:55)
>                  alias www.example2.com
>          port 443 namevhost ycart.com
> (/etc/apache2/sites-enabled/ycart.conf:55)
>                  alias cart.example.com
>                  alias www.cart.example.com
>          port 443 namevhost yh.com (/etc/apache2/sites-enabled/yh.conf:57)
>                  alias hice.example.com
>                  alias www.hice.example.com
>                  wild alias *.yh.com
> *:80                   is a NameVirtualHost
> ...
> 
> 
> ---------------------------------------------------------------------
> 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