我们正在运行一个为我们的客户使用自定义子域的 PHP 站点,因此我们在 Apache(版本 2.2.3)中实现了一个带有通配符 VHost 的通配符 SSL 证书。这些子域 PHP Web 应用程序还利用我们的 REST 和 RPC API 的两个 URL 前缀后面的 Pyramid Web 应用程序的反向代理。
我们还有一个在 Pyramid 上运行的管理界面。我们通常会简单地将代理反向代理到管理界面,但我似乎无法为这两个虚拟主机使用通配符 SSL 证书。我究竟做错了什么?
这是我们的虚拟主机配置:
NameVirtualHost *:443
<VirtualHost *:443>
ServerName example.com
ServerAlias *.example.com
DocumentRoot /var/www/html/example/current/www
ErrorLog logs/wild-example.com-SSL-error_log
CustomLog logs/wild-example.com-SSL-access_log combined
SSLEngine On
SSLCertificateFile /etc/pki/tls/certs/star_example.com.2012.crt
SSLCertificateKeyFile /etc/pki/tls/private/star_example.com.key
SSLCACertificateFile /etc/pki/tls/certs/NetworkSolutions_CA.2012.crt
<Directory /var/www/html/example/current/www>
DirectoryIndex index.php
Options FollowSymLinks
AllowOverride All
</Directory>
ProxyRequests On
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /restapi/ http://127.0.0.1:6543/restapi/
ProxyPassReverse /restapi/ http://127.0.0.1:6543/restapi/
ProxyPass /rpcapi/ http://127.0.0.1:6543/rpcapi/
ProxyPassReverse /rpcapi/ http://127.0.0.1:6543/rpcapi/
</VirtualHost>
<VirtualHost *:443>
ServerName example.com
ServerAlias admin.example.com
DocumentRoot /var/www/html/example/current/www
ErrorLog logs/admin-example.com-SSL-error_log
CustomLog logs/admin-example.com-SSL-access_log combined
SSLEngine On
SSLCertificateFile /etc/pki/tls/certs/star_example.com.2012.crt
SSLCertificateKeyFile /etc/pki/tls/private/star_example.com.key
SSLCACertificateFile /etc/pki/tls/certs/NetworkSolutions_CA.2012.crt
<Directory /var/www/html/example/current/www>
DirectoryIndex index.php
Options FollowSymLinks
AllowOverride All
</Directory>
ProxyRequests On
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://127.0.0.1:6542/
ProxyPassReverse / http://127.0.0.1:6542/
</VirtualHost>