I know this has been asked numerous time, and I have read hours worth of post and guides with no success. I set up a new server running Apache 2.4.6 on CentOS 7.9 a while back with only one virtual host. The original vhost still works, but the second one ignores the host name.

I have two virtual host conf files in /etc/httpd/conf.d

example1.com.conf

<VirtualHost *:80>
  ServerName example1.com
  ServerAlias www.example1.com
  DocumentRoot /var/www/t/example1.com/public_html
  ServerAdmin webmas...@example.com
  CustomLog /var/www/t/example1.com/access_log combined
  ErrorLog /var/www/t/example1.com/error_log

  <Directory "/var/www/t/example1.com/public_html">
    Options -Indexes +FollowSymlinks
    AllowOverride All
    Require all granted
  </Directory>

</VirtualHost>


example2.com.conf

<VirtualHost *:80>
  ServerName example2.com
  ServerAlias www.example2.com
  DocumentRoot /var/www/t/example2.com/public_html
  ServerAdmin webmas...@example.com
  CustomLog /var/www/t/example2.com/access_log combined
  ErrorLog /var/www/t/example2.com/error_log

  <Directory "/var/www/t/example2.com/public_html">
    Options -Indexes +FollowSymlinks
    AllowOverride All
    Require all granted
  </Directory>

</VirtualHost>

I enabled ForensicLog and the log shows the correct Host: values, httpd -S shows all of the conf files and ServerNames, but regardless, all requests are being served from the /var/www/html default DocumentRoot.

Any help will be greatly appreciated.

Thanks,
--Richard

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

Reply via email to