https

[root@server ssl]# yum install openssl mod_ssl [root@server ssl]# ls /etc/httpd/modules/mod_ssl.so /etc/httpd/modules/mod_ssl.so[root@server ssl]# vi /etc/pki/tls/openssl.cnf [root@server ssl]# cd /etc/pki/tls/misc/[root@server ssl]# ./CA -newca[root@server ssl]# ---->ls /etc/pki/CA/<>[root@server ssl]# mkdir /etc/httpd/ssl[root@server ssl]# cd /etc/httpd/ssl/[root@server ssl]# openssl genrsa -des3 -out server.key[root@server ssl]# openssl req -new -key server.key >server.csr[root@server ssl]# openssl x509 -req -days 3650 < server.csr -signkey server.key > server.crt[root@server ssl]# cp /etc/pki/CA/cacert.pem /etc/httpd/ssl/server.pem[root@server ssl]# vi /etc/httpd/conf.d/ssl.conf [root@server ssl]# grep SSLCertifi /etc/httpd/conf.d/ssl.conf # Point SSLCertificateFile at a PEM encoded certificate. IfSSLCertificateFile /etc/httpd/ssl/server.crt#SSLCertificateFile /etc/pki/tls/certs/localhost.crt#SSLCertificateKeyFile /etc/pki/tls/private/localhost.keySSLCertificateKeyFile /etc/httpd/ssl/server.key# Point SSLCertificateChainFile at a file containing the# the referenced file can be the same as SSLCertificateFile#SSLCertificateChainFile /etc/pki/tls/certs/server-chain.crt[root@server ssl]# grep SSLCACertifi /etc/httpd/conf.d/ssl.conf #SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crtSSLCACertificateFile /etc/httpd/ssl/server.pem[root@server ssl]# /etc/init.d/httpd restart Stopping httpd: [FAILED]Starting httpd: Apache/2.2.3 mod_ssl/2.2.3 (Pass Phrase Dialog)Some of your private key files are encrypted for security reasons.In order to read them you have to provide the pass phrases.Server server.uplooking.com:443 (RSA)Enter pass phrase:OK: Pass Phrase Dialog successful. [ OK ]輸入的密碼是生成server.key的密碼 。這個時候 netstat -an|grep :443可以工作了 firefix https://ip 可以使用https加密了。如果覺得啟動httpd不要密碼則如下處理:[root@server ssl]# openssl rsaserver.nokey

Enter pass phrase:

writing RSA key

[root@server ssl]# ll

total 40

-rw-r--r-- 1 root root? 749 Mar 11 15:16 server.crt

-rw-r--r-- 1 root root? 509 Mar 11 15:14 server.csr

-rw-r--r-- 1 root root? 573 Mar 11 15:12 server.key

-rw-r--r-- 1 root root? 497 Mar 11 15:28 server.nokey

-rw-r--r-- 1 root root 3168 Mar 11 15:21 server.pem

[root@server ssl]# vi /etc/httpd/conf.d/ssl.conf

[root@server ssl]# grep SSLCertifi /etc/httpd/conf.d/ssl.conf

# Point SSLCertificateFile at a PEM encoded certificate.? If

SSLCertificateFile /etc/httpd/ssl/server.crt

#SSLCertificateFile /etc/pki/tls/certs/localhost.crt

#SSLCertificateKeyFile /etc/pki/tls/private/localhost.key

SSLCertificateKeyFile /etc/httpd/ssl/server.nokey

#? Point SSLCertificateChainFile at a file containing the

[root@server ssl]# /etc/init.d/httpd restart

Stopping httpd:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [? OK? ]

Starting httpd:? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [? OK? ]

[root@server ssl]#

?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

友情鏈接更多精彩內容