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

If you have an Apache running at somewhere.net, and you have a number of virtual hosts as well (a.somewhere.net, b.somewhere.net), you can access directories on the main branch while you are on the virtual hosts.

For instance, let's say I install phpmyadmin. I can access it, after including the apache.conf file, by going to somewhere.net/phpmyadmin. However, I can also access it by going to a.somewhere.net/phpmyadmin or b.somewhere.net/phpmyadmin. I assume this has to do with the line Alias /phpmyadmin /usr/share/phpmyadmin (in phpmyadmin's apache.conf), and that it applies to all virtual hosts on Apache.

Is there a way to make it just apply to the default site, and none of the subdomains? Can I make it so a.something.net/phpmyadmin won't find phpmyadmin?

share|improve this question
    
Where did you configure that Alias line? –  Shane Madden Sep 20 '13 at 17:06
    
It is in the generated phpmyadmin apache.conf file (which is included in apache's apache2.conf). –  MirroredFate Sep 20 '13 at 17:10
add comment

2 Answers 2

up vote 2 down vote accepted

Move that Alias directive (and possibly other parts of the generated config?) or the Include that's bringing in the phpmyadmin config into the specific <VirtualHost> blocks that you want it to apply to - that will cause them to apply only to those specific virtual hosts instead of the entire server.

share|improve this answer
    
Should I just move the Include of the phpmyadmin apache.conf from apache's apache2.conf to the specific virtual host? –  MirroredFate Sep 20 '13 at 17:15
    
@MirroredFate Yup, that will work too! –  Shane Madden Sep 20 '13 at 17:15
    
Tried it, it didn't D: I tried moving the include directive to a couple different virtual host configuration files, but it is still available no matter which subdomain I use. Will keep looking for something out of place. –  MirroredFate Sep 20 '13 at 17:23
    
@MirroredFate That's.. strange. Does it go away if you turn off the Include in the one virtual host? –  Shane Madden Sep 20 '13 at 17:36
    
Yes, it goes away completely. It can no longer be found by Apache anywhere. –  MirroredFate Sep 20 '13 at 17:43
show 2 more comments

remove the alias from the conf.

ln -s /usr/share/phpmyadmin /$vHostDocRoot/phpmyadmin

that is the easiest way.... other wise you can try moving the Alias directive into the virtual host configuration.

share|improve this answer
add comment

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.