[缺陷描述]: yum安装httpd后,/var/www/html下index.html界面缺失 查看默认路径: vim /etc/httpd/conf/httpd.conf # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot "/var/www/html" [重现概率]: 必现 [重现环境]: 类型:云上ECS 镜像: anolisos_7_9_arm64_20G_rhck_alibase_20211119.vhd anolisos_7_9_x64_20G_rhck_alibase_20211119.vhd anolisos_7_9_arm64_20G_anck_alibase_20211126.vhd anolisos_7_9_x64_20G_anck_alibase_20211126.vhd 重现步骤: yum install httpd cd /var/www/html/ ls [期望结果]: /var/www/html下有index.html [实际结果]: /var/www/html下index.html界面缺失
以前的httpd版本的默认首页在/var/www/html下,anolis7.9 系统上httpd版本的默认首页的路径是/usr/share/httpd/noindex/index.html 随着httpd版本的更新,默认首页的路径都有差异 httpd服务的配置文件不止/etc/httpd/conf/httpd.conf这一个,/etc/httpd/conf.d路径下的文件都会加入httpd配置
(In reply to qhw13324663979 from comment #1) > 以前的httpd版本的默认首页在/var/www/html下,anolis7.9 > 系统上httpd版本的默认首页的路径是/usr/share/httpd/noindex/index.html > 随着httpd版本的更新,默认首页的路径都有差异 > httpd服务的配置文件不止/etc/httpd/conf/httpd.conf这一个,/etc/httpd/conf. > d路径下的文件都会加入httpd配置 问题现象是执行curl -sIL -w '%http_code' localhost返回Forbidden,因为touch了/var/www/html/index.html文件后,执行curl -sIL -w '%http_code' localhost可以正常返回,所以单中的描述写为没有/var/www/html/index.html文件,请确认下原因。 # curl -sIL -w '%http_code' localhost HTTP/1.1 403 Forbidden Date: Tue, 25 Jan 2022 09:24:07 GMT Server: Apache/2.4.37 (Anolis OS) Content-Type: text/html; charset=iso-8859-1
httpd服务是正常的,没有/var/www/html/index.html文件,用curl返回的状态码是403