I am trying that phpmyadmin is only enabled on the domain test.test.nl. And not test2.nl. I am trying this with the following code:
<VirtualHost *:80>
DocumentRoot /var/www/404
</VirtualHost>
<VirtualHost *:443>
ServerName test.test.nl
DocumentRoot /var/www/404
Alias /phpmyadmin /usr/share/phpmyadmin
<Directory /usr/share/phpmyadmin>
Options Indexes FollowSymLinks
DirectoryIndex index.php
# Authorize for setup
<Files setup.php>
<IfModule mod_authn_file.c>
AuthType Basic
AuthName "phpMyAdmin Setup"
AuthUserFile /etc/phpmyadmin/htpasswd.setup
</IfModule>
Require valid-user
</Files>
</Directory>
SSLEngine On
SSLCertificateFile /var/www/certificates/server.pem
</VirtualHost>
But this work not for me. I can reach phpmyadmin also on https://test2.nl/phpmyadmin. I only want that it is enabled for https://test.test.nl
How must i do this?
Tom
Edit: typo;)
This can't be your entire config. Where do you define the virtual host for test2.nl? Since this snippet should only apply to test.test.nl I have to assume there is a problem somewhere else in your config that is allowing test2.nl to access /usr/share/phpmyadmin. Is it possible that when you installed phpMyAdmin that another config file was created in conf.d by the installer that adds phpmyadmin to all vhosts? Is there another Alias directive for phpmyadmin in httpd.conf? Or in some other config file?
The results of "apachectl -t -D DUMP_VHOSTS" are often helpful in troubleshooting this kind of virtualhost issue. That along with the apache virtual docs should help.
[http://httpd.apache.org/docs/2.2/vhosts/][1]
If you are still stuck after looking at that, can you add the output "of apachectl -t -D DUMP_VHOSTS" and "apachectl -v" w/ the ip address of the hosts? You can do a search and replace to obscure the actual IP addresses but make sure it's consistent.
Also, do you have NameVirtualHost anywhere in your main httpd.conf?