Apache conf VirtualHost ignored
I'm running apache on a CentOS 7. I have 2 config files in /etc/httpd/conf.d :
As they are similar, I show you only one of the files :
<VirtualHost *:443> ErrorLog "logs/my_site_test.log" SSLCertificateFile /etc/ssl/host/host.crt SSLCertificateKeyFile /etc/ssl/host/host.key Alias /my-site/test/static /var/www/my_site_test/static/ <Directory /var/www/my_site_test/static> Require all granted </Directory> WSGIScriptAlias /my-site/test /var/www/my_site_test/app/wsgi.py <Directory /var/www/my_site_test> Require all granted </Directory> </VirtualHost>
Currently, VirtualHost in A10-my_site_test.conf is ignored. If I go to https://my-server.com/my-site/test, I've got a 404, but https://my-server.com/my-site/dev is working fine. If I remove A10-my_site_dev.conf and restart apache, https://my-server.com/my-site/test works. I understood that it takes only the first VirtualHost apache finds.
I have the feeling that VirtualHost in my ssl.conf is ignored too cause, if I move SSLCertificateFile and SSLCertificateKeyFile to ssl.conf, I have the following error :
I tried not to use VirtualHost, and everything works fine in that case. I think all VirtualHost are ignored except the first.
I've got the same problem with other ports (like 80).
Another point : I read that I should have a ServerName. But I have the same ServerName for all my environments. I tried to put something random such as "my_site_test" as ServerName, but I've got a 404.
How could I configure apache to make my 2 files work ?