| 5:42 am on Feb 2, 2009 (gmt 0)|
Come to think of it, I don't want to offer an open lumpsum "
http://MYDOMAIN.HISDOMAIN.COM/" type service because that would mean that anyone would just pass off my site as their own domain.
What I would like to do is that when that URL is typed, I check "HISDOMAIN.COM" in my DB and only allow functionality that is tied to MYUSER, otherwise show a polite error.
| 12:14 pm on Feb 23, 2009 (gmt 0)|
I haven't a clue what you're writing about:-(
| 1:40 am on Feb 26, 2009 (gmt 0)|
Read up about FeedBurner MyBrand. As an example:
My RSS feeds used to be:
But with the above service, I can have my feeds at:
Because FeedBurner allows me to point feeds.mysite.com as a CNAME to feedburner.com.
My question: how does the feedburner side make this happen? What does their Apache look for?
| 9:16 am on Feb 26, 2009 (gmt 0)|
When you move your MyBrand feeds over to your Google account you'll see that they now use a unique ID URL that you will point your CNAME to.
| 10:17 am on Feb 26, 2009 (gmt 0)|
Yes, and how does Google/Feedburner make that happen? When an end-user who owns the feed points a CNAME on his domain to Google/Feedburner, how does it work from the Google side?
I am Google in this example, not the feed owner. As my original question suggests, I want to offer this functionality to my end users.
My question is: how should I ask my end users to set up CNAME to point to my website. What does my Apache on my end need to recognize different CNAME entries?
Thanks. I hope I am clearer this time.
| 11:56 pm on Feb 26, 2009 (gmt 0)|
All you really need is an IP-based VirtualHost. Then the scripts which produce the pages for that VirtualHost would use the HTTP Host: header to determine which user's content to send.
| 2:25 am on Feb 27, 2009 (gmt 0)|
pinterface, thanks. I think I already know what you suggested as a general idea. It's the specifics that are frustrating. I already have my domains VirtualHost set up (that is how Apache serves up the website!).
Let me give an example, again:
My website is: TOPSERVICE.COM
My enduser's website is: USER.NET
I want TOPSERVICE.USER.NET to point to my server. So let's say that USER.NET on his domain has already set a CNAME to point to TOPSERVICE.COM.
So now in my Apache httpd.conf, what rules should I write? I doubt it will be ip-based. It has to be host name based. Right?
| 7:15 am on Feb 27, 2009 (gmt 0)|
Well, first, if you request your-service.customers.vanity.domain, does your webserver respond to it with anything at all? If not, and the CNAME is pointing to the right place, you'll need to make sure your apache is configured to respond to all requests on that IP, not just specific hostnames.
Once apache is responding, you're pretty much done with httpd.conf. Now you make your page-serving scripts (PHP, Perl, whatever) check the Host: header (probably by the HTTP_HOST request variable) and serve up content based on that. E.g., look up the domain in a database to see which user owns it, and then serve up a page for that user. If no user owns the domain, serve up an error page.
1. Strictly speaking you could use name-based virtual hosting:
ServerAlias example.customer-1.com example.customer-2.com ...
But then you would have to reboot apache every time a customer added or changed their vanity domain. Ew.
| 11:12 am on Feb 27, 2009 (gmt 0)|
The CNAME mapping does in fact point to something, but I am not sure what. Let me explain.
I have a dedicated hosting set up on server. Let's call it
dedicatedhosts.com. That's where the Apache is running. This is on IP 184.108.40.206 (masked here).
From this host server are running about twenty domains. Each of them has a
VirtualHost entry. The IP always remains the same for each of these domains: 220.127.116.11 (masked here, but you get the idea).
So each working website from my dedicated server looks like this in the httpd.conf file:
And so on.
Let's call the one I am interested in
mysite.com. This domain site is live and working. Since many years. With user IDs and all that.
Now I want to allow
mysite.userdomains.com as explained, where
userdomains.com is an end-user's website.
To test the CNAME functionality I took one of my own web domains, say,
myother.com as an example end-user's website and set a CNAME on it to point to
To my surprise, this "works": when I now try
mysite.myother.com it brings up a Cpanel default page. But this is not the index.php page on mysite.com or anything.
My question: where is this default Cpanel page coming from? How can I make the CNAME point to a particular page or program?
| 9:23 pm on Feb 27, 2009 (gmt 0)|
And your httpd.conf also has somewhere in it a
NameVirtualHost 18.104.22.168:80 or
You're getting the CPanel default page because that's the default page apache is set to serve when no corresponding VirtualHost is found. First, peruse Apache's documentation [httpd.apache.org], because CPanel is probably not going to help you (if my experience with cpanel is any indication, it'll actively work against you). Then you need to do one of two things:
- Change the default page apache serves from the cpanel one to the one intended to serve your vanity domain content
- Set up a second IP just for the vanity domains--and a corresponding DNS entry to which people can CNAME, something like userdomains.mysite.com--, and do IP-based VirtualHosting off of that.
|How can I make the CNAME point to a particular page or program? |
I think you might be confused about what, exactly, a CNAME does. A CNAME essentially says 'this domain has the same IP address as that other domain'. That's it.
| 1:42 am on Feb 28, 2009 (gmt 0)|
Pinterface, this is very useful. Thank you so much! I will try those things now and let you know.