apache https配置詳細(xì)步驟講解
更新時(shí)間:2010年06月21日 14:36:14 作者:
主要講述在windows下apache配置SSL以實(shí)現(xiàn)http轉(zhuǎn)換為https
SSL: SSl是為Http傳輸提供安全的協(xié)議,通過證書認(rèn)證來確??蛻舳撕途W(wǎng)站服務(wù)器之間的數(shù)據(jù)是安全。也就是說在SSL下http傳輸是安全的,我們成為 https.
配置過程如下:
步驟一:安裝apache,使其支持SSL,并安裝php
1.安裝配有SSL模塊的apache,apache_2.2.8-win32-x86-openssl-0.9.8g
2.配置apache以支持SSL:打開apache的配置文件conf/httpd.conf
1)LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
去掉兩行前面的#
2)注意修改httpd-ssl.conf 文件里的兩個字段:
SSLCertificateFile "C:/Apache2.2/conf/server.crt"
SSLCertificateKeyFile "C:/Apache2.2/conf/server.key"
3.安裝php,整合apache和Php(略)
為下面你所生成的證書和密鑰地址。
步驟二:為網(wǎng)站服務(wù)器生成證書及私鑰文件
1. 生成服務(wù)器的私鑰
進(jìn)入命令行:
D:\local\apache2\bin\openssl genrsa -out server.key 1024
在當(dāng)前目錄下生成了一個server.key生成簽署申請
2. 生成簽署申請
D:\local\apache2\bin>openssl req -new –out server.csr -key server.key -config ..\conf\openssl.cnf
此時(shí)生成簽署文件server.csr.
步驟三:通過CA為網(wǎng)站服務(wù)器簽署證書
1.生成CA私鑰
D:\local\apache2\bin\openssl genrsa -out ca.key 1024
多出ca.key文件
2.利用CA的私鑰產(chǎn)生CA的自簽署證書
D:\local\apache2\bin\openssl req -new -x509 -days 365 -key ca.key -out ca.crt -config ..\conf\openssl.cnf
此時(shí)需要輸入一些信息,注意Common Name為服務(wù)器域名,如果在本機(jī),為本機(jī)IP。
3.CA為網(wǎng)站服務(wù)器簽署證書
D:\local\apache2\bin\openssl ca -in server.csr -out server.crt -cert ca.crt -keyfile ca.key -config ..\conf\openssl.cnf
但,此時(shí)會報(bào)錯:
于是在在當(dāng)前目錄創(chuàng)建demoCA,里面創(chuàng)建以下文件,index.txt,serial:serial內(nèi)容為01,其他為空,以及文件夾 newcert.再執(zhí)行一遍,即可生成server.crt文件
步驟四:然后將 server.crt,server.key復(fù)制到apache的conf文件夾下,重啟apache
步驟五:配置windows.
打開C:\WINDOWS\system32\drivers\etc下的etc文件:
修改為:
127.0.0.1 next0-testing.acgchina.8866.org
127.0.0.1 pp-testing.acgchina.8866.org
127.0.0.1 tlink-testing.acgchina.8866.org
步驟六:
在apache下寫入iframe網(wǎng)頁,并將testlink,projectpier也放入。
<iframe src="https://pp-testing.acgchina.8866.org/projectpier/index.php" width="300" height="300"></iframe>
<iframe src="https://tlink-testing.acgchina.8866.org/testlink/index.php" width="300" height="300"></iframe>
于是訪問https://next0-testing.acgchina.8866.org能看到正確的顯示。
配置過程如下:
步驟一:安裝apache,使其支持SSL,并安裝php
1.安裝配有SSL模塊的apache,apache_2.2.8-win32-x86-openssl-0.9.8g
2.配置apache以支持SSL:打開apache的配置文件conf/httpd.conf
1)LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
去掉兩行前面的#
2)注意修改httpd-ssl.conf 文件里的兩個字段:
SSLCertificateFile "C:/Apache2.2/conf/server.crt"
SSLCertificateKeyFile "C:/Apache2.2/conf/server.key"
3.安裝php,整合apache和Php(略)
為下面你所生成的證書和密鑰地址。
步驟二:為網(wǎng)站服務(wù)器生成證書及私鑰文件
1. 生成服務(wù)器的私鑰
進(jìn)入命令行:
D:\local\apache2\bin\openssl genrsa -out server.key 1024
在當(dāng)前目錄下生成了一個server.key生成簽署申請
2. 生成簽署申請
D:\local\apache2\bin>openssl req -new –out server.csr -key server.key -config ..\conf\openssl.cnf
此時(shí)生成簽署文件server.csr.
步驟三:通過CA為網(wǎng)站服務(wù)器簽署證書
1.生成CA私鑰
D:\local\apache2\bin\openssl genrsa -out ca.key 1024
多出ca.key文件
2.利用CA的私鑰產(chǎn)生CA的自簽署證書
D:\local\apache2\bin\openssl req -new -x509 -days 365 -key ca.key -out ca.crt -config ..\conf\openssl.cnf
此時(shí)需要輸入一些信息,注意Common Name為服務(wù)器域名,如果在本機(jī),為本機(jī)IP。
3.CA為網(wǎng)站服務(wù)器簽署證書
D:\local\apache2\bin\openssl ca -in server.csr -out server.crt -cert ca.crt -keyfile ca.key -config ..\conf\openssl.cnf
但,此時(shí)會報(bào)錯:
于是在在當(dāng)前目錄創(chuàng)建demoCA,里面創(chuàng)建以下文件,index.txt,serial:serial內(nèi)容為01,其他為空,以及文件夾 newcert.再執(zhí)行一遍,即可生成server.crt文件
步驟四:然后將 server.crt,server.key復(fù)制到apache的conf文件夾下,重啟apache
步驟五:配置windows.
打開C:\WINDOWS\system32\drivers\etc下的etc文件:
修改為:
127.0.0.1 next0-testing.acgchina.8866.org
127.0.0.1 pp-testing.acgchina.8866.org
127.0.0.1 tlink-testing.acgchina.8866.org
步驟六:
在apache下寫入iframe網(wǎng)頁,并將testlink,projectpier也放入。
<iframe src="https://pp-testing.acgchina.8866.org/projectpier/index.php" width="300" height="300"></iframe>
<iframe src="https://tlink-testing.acgchina.8866.org/testlink/index.php" width="300" height="300"></iframe>
于是訪問https://next0-testing.acgchina.8866.org能看到正確的顯示。
相關(guān)文章
Linux使用dd命令來復(fù)制和轉(zhuǎn)換數(shù)據(jù)的操作方法
Linux 中的 dd 命令是一個功能強(qiáng)大的數(shù)據(jù)復(fù)制和轉(zhuǎn)換實(shí)用程序,它以較低級別運(yùn)行,通常用于創(chuàng)建可啟動的 USB 驅(qū)動器、克隆磁盤和生成隨機(jī)數(shù)據(jù)等任務(wù),本文給大家介紹了Linux 如何使用dd命令來復(fù)制和轉(zhuǎn)換數(shù)據(jù),需要的朋友可以參考下2025-01-01
linux服務(wù)器用centos還是ubuntu系統(tǒng)
兩者同為目前版本中個人和小團(tuán)隊(duì)常用的服務(wù)級操作系統(tǒng),在線提供的軟件庫中可以很方便的安裝到很多開源的軟件及庫,不過問了多年維護(hù)服務(wù)器的朋友多用centos系統(tǒng)2012-12-12
CentOS7 安裝 zabbix 4.0 教程(圖文詳解)
這篇文章主要介紹了CentOS7 安裝 zabbix 4.0 教程,本文圖文并茂給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-10-10
CentOS7中MariaDB修改datadir后無法啟動的解決方法
這篇文章主要給大家介紹的是在CentOS 7系統(tǒng)中,MariaDB修改datadir后無法啟動的解決方法,文中給出了詳細(xì)解決方法,相信會對大家的理解很有幫助,有需要的朋友們下面來一起看看吧。2016-10-10
linux添加自定義service服務(wù),開機(jī)自啟動方式
這篇文章主要介紹了linux添加自定義service服務(wù),開機(jī)自啟動方式,具有很好的參考價(jià)值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-08-08

