Portal Home > Knowledgebase > Articles Database > Catchall Subdomain, Large Scale remotely hosted forums
Catchall Subdomain, Large Scale remotely hosted forums
Posted by DediPath, 12-10-2007, 05:04 PM |
Ok I'm currently working on coding a remotely hosted php forum. To keep things simple I'll have 5-6 databases and when a user register it randomly assigns them a DB and it creates the tables, to keep things organized when a user registers they have a unique username which will be used for the following things.
USERNAME.board-leaders.com - there username will be there subdomain
USERNAME_TABLENAME - there username will be the prefix of the table
But for this to work I don't want to create each subdomain ( if it's possible) just use the username part of the subdomain as more of a variable to select the rights tables.What do I need to do to do this.
I've heard people talk of catch all subdomains. How do I set this up?
Should I use on DB or randomly place on 5-6 ?
Do you have any suggestions on my ideas?
|
Posted by Xeentech, 12-10-2007, 07:35 PM |
The easiest was would be to (assuming you use Apache?) setup a dedicated IP address for the site and any requests for this IP will be handle by a single VHost.
In CGI/PHP/Your language of choice you check the $ENV{'HTTP_HOST'} variable. It's value will be the sub domain + domain that the user entered to get to the site.
|
Posted by DediPath, 12-10-2007, 07:56 PM |
Well each subdomain is going to pull all the source files from one location so I can do server wide updates from one file. is there a way to make each subdomain that is valid pulls from a predefined source, and if the subdomain doesn't exists redirects to the homepage.
|
Posted by ServWise, 12-10-2007, 08:23 PM |
Absolutely, if you point the SLD (Second Level Domain) as a catchall DNS entry (more commonly called a Wild-card DNS entry) to the static IP of your website then use code in your website to read the host header information and decide where to pull data from, which DB etc, if the DB does not exist (or the accounts domain does not exist in a master table) then redirect to your default homepage or load a holding page etc.
I do exactly this with my WebClickGo system www.webclickgo.com, each user gets a sub-domain (In fact they can pick a sub-domain from a number of SLD or even use there own domain) and the website code determines which data to load and which templates to use etc.
|
Posted by DediPath, 12-10-2007, 09:37 PM |
What should I read up on for making a wild card.
|
Posted by ServWise, 12-11-2007, 03:48 AM |
Sorry but you are advertising yourself as an administrator of a hosting company and you don't know about wildcard DND records?????
You might try http://en.wikipedia.org/wiki/Wildcard_DNS_record
|
Posted by DediPath, 12-11-2007, 04:34 PM |
It's what I was told to put in my signature.
and thank you for the link.
|
Posted by ServWise, 12-11-2007, 04:40 PM |
Interesting, are you an employee of the company in your sig? Or just being paid to advertise someones hosting company.
|
Posted by Vinayak_Sharma, 12-11-2007, 04:53 PM |
You can get some idea from http://trac.mu.wordpress.org/browser/trunk/README.txt it is multiuser wordpress installation, done the way you want.
Sometime back I tested it on my cPanel server with shared IP and it worked fine.
|
Posted by DediPath, 12-11-2007, 05:27 PM |
Thanks everyone for the links
|
Posted by jstanden, 12-11-2007, 06:12 PM |
Technically, I'd lay that problem at the feet of automation (CPanel/Plesk/Win2003/etc). In many simple situations that works out just fine for plenty of small administrators.
People learn by asking questions, right? Cut the guy a break.
(and yes, in case you have some pent-up anger, I do everything by hand at the Debian console )
|
Add to Favourites Print this Article
Also Read
Email Hosting (Views: 781)