[问题描述]: Anolis23 httpd服务不支持除UTF-8外的其他中文编码,如GB2312、GB18030。 [环境信息]: 机器类型:ECS 内核信息: [root@iZbp1gc4szu3xmuejrr3c6Z user]# uname -r 5.17.0-1.an23.x86_64 操作系统信息: [root@iZbp1gc4szu3xmuejrr3c6Z user]# cat /etc/os-release NAME="Anolis OS" VERSION="23" ID="anolis" VERSION_ID="23" PLATFORM_ID="platform:an23" PRETTY_NAME="Anolis OS 23" ANSI_COLOR="0;31" HOME_URL="https://openanolis.cn/" BUG_REPORT_URL="https://bugzilla.openanolis.cn/" [问题发生概率]:必现 [复现步骤]: 1、安装httpd服务 2、编辑httpd.conf配置文件,将AddDefaultCharset UTF-8改为AddDefaultCharset GB2312或者AddDefaultCharset GB18030 3、替换或在index.html主页中加入中文 4、重启服务,浏览器访问查看是否乱码
Anolis8 也发现相同问题 [内核信息]: [root@iZbp11lagjmwtlkrtvp6hgZ noindex]# uname -r 4.19.91-26.6.an8.x86_64 [操作系统信息]: [root@iZbp11lagjmwtlkrtvp6hgZ noindex]# cat /etc/os-release NAME="Anolis OS" VERSION="8.8" ID="anolis" ID_LIKE="rhel fedora centos" VERSION_ID="8.8" PLATFORM_ID="platform:an8" PRETTY_NAME="Anolis OS 8.8" ANSI_COLOR="0;31" HOME_URL="https://openanolis.cn/"
请返回 curl -vvv http://localhost/index.html 或类似URL的访问日志,以便确认是 HTTP服务器的问题还是浏览器的问题
Anolis 8与Anolis 23上此问题已解决。 an23: [root@iZbp1gc4szu3xmuejrr3c6Z /]# uname -r 5.10.134-13.2_alpha1.an23.x86_64 [root@iZbp1gc4szu3xmuejrr3c6Z /]# curl -vvv http://user1:12345@172.16.0.246/user/index.html * Trying 172.16.0.246:80... * Connected to 172.16.0.246 (172.16.0.246) port 80 (#0) * Server auth using Basic with user 'user1' > GET /user/index.html HTTP/1.1 > Host: 172.16.0.246 > Authorization: Basic dXNlcjE6MTIzNDU= > User-Agent: curl/8.0.1 > Accept: */* > < HTTP/1.1 200 OK < Date: Wed, 26 Apr 2023 09:42:35 GMT < Server: Apache/2.4.55 (Anolis OS) < Last-Modified: Wed, 26 Apr 2023 09:39:40 GMT < ETag: "18-5fa3a04e138ac" < Accept-Ranges: bytes < Content-Length: 24 < Content-Type: text/html; charset=GB2312 < user access Test 你好 * Connection #0 to host 172.16.0.246 left intact [root@iZbp1gc4szu3xmuejrr3c6Z /]# rpm -qi httpd Name : httpd Version : 2.4.55 Release : 1.an23 Architecture: x86_64 Install Date: Wed Apr 26 17:37:22 2023 Group : Unspecified Size : 61293 License : ASL 2.0 Signature : RSA/SHA256, Thu Jan 19 00:01:43 2023, Key ID 619140084873f7c5 Source RPM : httpd-2.4.55-1.an23.src.rpm Build Date : Wed Jan 18 12:33:31 2023 Build Host : anolis-build-01.openanolis.cn Packager : OpenAnolis Community Vendor : OpenAnolis Community URL : https://httpd.apache.org/ Summary : Apache HTTP Server Description : The Apache HTTP Server is a powerful, efficient, and extensible web server. an8: [root@iZbp11lagjmwtlkrtvp6hgZ anolis-pkg-tests]# uname -r 4.19.91-27.1.an8.x86_64 [root@iZbp11lagjmwtlkrtvp6hgZ httpd]# curl -vvv http://user1:12345@172.16.3.251/user/index.html * Trying 172.16.3.251... * TCP_NODELAY set * Connected to 172.16.3.251 (172.16.3.251) port 80 (#0) * Server auth using Basic with user 'user1' > GET /user/index.html HTTP/1.1 > Host: 172.16.3.251 > Authorization: Basic dXNlcjE6MTIzNDU= > User-Agent: curl/7.61.1 > Accept: */* > < HTTP/1.1 200 OK < Date: Wed, 26 Apr 2023 09:27:04 GMT < Server: Apache/2.4.37 (Anolis OS) mod_perl/2.0.12 Perl/v5.26.3 < Last-Modified: Wed, 26 Apr 2023 09:23:15 GMT < ETag: "18-5fa39ca292e6b" < Accept-Ranges: bytes < Content-Length: 24 < Content-Type: text/html; charset=GB18030 < user access Test 你好 * Connection #0 to host 172.16.3.251 left intact [root@iZbp11lagjmwtlkrtvp6hgZ anolis-pkg-tests]# rpm -qi httpd Name : httpd Version : 2.4.37 Release : 51.0.1.module+an8.7.0+11029+4cc6dd82.5 Architecture: x86_64 Install Date: Wed 26 Apr 2023 04:08:13 PM CST Group : System Environment/Daemons Size : 4500266 License : ASL 2.0 Signature : RSA/SHA256, Fri 07 Apr 2023 03:05:41 PM CST, Key ID 619140084873f7c5 Source RPM : httpd-2.4.37-51.0.1.module+an8.7.0+11029+4cc6dd82.5.src.rpm Build Date : Fri 07 Apr 2023 02:36:11 PM CST Build Host : iZ2ze8vdmdyl66lfybi1hzZ Relocations : (not relocatable) Packager : OpenAnolis Community Vendor : OpenAnolis Community URL : https://httpd.apache.org/ Summary : Apache HTTP Server Description : The Apache HTTP Server is a powerful, efficient, and extensible web server.