Safe & Secure Way to Add Domain to Server
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:
- User connects domain, domain is validated with regex
- User verifies domain is theirs (is this really necessary? they can only edit the domain's DNS if it's their domain)
- 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?)
- Application writ开发者_StackOverflow中文版es new virtual host to httpd.conf
- 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! :)
and 5. is not neccesary. Just redirect all domains to a script (php/cgi/etc) which handles the domain and redirect.
Yes it's not neccesary. But you can check if they already inserted your dns.
精彩评论