Bug 235 - [Anolis OS 7.9][ecs][anck/rhck][x86/arm]yum安装httpd后,/var/www/html下index.html界面缺失
Summary: [Anolis OS 7.9][ecs][anck/rhck][x86/arm]yum安装httpd后,/var/www/html下index.html界面缺失
Status: NEW
Alias: None
Product: Anolis OS 7
Classification: Anolis OS
Component: Others (show other bugs) Others
Version: 7.9
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: yunqi-zwt
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-29 21:07 UTC by meil_wei
Modified: 2022-07-06 13:16 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description meil_wei alibaba_cloud_group 2021-12-29 21:07:04 UTC
[缺陷描述]:
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界面缺失
Comment 1 qhw13324663979 alibaba_cloud_group 2022-01-12 11:59:38 UTC
以前的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配置
Comment 2 meil_wei alibaba_cloud_group 2022-01-25 17:28:22 UTC
(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
Comment 3 qhw13324663979 alibaba_cloud_group 2022-02-07 15:48:37 UTC
httpd服务是正常的,没有/var/www/html/index.html文件,用curl返回的状态码是403