我們正在運行一個PHP網站,它爲我們的客戶使用自定義子域名,所以我們在Apache(版本2.2.3)中實施了帶通配符VHost的通配符SSL證書。這些子域PHP Web應用程序還利用反向代理服務於Pyramid Web應用程序,這些應用程序位於我們的REST和RPC API的兩個URL前綴後面。針對通配符vhost和專門命名爲vhost的Apache通配符SSL證書
我們還有一個管理界面在金字塔上運行。我們通常會簡單地將代理服務器反向管理界面,但我似乎無法爲這兩個虛擬主機使用通配符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>
它不起作用?我從個人經驗中知道,當你使用通配符時,Apache對vhost定義的排序非常敏感。通配符通常應該在.conf加載層次結構中最後一個。 – 2012-04-10 18:50:07