自动子域创建亚马逊ec2
我正在使用 amazon ec2 ....我想要一个在用户注册时创建子域的脚本,或者用户可以选择根据需要创建子域..?
任何人都可以为此建议一个脚本..最好是 php..
谢谢
I am using amazon ec2 .... I want a script which creates subdomain when an user registers or user has the option to create subdomin as needed..?
can anyone suggest a script for this.. preferably php..
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您使用 apache Web 服务器和 fedora linux,则必须执行以下操作
在您的 dns 中添加通配符条目。假设您的域名是 demo.com,dns 条目如
将 ip 替换为您的 ip。
然后,anything.demo.com 将到达您的服务器。
我们必须配置 apache 来处理子域。
对于每个子域我们要
下面的php符合上面的想法。
您必须以 root 用户身份运行此脚本。在虚拟主机配置文件中您可以添加更多选项。您还可以查看类似问题问题的答案。
希望有帮助。
If you are using apache web server and and a fedora linux, you have to do the following things
In your dns add a wild card entry. Suppose your domain name is demo.com the dns entry like
Replace the ip with your ip.
Then anything.demo.com will come to your server.
We have to configure apache to handle the subdomain.
For each subdomain we have to
The following php is in line with the above idea.
You have to run this script as root user. In the virtual host configuration file you can add more options. You can also check the answer to a similar question question.
Hope that helps.
您可以看看亚马逊AWS的新功能:
http://aws.amazon.com/route53/< /a>
http: //aws.typepad.com/aws/2010/12/amazon-route-53-the-aws-domain-name-service.html
You can take a look at the new feature of Amazon AWS:
http://aws.amazon.com/route53/
http://aws.typepad.com/aws/2010/12/amazon-route-53-the-aws-domain-name-service.html
您实际上可以利用 RewriteMap 来实现它。它还允许您映射域名(如果您也想扩展到该领域)。
像这样的东西应该可以工作 -
现在您可以使用 PHP 或任何东西来创建这个domain.map 文件,该文件将遵循格式 -
域/子域和服务器上的目标路径。
所以对于例如。
现在您只需将 example.com 指向您的服务器即可!
此方法允许您保持子域文件夹名称独立于子域的名称(完全取决于您的用例)。
You can actually utilize RewriteMap for it.. It would allow you to map domain names as well (in case you want to branch out to that as well).
Something like this should work -
Now you can use PHP or anything to create this domain.map file which would follow the format -
Domain/Subdomain and the targeted path on the server.
So for eg.
Now you just need to point example.com to your server!
This method allows you to keep the subdmain folder name independent of the name of the subdomain (depends totally on your use case).