Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom URL/Domain (CNAME alias?)

I am creating an application in a LAMP stack and I want to provide the user with the ability to use their own domain instead of a subdomain of my site. eg.

Instead of: http://some_user.mysite.com

They will use: http://store.some_user.com/

I know there are a few companies that provide this using CNAME records. (http://help.bigcartel.com/articles/14-using-a-custom-domain) however I'm not sure how they achieve this end-to-end.

My questions are:

  1. What is this process called? (So I can research this further if need be)

  2. What do I need to do to provide this? ie. What do I need to do on the DNS, apache and php side to get this working?

Any advice, links or code snippets would be greatly appreciated.

Thanks


UPDATE

So far I have been able to set up the wildcard DNS entry however I'm still having problems with the CNAME record resolving to the other domain. eg.

http://store.weareunified.com/ -> http://weareunified.joshstuart.com.au/

weareunified.com (this is a test user host) DNS

weareunified.com. A 111.67.3.227
store CNAME weareunified.joshstuart.com.au.

joshstuart.com.au (This is the primary application host) DNS

joshstuart.com.au. A 111.67.3.227
* CNAME joshstuart.com.au.
like image 869
User123342234 Avatar asked Feb 15 '11 11:02

User123342234


1 Answers

I have this set up using LAMP and it works very well. Here's how I did it:

  1. The target server with my application on it is on a normal A record (sub)domain. So in your case I'm assuming you have the application running on joshstuart.com.au.
  2. The client needs to change their DNS entry for store.weareunified.com to CNAME to joshstuart.com.au.
  3. The Apache server has a virtualhost without a domain specification (in my case), simply a <VirtualHost *:80>

That's it. There are currently 70+ domains that CNAME to the main application domain, and they each serve their individual site as needed (without a redirect, etc).

like image 131
Berklee Avatar answered Sep 30 '22 13:09

Berklee