Today I was browsing ebay.com and I come to know that for every main category they created a sub domain, like there is a category watches and the URL for watches will be like watches.ebay.com etc.
Now I wanted to know what whey is to so that I can create a sub domain using PHP script.
creating subdomains
Moderator: General Moderators
using just PHP with apache you can't
You need root privileges on a server to create a subdomain.
So you can use some PHP-CGI script or Perl and call it with proper parameters from your web application
There are dozens of examples on the internet.
other option is to give permissions to "nobody" (apache user) to DNS config files but it is a very high security risk.
You need root privileges on a server to create a subdomain.
So you can use some PHP-CGI script or Perl and call it with proper parameters from your web application
There are dozens of examples on the internet.
other option is to give permissions to "nobody" (apache user) to DNS config files but it is a very high security risk.
if you have root permissions (from perl or php-cgi) you just edit a dns file:
look here for example (at the bottom)
so pretty much you just have to use fopen() fwrite() etc
after edit you have to restart dns server
look here for example (at the bottom)
so pretty much you just have to use fopen() fwrite() etc
after edit you have to restart dns server
- itsmani1
- Forum Regular
- Posts: 791
- Joined: Mon Sep 29, 2003 2:26 am
- Location: Islamabad Pakistan
- Contact:
thanks you what if have root permissions then?
basically the thing i want to copy ebay model and that's why i am looking for making these sub domains.
if any one has any good suggestion also suggest me on it and you know they [ebay] people has a huge database can mysql bear this thing or not?
thanks
basically the thing i want to copy ebay model and that's why i am looking for making these sub domains.
if any one has any good suggestion also suggest me on it and you know they [ebay] people has a huge database can mysql bear this thing or not?
thanks