0

When I run httpd -S, it outputs the following:

VirtualHost configuration:
*:443                  is a NameVirtualHost
         default server www.example.com (/etc/httpd/conf.d/ssl.conf:57)
         port 443 namevhost localhost (/etc/httpd/conf.d/ssl.conf:57)
         port 443 namevhost www.example.com (/etc/httpd/conf.vh/example.conf:1)
                 alias example.com

Line 57 of /etc/httpd/conf.d/ssl.conf:

<VirtualHost _default_:443>

First lines of /etc/httpd/conf.vh/example.conf:

<VirtualHost *:443>

DocumentRoot "/var/www/www_example_com/"
ServerName www.example.com
ServerAlias example.com

However when I go to https://www.example.com it shows the /var/www/html content instead of /var/var/www_example_com

I resolve www.example.com from client side using /etc/hosts and also on server and not using DNS because is a development server.

If I add ServerName localhost in ssl.conf it serves files in var/var/www_example_com but I would want to avoid to do that workaround.

Any idea why does it not match as I expected?

3
  • What messages do you get when you restart apache?
    – Bert
    Apr 2, 2020 at 16:54
  • Did you run httpd -S before or after naming the <VirtualHost> in ssl.conf? It shows different names than in the published config: most notably the <VirtualHost> in example.com is called www.example.com.ar. Apr 2, 2020 at 17:04
  • It was a typo: is really www.example.com
    – sebelk
    Apr 2, 2020 at 20:27

0

You must log in to answer this question.

Browse other questions tagged .