Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux技術

LAMP 環境下部署 SSL 的流程

測試環境若沒有購買憑證,可自行建立自簽憑證。

安裝 OpenSSL

yum install openssl

注意不要安裝 mod_ssl,以免影響既有 Apache 版本。

建立私鑰與 CSR

openssl genrsa -out server.key 1024
openssl req -new -key server.key -out server.csr
openssl x509 -days 365 -req -in server.csr -signkey server.key -out server.crt

設定 Apache

將 server.key 與 server.crt 放到 Apache conf 目錄,編輯 httpd.conf 啟用:

Include conf/extra/httpd-ssl.conf

在 httpd-ssl.conf 中設定 SSLCertificateKeyFile 與 SSLCertificateFile,並確認 Listen 443 與 DocumentRoot。

重啟 Apache 即可測試 HTTPS。

Copyright © Linux教程網 All Rights Reserved