문제

Im making some sort of CMS with server side PHP,

1.How do i with PHPadd the user's domain to the NS records and direct it to they'r folder in the server?

2.what this operation is called? i been Googleing this for 2 days now with no success due to the high advertisement on "domains" keywords.

EDIT: from what i understand now i need to API interface with CPanel, so i got my starting point, does anyone have a simple example on how to add a domain successfully with cpanel, none of what i tried work and thats after reading in the documentation and trying theyr examples.

도움이 되었습니까?

해결책

It's pretty simple if you get away from the idea of "pointing to folders" or configuring Apache individually for each site. Just configure Apache to direct all requests to a specific application/PHP file/folder/whathaveyou. In that application, check the HTTP Host request header to get the requested domain. Then do anything with it you want. This can even be done using simple rewrite rules in Apache instead of some full-blown application, depends on your needs.

You'll just have to instruct your users to configure their DNS server for their domain to point to your IP address.

다른 팁

look into WHMCS - they have modules that interface with WHM/cPanel that would let your users select the options themselves potentially. Like a hosting company.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top