【发布时间】:2019-08-18 16:48:20
【问题描述】:
我正在构建一个网络应用程序(例如:www.mywebapp.example),它允许用户将他们的域 - www.xyz.example - 指向 www.mywebapp.example。当用户转到www.xyz.example 时,他们的内容将改为从www.mywebapp.example 提供。用户将被告知如何在其域提供商 DNS 设置中更新其@ 和www A records 以将www.xyz.example 连接到www.mywebapp.example。
我可以使用./certbot-auto -d <domain-name> 为每个域手动创建新的 SSL 证书。我还设置了一个 cron 作业来测试更新。
但是,每次用户将其域连接到www.mywebapp.example 时,我想通过运行由 JavaScript 函数触发的 PHP 脚本来自动执行此过程。我的问题是:
我应该使用
exec()/shell_exec()命令从PHP 执行./certbot-auto命令吗?我应该编写一个单独的 bash 脚本并运行 bash 脚本吗?我是否应该使用 LetsEncrypt 推荐的 ACME PHP 库 - https://letsencrypt.org/docs/client-options/
我为域
www.xyz2.example手动创建了一个新的SSL 证书,它成功地指向了www.mywebapp.example。但是,这破坏了对所有现有域的 SSL 支持 -*.mywebapp.example, mywebapp.example, www.xyz.example。我是否需要为每个指向www.mywebapp.example的域创建虚拟主机?- 我需要编辑
/etc/httpd/conf.d/ssl.conf来添加新的虚拟主机吗?多个域可以使用相同的DocumentRoot路径吗?
我已经阅读了以下所有链接,但仍然很困惑:
- https://httpd.apache.org/docs/2.4/vhosts/name-based.html
- https://serverfault.com/questions/7308/dynamic-virtual-hosts-in-apache
- https://serverfault.com/questions/126554/multiple-domains-with-ssl-on-same-ip
- certbot-auto / letsencrypt setting up one key for multiple domains pointing to the same server
非常感谢任何帮助。如果需要更多信息,请告诉我。
我的服务器设置是:
- 灯
- AWS EC2
【问题讨论】:
标签: php apache ssl lets-encrypt certbot