您使用的是centos,所以可能是从
httpd
包裹。中没有内容
/var/www/html
以下内容:
[root@a02004d67c2b /]# cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)
[root@a02004d67c2b /]# find /var/www/html/
/var/www/html/
默认欢迎页面由提供
/etc/httpd/conf.d/welcome.conf
,看起来像:
<LocationMatch "^/+$">
Options -Indexes
ErrorDocument 403 /.noindex.html
</LocationMatch>
<Directory /usr/share/httpd/noindex>
AllowOverride None
Require all granted
</Directory>
Alias /.noindex.html /usr/share/httpd/noindex/index.html
Alias /noindex/css/bootstrap.min.css /usr/share/httpd/noindex/css/bootstrap.min.css
Alias /noindex/css/open-sans.css /usr/share/httpd/noindex/css/open-sans.css
Alias /images/apache_pb.gif /usr/share/httpd/noindex/images/apache_pb.gif
Alias /images/poweredby.png /usr/share/httpd/noindex/images/poweredby.png
也就是说如果你没有
index.html
在你的
DocumentRoot
(即,
/var/www/html
,apache将返回一个状态
代码403和来自
/usr/share/httpd/noindex/index.html
是的。
您可以为虚拟主机重新生成相同的配置,也可以只复制
/usr/share/httpd/noindex
进入虚拟主机
网站根目录
是的。