Forum Moderators: phranque

Message Too Old, No Replies

wildcard DNS, dynamic subdomains and dynamic domains

subdomain domain virtual hosting

         

joeliu

8:27 pm on Jul 11, 2009 (gmt 0)

10+ Year Member



Hello, our web host in VDS. Its successful to put * in DNS file so that apache accept dynamic subdomains like, abc.mydomain.com and def.mydomain, whatever-i-like.mydomain.com. All subdomains is to one directory /home/user/ while we use mod_rewrite to have a SEO friendly url.

Now, we try to accept different domains from our clients(they configure their Nameservers to us). Is there any way to make all client domains, client-1.com, client-2.com, client-n.com to /home/user as well?

We search the solution for long time and do not have a conclusion. It seems it just make all domains and subdomains to /home/user/. However, it dosen't work by editing .htaccess mod_write....

Thanks in advance : )

fmchris

10:29 pm on Jul 11, 2009 (gmt 0)

10+ Year Member



Assuming you're already running a DNS server successfully, you need to edit your httpd.conf file and add Apache Virtual Hosts.

You can see the documentation here:

[httpd.apache.org...]

joeliu

7:33 am on Jul 12, 2009 (gmt 0)

10+ Year Member



Thanks for your reply. I added a wildcard * in A record so that it accept dynamic subdomain. Do we need to add something in DNS so that it accept "dynamic domains" that point to the same directory?

We visited the apache offical website which suggest "multiple aliases (CNAMES) point to this machine in DNS". What we think is clients type their domain names in browser and point to the same server name. So clients request the same content when visit different domain on the same server. Besides, different subdomains of different domains request the same content as well.

joeliu

9:26 am on Jul 12, 2009 (gmt 0)

10+ Year Member



Further information of our website.

We are building a PHP/MySQL website where visitors will be able to register and have a CP to build/manage their own subsite online and choose one subdomain on our the main domain (for example, mydomain.com, they have client-1.mydomain.com, client-N.mydomain.com...) by wildcard DNS. Every content is generated by /home/user/index.php.

Sometimes, visitors have their own domain name. They just simply change their nameservers to our : ns1.mydomain.com and ns2.mydomain.com. They will get content from /home/user/index.php as well, dynamic generated by the url.

How to edit DNS, httpd.conf or something related files in server?

jdMorgan

5:46 pm on Jul 12, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do you have a unique and non-shared IP address for this server? If not, then you will have to go to *your* control panel, and define all domains and subdomains that you want this server to handle. Things are much simpler on an IP-based server... You don't have to do anything but point the default server to your desired DocumentRoot.

Jim

joeliu

6:11 pm on Jul 12, 2009 (gmt 0)

10+ Year Member



We have a unique IP address for this server. How to "point the default server to your desired DocumentRoot"? You mean we just edit the httpd.conf?

Would you please show me an example? Thanks in advance!

jdMorgan

6:59 pm on Jul 12, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If *any* domain works, then this is already done.

Jim