由高人[google:debian apache2-ssl]指點,經過嘗試,於昨晚23:58完成,請指正。
debian 下的 apache2 + ssl 配置方法
由高人[google:debian apache2-ssl]指點,經過嘗試,於昨晚23:58完成,請指正。
Apach2 + ssl Step by Step
-------------------------------------------------
daizhong@gmail.com
20041114 23:35
------------------------------------------------
1 apt-get install apache2-mpm-worker
2 cd /etc/apache2/mods-enabled
ln -s /etc/apache2/mods-available/ssl.* .
3 cd /etc/apache2/sites-available
cp default ssl
cd /etc/apache2/sites-enabled
ln -s /etc/apache2/sites-available/ssl .
Then, modify ssl by the /usr/share/apache2/config/default-443,
paste the follow lines into /etc/apache2/sites-available/ssl:
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
#xxx.xxx.com-ssl.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.pem
#xxx.xxx.com-ssl.key
BrowserMatch "MSIE [1-4]" nokeepalive ssl-unclean-shutdown
downgrade-1.0 force-response-1.0
BrowserMatch "MSIE [5-9]" ssl-unclean-shutdown
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
-- If you have several VHOSTS, you can use seperate Sa file as
xxx.xxx.com-ssl.key, etc
4 modify the 2 files:
/etc/apache2/ports.conf -- append "Listen 443"
/etc/apache2/sites-enabled/ssl -- the top 2 lines change to:
NameVirtualHost *:443
<VirtualHost *:443>
5 run apache2-ssl-certification, create the Sa file:
/etc/apache2/ssl/apache.pem
6 /etc/init.d/apache2 restart
----------------------------------------------------------------------------------------------------------------以下是我配置SSL的簡單過程,一些理解可能有錯誤,如有知道的,請給小弟一個指正。
1.apt-get install apache2。
2.cd /etc/apache2/mods-enabled mods-enabled 已經被include進 apache2.conf,想要添加什麼模組,
只需要在mods-availablede/裡面的添加相應模組(*.load)和模組的簡單配置(*.conf)。
3.ln -s /etc/apache2/mods-available/ssl.* . 建立SSL的模組和簡單配置資訊。
4.在sites-available 建立https要訪問的資訊。為了方便建立我們可以cp default ssl.然後修改ssl,
首先要修改ssl的連接埠
NameVirtualHost *:443
<VirtualHost *:443>
然後添加SSL的認證資訊,這應該是最簡單的配置了,詳細的,我還沒有去仔細瞭解。
SSLCertificateFile /etc/apache2/ssl/apache.pem
#xxx.xxx.com-ssl.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.pem
#xxx.xxx.com-ssl.key
BrowserMatch "MSIE [1-4]" nokeepalive ssl-unclean-shutdown
#downgrade-1.0 force-response-1.0 //這些不能運行這些命令,所以,我登出了。
#BrowserMatch "MSIE [5-9]" ssl-unclean-shutdown
#SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
#-- If you have several VHOSTS, you can use seperate Sa file as
#xxx.xxx.com-ssl.key, etc
具體的配置情況可以參看/usr/share/apache2/config/default-443.可以根據其修改。裡面具體的參數資訊,我還沒有去瞭解。知道的兄弟也請告訴一聲
5。產生認證檔案,由於我們在上面的設定檔中,確定認證檔案在/etc/apache2/ssl/apache.pem,所以,我們去ssl下面運行apache2-ssl-
cdrtification.依據提示,產生認證檔案。
6. 開啟443連接埠 在port.conf裡添加 Listen 443
7.最後,重新啟動 apache2ctl restart