Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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;)

share|improve this question

2 Answers 2

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?

share|improve this answer
    
i don't think so. If i remove the virtualhost it is unreachable for everyone. I cleared phpmyadmin.conf in de conf.d dir. The virtualhost for test2.nl is: <VirtualHost *:80> ServerName test2.nl DocumentRoot /var/www </VirtualHost> –  Timo Feb 2 '10 at 17:42
    
Apologies of this is stating the obvious, but did you remember to reload or restart Apache after you deleted phpmyadmin.conf? –  Bart B Feb 2 '10 at 22:40
    
Apologies are not needed. It's my fault that i was unclear. I have restarted apache2 serveral times. All my virtualhosts are here: serverfault.pastebin.com/m644f639b –  Timo Feb 3 '10 at 14:50

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?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.