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

how can I config apache server for bulk parking domains. I mean allow users to set DNS of server for their domains and then it show content that I set for parked domains without need of additional config in my server (a parking feature just like sedo).

I also would like to control the content based on parked domain name at next level. but I guess that would be possible from php.

share|improve this question
up vote 0 down vote accepted

If you define multiple VirtualHosts, all requests for a server name that you haven't configured explicitly will be served by the first VirtualHost, as explained in the examples in the Apache documentation. So you have to put the content for parked domains in the first VirtualHost.

You are right in saying that, if you want to generate custom content dynamically based on the domain name, you have to use some kind of programming language (and PHP is one popular choice).

In a PHP script, you will see the correct host name, as specified by the browser that is visiting your parking page, as $_SERVER['SERVER_NAME'], as long as you do not turn on the UseCanonicalName directive in Apache (the default is off, and it should stay that way).

share|improve this answer
this not works. what i need is that everyone could be able to see my content just by setting DNS. i do not want to manually config every domain in my server and set every ServerName in VirtualHost. – m3hdi Nov 6 '12 at 14:07
You don't have to! Apache will automatically serve the content you have specified in the first VirtualHost. No need to manually configure each domain. – pino42 Nov 6 '12 at 14:08
so then I get same ServerName in php not? I should set ServerName in virtualhost config. – m3hdi Nov 6 '12 at 14:11
and also how about bind? how should I config it too? – m3hdi Nov 6 '12 at 14:13
As far as PHP is concerned, I edited my answer. You should not configure bind, or any other DNS server, at all; you mentioned that your users will configure their domains so the A records will point to your server's IP address, and that is all you need. You don't have to run a DNS responder on your server. – pino42 Nov 6 '12 at 17:27

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.