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

After years of using managed servers I'm finally getting my feet wet with setting up a webserver (using rackspace cloud). Here is how I have things setup:

Server A (hosted with, manages DNS for Server B (rackspace cloud server, I want to serve apps for from here)

I've added an A record on Server A for to point to Server B's ip address. This works great! Now I also have phpMyAdmin installed on Server B. If I go to Server B's phpmyadmin URL like "XX.XX.XX.XX/phpmyadmin", it loads just fine. What I would like to do is configure another A record on Server A like "" which will point to Server B. I have not yet set up a VirtualHost for that server name, so I get the default sites-enabled.

How do I tell apache that "" should load ""? A job for mod rewrite? Something in the default virtual host?

Any help is much appreciated!

share|improve this question
up vote 2 down vote accepted

Once you have setup the apache virtual server, just make the directory it forwards to the directory phpMyAdmin lives in.

General Apache Virtual Server Config:

DocumentRoot "/usr/share/phpmyadmin"
ServerName phpmyadmin.example.tld
<Directory "/usr/share/phpmyadmin">
allow from all
Options +Indexes

Hope this helps and DFTBA. :)

share|improve this answer
As a note, with this configuration, all you would need to do is visit phpmyadmin.example.tld and it would load phpmyadmin. You may want to configure htdigest authentication to give two layers of password checking. Or change the allow from all, to only allow ips you come from, and deny all others. – becomingwisest Jun 7 '12 at 18:00
Indeed; since phpMyAdmin allows access to well, databases; securing them is a must. As a side note; make sure to also remove MySQL access to the outside world if you only have the single server doing the tasks. This can be achieved w/ IPTables. – Jason S Jun 7 '12 at 18:04
Thanks for the input! I'm going to give this a shot when I get off work :) For some reason I didn't think I would need another virtual host, but now I don't know why I was thinking that. Maybe because it was 2 am... I did set up iptables in accordance with this video (, so I think I'm good there? (found out about UFW later on). Agree about the extra security, I'll enable that as well. On a side note, I actually had to look up DFTBA and can say, I NEVER DO. – Greg Jun 7 '12 at 20:50

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.