CentOS 6ºÍCentOS 7ÉϴwebЧÀÍÆ÷µÄSSLÖ¤ÊéÉèÖÃ
centos 6ºÍcentos 7ÉϴwebЧÀÍÆ÷µÄsslÖ¤ÊéÉèÖÃ
ÔڴwebЧÀÍÆ÷ʱ£¬ÎªÁËÈ·±£Êý¾ÝµÄÇå¾²ÐÔ£¬ÎÒÃǾ³£»áʹÓÃSSLÖ¤ÊéÀ´¼ÓÃÜÍøÕ¾µÄ»á¼û¡£±¾ÎĽ«ÏÈÈÝÔÚCentOS 6ºÍCentOS 7ÉϴwebЧÀÍÆ÷ʱ£¬ÔõÑù¾ÙÐÐSSLÖ¤ÊéµÄÉèÖá£
ÔÚ×îÏÈ֮ǰ£¬ÎÒÃÇÐèҪ׼±¸ÒÔϼ¸¸öÎļþ£º
SSLÖ¤ÊéÎļþ (.crt)
˽ԿÎļþ (.key)
CAÖ¤ÊéÎļþ£¨¿ÉÑ¡£¬ÈôÊÇÄã´ÓCA»ú¹¹¹ºÖÃÁËÖ¤Ê飩
Ê×ÏÈ£¬ÎÒÃÇÐèҪȷ±£ÎÒÃǵIJÙ×÷ϵͳÒѾװÖÃÁËApacheЧÀÍÆ÷ÒÔ¼°Ïà¹ØµÄSSLÄ£¿é¡£ÔÚCentOS 6ÉÏ£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´×°ÖÃApache£º
sudo yum install httpd sudo yum install mod_ssl
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
ÔÚCentOS 7ÉÏ£¬ÔòÐèҪʹÓÃÒÔÏÂÏÂÁ
sudo yum install httpd sudo yum install mod_ssl
µÇ¼ºó¸´ÖÆ µÇ¼ºó¸´ÖÆ
×°ÖÃÍê³Éºó£¬ÎÒÃÇÐèÒªÔÚApacheµÄÉèÖÃÎļþÖоÙÐÐSSLÖ¤ÊéµÄÉèÖá£ÔÚCentOS 6ÉÏ£¬ÉèÖÃÎļþΪ/etc/httpd/conf.d/ssl.conf£¬ÔÚCentOS 7ÉÏÔòΪ/etc/httpd/conf.d/ssl.conf¡£·¿ª¸ÃÎļþ¾ÙÐб༡£
Ê×ÏÈ£¬ÎÒÃÇÐèÒªÕÒµ½ÒÔϼ¸ÐдúÂ룬×÷·Ï×¢ÊͲ¢Ð޸ijÉ×Ô¼ºµÄÖ¤ÊéÎļþ·¾¶£º
SSLCertificateFile /path/to/your/certificate.crt SSLCertificateKeyFile /path/to/your/privatekey.key
µÇ¼ºó¸´ÖÆ
ÈôÊÇÄ㹺ÖÃÁËCAÖ¤Ê飬»¹ÐèÒªÕÒµ½ÒÔÏÂÐдúÂë¾ÙÐÐÐ޸ģº
SSLCertificateChainFile /path/to/your/CA.crt
µÇ¼ºó¸´ÖÆ
ÉúÑIJ¢¹Ø±ÕÎļþºó£¬ÎÒÃÇÐèÒªÖØÆôApacheЧÀÍÆ÷ÒÔʹÉèÖÃÉúЧ¡£ÔÚCentOS 6ÉÏ£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
sudo service httpd restart
µÇ¼ºó¸´ÖÆ
ÔÚCentOS 7ÉÏ£¬ÔòʹÓÃÒÔÏÂÏÂÁ
sudo systemctl restart httpd
µÇ¼ºó¸´ÖÆ
ÖØÆôºó£¬ApacheЧÀÍÆ÷½«¼ÓÔØÉèÖÃÎļþÖÐÖ¸¶¨µÄSSLÖ¤Êé¡£
ΪÁ˲âÊÔÊÇ·ñÉèÖÃÀֳɣ¬ÎÒÃÇ¿ÉÒÔʹÓÃcurlÏÂÁîÀ´»á¼ûÍøÕ¾£¬²¢Éó²é·µ»ØЧ¹ûÖÐÊÇ·ñ°üÀ¨SSLÖ¤ÊéµÄÏà¹ØÐÅÏ¢¡£¿ÉÒÔʹÓÃÒÔÏÂÏÂÁ
curl -I https://yourwebsite.com
µÇ¼ºó¸´ÖÆ
ÆäÖÐyourwebsite.comÊÇÄãµÄÍøÕ¾ÓòÃû¡£
ÈôÊÇ·µ»ØЧ¹ûÖаüÀ¨ÀàËÆÒÔÏÂÐÅÏ¢£¬Ôò˵Ã÷SSLÖ¤ÊéÉèÖÃÀֳɣº
HTTP/2 200 ... Server: Apache ... SSL certificate verify ok.
µÇ¼ºó¸´ÖÆ
ÖÁ´Ë£¬ÎÒÃÇÒѾÀÖ³ÉÔÚCentOS 6ºÍCentOS 7ÉϴÁË´øÓÐSSLÖ¤ÊéµÄwebЧÀÍÆ÷¡£
×ܽ᣺
±¾ÎÄÏÈÈÝÁËÔÚCentOS 6ºÍCentOS 7ÉϴwebЧÀÍÆ÷ʱ£¬ÔõÑù¾ÙÐÐSSLÖ¤ÊéµÄÉèÖá£ÔڴwebЧÀÍÆ÷ʱ£¬Ê¹ÓÃSSLÖ¤Êé¿ÉÒÔÈ·±£Êý¾ÝµÄÇå¾²ÐÔ¡£Í¨¹ý¶ÔApacheЧÀÍÆ÷µÄÉèÖÃÎļþ¾ÙÐÐÐ޸ģ¬²¢ÖØÆôЧÀÍÆ÷£¬ÎÒÃÇ¿ÉÒÔÇáËɵØΪÍøÕ¾Ìí¼ÓSSLÖ¤Êé¡£
ÒÔÉϾÍÊÇCentOS 6ºÍCentOS 7ÉϴwebЧÀÍÆ÷µÄSSLÖ¤ÊéÉèÖõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡