經(jīng)檢驗(yàn),是因?yàn)閏entos8系統(tǒng)自帶的openssl版本太高導(dǎo)致的。
centos7自帶的apache就沒問題,xp ie6和ie8可以正常訪問https。建議使用centos7系統(tǒng)。
如果系統(tǒng)沒法換,只能用centos8的話,那么可以參考下面的方法。
關(guān)于centos8自帶的apache2.4開啟https后,XP系統(tǒng)的IE8無法顯示網(wǎng)頁的問題_CentOS吧_Purasbarhttps://zh.purasbar.com/post.php?t=26190
【方法一】
在apache的配置文件/etc/httpd/conf.d/ssl.conf中啟用TLSv1.0。
啟用后IE8可以正常訪問https,但I(xiàn)E6默認(rèn)情況下沒法訪問。IE6默認(rèn)情況下只開啟了SSLv3,沒有開啟TLSv1.0,而CentOS8自帶的OpenSSL 1.1.1k不支持SSLv3(除非重新源碼編譯openssl1.1.1并指定enable-ssl3 enable-ssl3-method enable-weak-ssl-ciphers選項(xiàng))。IE6只有在Internet選項(xiàng)里面勾選了TLS1.0才能訪問https網(wǎng)站。
打開apache配置文件/etc/httpd/conf.d/ssl.conf,將下面兩行
SSLCipherSuite PROFILE=SYSTEM
SSLProxyCipherSuite PROFILE=SYSTEM
修改為
SSLCipherSuite HIGH:MEDIUM:!MD5:!RC4
SSLProxyCipherSuite HIGH:MEDIUM:!MD5:!RC4
保存文件,用sudo systemctl restart httpd命令重啟apache服務(wù)器,IE8就可以訪問https了。
提示:
(1)update-crypto-policies保持默認(rèn)的“DEFAULT”狀態(tài)即可,不需要修改。
$ sudo update-crypto-policies --show
DEFAULT
(2)ssl.conf里面下列兩行中的“-SSLv3”表示禁用SSLv3的意思。
SSLProtocol all -SSLv3
SSLProxyProtocol all -SSLv3
如果改成“+SSLv3”就表示啟用SSLv3,但是CentOS8自帶的OpenSSL 1.1.1k不支持SSLv3,修改后apache無法啟動(dòng)成功。
Apr 19 11:26:32 systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unit httpd.service has begun start-up
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit httpd.service has begun starting up.
Apr 19 11:26:32 httpd[366766]: AH00526: Syntax error on line 61 of /etc/httpd/conf.d/ssl.conf:
Apr 19 11:26:32 httpd[366766]: SSLv3 not supported by this version of OpenSSL
Apr 19 11:26:32 systemd[1]: httpd.service: Main process exited, code=exited, status=1/FAILURE
Apr 19 11:26:32 systemd[1]: httpd.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- The unit httpd.service has entered the 'failed' state with result 'exit-code'.
Apr 19 11:26:32 systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit httpd.service has failed.
--
-- The result is failed.
openssl命令的-ssl3選項(xiàng)也無法使用:
$ openssl s_client -connect localhost:443 -ssl3
s_client: Option unknown option -ssl3
s_client: Use -help for summary.
【方法二】
源碼編譯低版本的openssl。由于apache是動(dòng)態(tài)鏈接系統(tǒng)里面的openssl,所以apache也需要重新編譯。
禁用系統(tǒng)自帶的apache2.4,自己單獨(dú)編譯一套低版本的openssl、apache和php(如openssl-1.0.1f+apache2.2.23+php7.1.2)。不需要調(diào)整其他任何設(shè)置。
禁用系統(tǒng)自帶的apache2.4,并禁止開機(jī)自啟動(dòng):
sudo systemctl stop httpd
sudo systemctl disable httpd
update-crypto-policies不用動(dòng),可保持默認(rèn)的DEFAULT狀態(tài)。
安裝低版本openssl:
cd ~
mkdir temp
cd temp
wget https://www.openssl.org/source/old/1.0.1/openssl-1.0.1f.tar.gz
tar xf openssl-1.0.1f.tar.gz
cd openssl-1.0.1f/
./config --prefix=/opt/openssl-1.0.1f shared
make
sudo make install_sw
在/etc/ld.so.conf.d文件夾中新建一個(gè)mynewssl.conf文件,內(nèi)容為/opt/openssl-1.0.1f/lib。
然后執(zhí)行sudo ldconfig。
安裝低版本apache2.2:
wget https://archive.apache.org/dist/httpd/httpd-2.2.23.tar.gz
tar xf httpd-2.2.23.tar.gz
cd httpd-2.2.23
./configure --prefix=/opt/httpd-2.2.23 --enable-deflate --enable-expires --enable-heads --with-mpm-worker --enable-rewrite --enable-so --with-included-apr --enable-ssl --with-ssl=/opt/openssl-1.0.1f --enable-mods-shared=all
make
sudo make install
打開/opt/httpd-2.2.23/conf/httpd.conf,將
Include conf/extra/httpd-ssl.conf
取消注釋。
打開/opt/httpd-2.2.23/conf/extra/httpd-ssl.conf,正確配置證書文件路徑,如:
SSLCertificateFile??? /etc/pki/tls/certs/localhost.crt
SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
啟動(dòng)新安裝的apache2:
sudo /opt/httpd-2.2.23/bin/apachectl start
經(jīng)檢驗(yàn),XP系統(tǒng)下的IE6、IE8和win11下的edge、firefox均能正常訪問https。
新安裝一個(gè)php7:
(sudo yum install libxml2-devel libpng-devel)
wget https://www.php.net/distributions/php-7.1.2.tar.gz
tar xf php-7.1.2.tar.gz
cd php-7.1.2
./configure --prefix=/opt/php-7.1.2 --with-apxs2=/opt/httpd-2.2.23/bin/apxs --enable-mbstring --with-gd --with-mysqli --with-pdo-mysql --with-gettext --with-openssl=/opt/openssl-1.0.1f
make
sudo make install
在/opt/httpd-2.2.23/conf/httpd.conf末尾加入
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>
重啟新安裝的apache2:
sudo /opt/httpd-2.2.23/bin/apachectl restart
建立/opt/httpd-2.2.23/htdocs/info.php文件:
<?php
phpinfo();
[配置虛擬主機(jī):/home/xxx/xxx/config/xxx.conf]
NameVirtualHost *:80
NameVirtualHost *:443
<VirtualHost *:80>
? DocumentRoot "/opt/httpd-2.2.23/htdocs"
</VirtualHost>
<VirtualHost *:443>
? SSLEngine on
? SSLCertificateFile "/home/xxx/xxx/certificate/xxx.com.crt"
? SSLCertificateKeyFile "/home/xxx/xxx/certificate/xxx.com.key"
? SSLCertificateChainFile "/home/xxx/xxx/certificate/xxx.com.ca-bundle"
? DocumentRoot "/opt/httpd-2.2.23/htdocs"
</VirtualHost>
<VirtualHost *:80>
? DocumentRoot "/home/xxx/xxx"
? ServerName xxx.com
? Redirect 301 / https://xxx.com/
? <Directory "/home/xxx/xxx">
??? Options -Indexes FollowSymLinks
?AllowOverride All
??? Order allow,deny
?Allow from all
? </Directory>
</VirtualHost>
<VirtualHost *:443>
? SSLEngine on
? SSLCertificateFile "/home/xxx/xxx/certificate/xxx.com.crt"
? SSLCertificateKeyFile "/home/xxx/xxx/certificate/xxx.com.key"
? SSLCertificateChainFile "/home/xxx/xxx/certificate/xxx.com.ca-bundle"
? DocumentRoot "/home/xxx/xxx"
? ServerName xxx.com
? <Directory "/home/xxx/xxx">
??? Options -Indexes FollowSymLinks
?AllowOverride All
??? Order allow,deny
?Allow from all
? </Directory>
</VirtualHost>
寫好之后在/opt/httpd-2.2.23/conf/httpd.conf的最后一行包含一下:
Include /home/xxx/xxx/config/xxx.conf
請(qǐng)注意,Include的所有conf配置文件中,NameVirtualHost *:80和NameVirtualHost *:443只允許出現(xiàn)一次。最好是在第一個(gè)conf里面出現(xiàn)。
[測(cè)試]
訪問 http://服務(wù)器IP地址 或 https://服務(wù)器IP地址 ,出來的是It works!
訪問 http://xxx.com 自動(dòng)跳轉(zhuǎn)到 https://xxx.com ,出來的是/home/xxx/xxx下的網(wǎng)站。
[補(bǔ)充]
經(jīng)驗(yàn)證,安裝以下版本的服務(wù)器
httpd-2.4.17 (apr-1.5.2, apr-util-1.5.4)
openssl-1.0.2k
nghttp2-1.61.0
可以在保證IE6和IE8都能訪問https的情況下,成功啟用HTTP/2。
雖然XP系統(tǒng)下的IE瀏覽器不支持HTTP/2,但是firefox52.9esr是支持HTTP/2的。 ?
apache里面
SSLProtocol all -SSLv3
SSLProxyProtocol all -SSLv3
要改成
SSLProtocol all
SSLProxyProtocol all
才能使用IE6訪問https。
?
【方法三】
重新源碼編譯openssl1.1.1,編譯時(shí)指定enable-ssl3 enable-ssl3-method enable-weak-ssl-ciphers選項(xiàng)。apache、php也要重新編譯并綁定到這個(gè)openssl上。文章來源:http://www.zghlxwxcb.cn/news/detail-861656.html
Ubuntu14.04安裝2024年最新版apache-2.4.59+openssl-1.1.1w+php-8.3.6,并啟用https和HTTP2,且XP系統(tǒng)下的IE6和IE8能正常訪問https-CSDN博客文章瀏覽閱讀180次,點(diǎn)贊2次,收藏2次。事實(shí)證明,2024年最新版apache-2.4.59+openssl-1.1.1w+php-8.3.6是可以支持XP系統(tǒng)下的IE6和IE8瀏覽器正常訪問https的,請(qǐng)注意文章里面標(biāo)紅的重點(diǎn)部分。經(jīng)檢驗(yàn),XP系統(tǒng)下的firefox52.9esr可以正常通過HTTP/2訪問https,且不影響IE6-8的http/1.1訪問。建立新文件/etc/ld.so.conf.d/mynewssl.conf,內(nèi)容為/opt/openssl-1.1.1w/lib。https://blog.csdn.net/ZLK1214/article/details/138168428文章來源地址http://www.zghlxwxcb.cn/news/detail-861656.html
到了這里,關(guān)于關(guān)于centos8自帶的apache2.4開啟https后,XP系統(tǒng)的IE6和IE8無法顯示網(wǎng)頁的問題的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!