Problem with wildcard DNS and domain pointers

bauke

New member
Joined
Apr 30, 2010
Messages
2
Hi,

I've got the following problem:

I have a 'main' domain with it's own account, eg. maindomain.com.
I've set up wildcard DNS for this, and it works fine.
So http://bla.maindomain.com runs the script domains/maindomain.com/public_html/index.php

DNS: *.maindomain.com. A IP-address
Custom httpd.conf: ServerAlias *.|DOMAIN|


Now I also have clients that will be using the same script. I've added their domains (clientdomain.com) as a domain pointer (alias) in the account. If i enter http://clientdomain.com or http://www.clientdomain.com it runs the correct script in domains/maindomain.com/public_html/index.php.
Seems to be perfect, but when i try http://bla.clientdomain.com, I get the server message "Apache is functioning normally".

For the domain pointer I've also set up wildcard subdomains, just like the main domain:

DNS: *.clientdomain.com. A IP-address
Custom httpd.conf: ServerAlias *.|DOMAIN|

I've also tried to create a subdomain by adding
DNS: test.clientdomain.com. A IP-address
but that also gives me the "Apache is functioning normally" page.

Is it possible what I'm trying to achieve with the domain pointers? If not, what would be a better way to achieve this?

Thanks
 
Last edited:
Different approach, succes

After a lot of reading online, I guess it's just not supported.

I've now taken a different approach, with success.

Instead of using domainpointers to create an alias for the maindomain, I've now added the clientdomain as I would normally do via domain administration. And aftwerworths changed the clientdomain.com/public_html into a symlink pointing to the maindomain.com/public_html.

I can now fully configure the clients domain and still use one codebase.:)


Thanks anyway
 
you could add ServerAlias *.domain.com in the client's httpd.conf for each domain
for example when you add a domain as pointer you would have such as these lines in httpd.conf

ServerName www.domain.com
ServerAlias www.domain.com domain.com domain1.tk www.domain1.tk domain2.ir www.domain2.ir
DocumentRoot /home/domain/domains/domain.com/public_html
ScriptAlias /cgi-bin/ /home/domain/domains/domain.com/public_html/cgi-bin/

so you can add another ServerAlias as well as these
ServerAlias *.domain.com *.domain1.tk *.domain2.ir

it would be like this

ServerAlias *.domain.com www.domain.com domain.com *.domain1.tk domain1.tk www.domain1.tk *.domain2.ir domain2.ir www.domain2.ir

then save and reload httpd
service httpd reload
afterward you need enable wild card dns, create an Arecord in the each domain's dns zone , value has to be * and has server's IP.
 
Back
Top