Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying that phpmyadmin is only enabled on the domain And not I am trying this with the following code:

<VirtualHost *:80>
DocumentRoot /var/www/404
<VirtualHost *:443>
        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
                        Require valid-user

        SSLEngine On
        SSLCertificateFile /var/www/certificates/server.pem

But this work not for me. I can reach phpmyadmin also on I only want that it is enabled for

How must i do this?


Edit: typo;)

share|improve this question

This can't be your entire config. Where do you define the virtual host for Since this snippet should only apply to I have to assume there is a problem somewhere else in your config that is allowing 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 is: <VirtualHost *:80> ServerName 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: – 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.


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


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.