I have Apache2 with one VirtualHost configured as following:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName gitlab.mydomain.com
DocumentRoot /home/git/gitlab/public
ProxyPass / http://127.0.0.1:9292/
ProxyPassReverse / http://127.0.0.1:9292/
ErrorLog /var/log/apache2/gitlab/error.log
CustomLog /var/log/apache2/gitlab/access.log combined
</VirtualHost>
It works for http://gitlab.mydomain.com. BUT it also works for all *.mydomain.com redirecting to the above defined VirtualHost.
How can I disable all the hosts besides the gitlab.mydomain.com, so that abc.mydomain.com will response with http 404?
Update:
Is it possible to do the same thing with 443? I have already a bad_url:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /var/www/bad_url
ServerName *
</VirtualHost>
NameVirtualHost *:443
<VirtualHost *:443>
DocumentRoot /var/www/bad_url
ServerName *
</VirtualHost>
Now I get error on starting Apache:
Action 'start' failed.
The Apache error log may have more information.
failed!
cat /var/log/apache2/error.log
[Wed Jul 31 03:09:05 2013] [error] Server should be SSL-aware but has no certificate configured [Hint: SSLCertificateFile] ((null):0)
I see the Hint, but is it possible without adding the SSL certificate?
bad url
.