-4

I have an online service that provides a public profile for users. Users can sign up and view their profiles at www.example.com/users-name.

I want to provide a premium service where the user can access this profile via his or her own domain name (with the site itself still hosted by me). So, if they registered users-custom-domain.com, they could visit that site and they would see the same profile as above, plus some premium features

What kind of infrastructure needs to be in place to support this? Presumably the user would have to point his DNS over to my servers? If I am hosting my product on a cloud host like Heroku can this be achieved? Would each user using a custom domain be accessing a silo'd web application? E.g. if using a cloud infrastructure should each "instance" spin off a new application or can this somehow be shared?

I know there are many ways to achieve this, I'm just looking for ideas and best practices as I am not sure where to start (e.g. how about.me or tumblr achieve this).

womble
  • 96,255
  • 29
  • 175
  • 230
Joe
  • 1
  • 1
  • 2
    This question is being voted for closure because the author does not show a level of technical understanding or appropriate due diligence in researching the topic that the community judges as being a minimum barrier to participate. – Wesley Aug 21 '15 at 22:12
  • I appreciate your comment, but isn't that the point of this site? Additionally I did do some research here but since its a pretty specific question I didn't have any luck. – Joe Aug 21 '15 at 22:13

1 Answers1

0

You need:

  1. DNS to translate the user's domain name into a name or address you control. You can host that service and hard-code the necessary records, or the user can manage their own DNS and set the records themselves. I recommend you have a name on your domain that users CNAME their records to; as Github found when they had to renumber, if you let people hard-code IP addresses, things get messy.
  2. Your web service infrastructure needs to know to respond to requests for the user's domain, and which content to serve for it. Typically, this involves the user doing something in their profile to say, "I'll be pointing such-and-such domain to you" and then you have automated plumbing behind the scenes that configures the webserver tier to do the right thing.

Everything in your application can be shared; there's absolutely no reason to spin up a separate anything to service each user. Per-provider implementation is something you will need to figure out for yourself; there are too many possibilities and combinations to give you a comprehensive review.

womble
  • 96,255
  • 29
  • 175
  • 230
  • Thanks that helps. Step 2 suggests to me that using a PaaS like Heroku won't be an option for this due to the lack of ability to control the webserver (e.g. configure it to handle requests from arbitrary domains and to control what is then served). – Joe Aug 21 '15 at 22:36
  • Nevermind. In case it is useful to others - you can programmatically add domains to Heroku using their API. So after a user registers a new domain on your app you can programmatically add it to Heroku. Then your application can detect the source host and if it matches one of your registered custom domains it can serve the content accordingly. – Joe Aug 21 '15 at 22:54
  • Yes, a lot PaaS providers have an API. – womble Aug 22 '15 at 03:07