bashdnf install httpd -y systemctl start httpd
bashsetenforce 0
firewall-cmd --add-service=http
#如果无法访问请打开80端口
firewall-cmd --add-port=80/tcp
bashsystemctl restart httpd

bashvim /etc/httpd/conf/httpd.conf
修改为以下内容
bash#目标目录:/home/www
DocumentRoot "/home/www" #122
#127:131
<Directory "/home/www"> #主要改为目标目录
AllowOverride None
# Allow open access:
Require all granted
</Directory>
#166:168
<IfModule dir_module>
DirectoryIndex index.html newind.html #添加新索引文件可自行选择
</IfModule>
添加任意内容至/home/www/newind.html
bashecho "here is new index.html,a new directory and a new page" > /home/www/newind.html
验证结果
bashcurl 127.0.0.1
#返回"here is new index.html,a new directory and a new page"则成功