1. 程式人生 > >Apache中多個HTTPS虛擬主機的實現 (多個伺服器證書實現的基礎)

Apache中多個HTTPS虛擬主機的實現 (多個伺服器證書實現的基礎)

修改/etc/httpd/conf.d/ssl.conf

新增新的虛擬主機

<VirtualHost192.168.236.133:8080>

DocumentRoot"/var/www/html/cert"        #index.html所在目錄

ServerName www.aabc.com        #要訪問的網址

ErrorLoglogs/ssl_error_log

TransferLoglogs/ssl_access_log

SSLEngine on   #ssl協議可用

SSLProtocol all -SSLv2

SSLCipherSuiteALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW

SSLCertificateFile/etc/httpd/certs/client.crt    #伺服器證書

SSLCertificateKeyFile/etc/httpd/certs/client.key  #伺服器私鑰

SSLCertificateChainFile/etc/httpd/certs/cacert.pem  #多級證書的證書鏈

SSLCACertificateFile/etc/httpd/certs/cacert.pem  #多級證書的證書鏈

SSLCACertificatePath/etc/httpd/certs      #證書存放目錄

SSLCARevocationPath  /etc/httpd/certs/crl  #吊銷證書存放目錄

SSLCARevocationFile  /etc/httpd/certs/crl/revokefile.crl  #吊銷證書檔案

SSLVerifyClient require

SSLVerifyDepth  1

<Files ~"\.(cgi|shtml|phtml|php3?)$">

    SSLOptions +StdEnvVars

</Files>

<Directory"/var/www/cgi-bin">

    SSLOptions +StdEnvVars

</Directory>

SetEnvIf User-Agent".*MSIE.*" \

         nokeepalive ssl-unclean-shutdown \

         downgrade-1.0 force-response-1.0

CustomLoglogs/ssl_request_log \

          "%t %h %{SSL_PROTOCOL}x%{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>