apache https配置步驟

來源:互聯網
上載者:User

標籤:window   linux   有效期間   認證   

apache https配置步驟

1、  確認是否安裝ssl模組

是否有mod_ssl.so檔案

2、  產生認證和密鑰

linux下

步驟1:產生密鑰

命令:openssl genrsa 1024 > server.key

說明:這是用128位rsa演算法產生密鑰,得到server.key檔案

步驟2: 產生認證請求檔案

命令:openssl req -new -key server.key > server.csr

說明:這是用步驟1的密鑰產生認證請求檔案server.csr, 這一步提很多問題,一一輸入

步驟3: 產生認證

命令:openssl req -x509 -days 365 -key server.key -in server.csr > server.crt

說明:這是用步驟1,2的的密鑰和認證請求產生認證server.crt,-days參數指明認證有效期間,單位為天

window下

步驟1:產生密鑰
命令:openssl genrsa 1024 > server.key
說明:這是用128位rsa演算法產生密鑰,得到server.key檔案

步驟2: 產生認證請求檔案
命令:openssl req -config D:\work_soft\Apache2.2\conf\openssl.cnf -new -key server.key > server.csr
說明:這是用步驟1的密鑰產生認證請求檔案server.csr, 這一步提很多問題,一一輸入

步驟3: 產生認證
命令:openssl req -config D:\work_soft\Apache2.2\conf\openssl.cnf -x509 -days 365 -key server.key -in server.csr > server.crt
說明:這是用步驟1,2的的密鑰和認證請求產生認證server.crt,-days參數指明認證有效期間,單位為天

把得到的server.key和server.crt檔案拷貝到apache的對應目錄

3、  配置apache

l  修改httpd-ssl.conf檔案

注意在此檔案中配置認證和密鑰

SSLCertificateFile /apache/conf/server.crt

SSLCertificateKeyFile /apache/conf/server.key 

虛擬機器設定

NameVirtualHost *:443

<VirtualHost *:443>

…………

</VirtualHost>

l  修改httpd.conf檔案

步驟1:開啟ssl模組

LoadModule ssl_module /opt/taobao/install/httpd/modules/mod_ssl.so

步驟2:引入ssl設定檔

Include “/apache/conf/httpd-ssl.conf”

步驟3:如果你配置的虛擬機器,注意一下連接埠的訪問接受情況

NameVirtualHost *:80

<VirtualHost *:80>

…………

</VirtualHost>

4、  重新啟動apache

用https方式訪問,查看是否生效


本文出自 “ITunics” 部落格,請務必保留此出處http://unics.blog.51cto.com/11776952/1838429

apache https配置步驟

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.