开发者

Safe & Secure Way to Add Domain to Server

开发者 https://www.devze.com 2023-04-01 22:16 出处:网络
I\'m trying to find the best way to connect a new domain to the server using PHP. I know it\'s possible because applications like bitly Pro allow users to connect their domain and bitly begins managin

I'm trying to find the best way to connect a new domain to the server using PHP. I know it's possible because applications like bitly Pro allow users to connect their domain and bitly begins managing the short domain for them (so they can redirect).

Here is how I imagine it would work, but I want to make sure this is secure, and also want to learn the most secure way to execute this process:

  1. User connects domain, domain is validated with regex
  2. User verifies domain is theirs (is this really necessary? they can only edit the domain's DNS if it's their domain)
  3. Server makes API call to DNS manager to add domain (I'm using Linode, so this is an API call, but would this be a master zone, slave zone?)
  4. Application writ开发者_StackOverflow中文版es new virtual host to httpd.conf
  5. App restarts apache

Again, this process could be completely off base, so please let me know what you think and how you would code it

Thanks a lot! :)


  1. and 5. is not neccesary. Just redirect all domains to a script (php/cgi/etc) which handles the domain and redirect.

  2. Yes it's not neccesary. But you can check if they already inserted your dns.

0

精彩评论

暂无评论...
验证码 换一张
取 消