Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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'm creating a website where users can create their own space to publish content and a feature I'd like to implement is to allow these users point their own domain to its space inside my website. So if user "John" has created:

He could point its own domain:

To, BUT I need to keep the original (; no 301 redirect nor iframes.

I've been reading a lot and I think the way to go is reverse proxy using proxypass for apache, but I still need some advice to configure all this and a basic guidelines.


  1. Is proxypass the way to go? How do I implement it? (any basic tutorial to guide me? I tried official website but too many concepts I don't understand)
  2. I'm totally noob to DNS configuration, and I read that there are lots of different records (A, CNAME, MX)... If I implement all this I need to write a help document so users can point their domains to my website. What will need to do domain owners? Just point to my server IP? Touch any of these registers? Do I need to touch some DNS configuration on my side to allow new domains?

I forgot to mention I'm using Apache with PHP.

share|improve this question

Yes you could implement this via a proxy mechanism (you could use something like varnish or squid as well as proxypass) but do you expect the proxy to rewrite the HTML it is outputing too?

Unless you are a domain registrar, there's DNS involved in this - you just need to set up your webserver to accomodate requests for '' and route them accordingly.

You've not said how many users you have - one approach is to create a virtual host for every domain (send it a SIG_USR1 to handle the change). Another way would be to use a default/wildcard domain then mod_rewrite to copy the hostname into the URL path.

RewriteRule ^/(.*) /${HTTP_HOST}/$1

(may need some twiddling if you want to be able to access explicitly)

share|improve this answer
no, proxy will no need to rewrite any html. About user number, I expect a number of 200-300 using this feature, so I will need a way to automatize this to a certain level. – clinisbut Oct 24 '11 at 12:13
"Unless you are a domain registrar, there's DNS involved in this", maybe you meant "there's NO DNS involved in this"? Also I don't understand the SIG_USR1 thing. – clinisbut Oct 24 '11 at 12:15
SIG_USR1 means "You have to restart Apache after every httpd.conf changes" – Lazy Badger Oct 24 '11 at 17:47
Maybe mod_vhost_alias with ALIAS /john in main server will be more manageable and transparent (dual-address access, no mod_rewrite rules)? – Lazy Badger Oct 24 '11 at 17:51

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.