如何获取默认的Apache getting-started.html?
我有一个简单的问题,但对我来说很难解决 我有标准的如何获取默认的Apache getting-started.html?,apache,centos,Apache,Centos,我有一个简单的问题,但对我来说很难解决 我有标准的/var/www/html目录,但我只是删除了它,创建了虚拟主机,但我没有考虑复制默认页面(即index.html),但我需要它。我可以在哪里找到它,或者如何向Apache发送“请求”以在/var/www/*的文件夹中生成它 我使用的是CentOS7。您使用的是CentOS,所以您大概是从httpd包运行Apache。/var/www/html中没有内容: [root@a02004d67c2b /]# cat /etc/centos-releas
/var/www/html
目录,但我只是删除了它,创建了虚拟主机,但我没有考虑复制默认页面(即index.html
),但我需要它。我可以在哪里找到它,或者如何向Apache发送“请求”以在/var/www/*
的文件夹中生成它
我使用的是CentOS7。您使用的是CentOS,所以您大概是从
httpd
包运行Apache。/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
选项-索引
错误文档403/.noindex.html
不允许超限
要求所有授权
别名/.noindex.html/usr/share/httpd/noindex/index.html
别名/noindex/css/bootstrap.min.css/usr/share/httpd/noindex/css/bootstrap.min.css
别名/noindex/css/open-sans.css/usr/share/httpd/noindex/css/open-sans.css
别名/images/apache_pb.gif/usr/share/httpd/noindex/images/apache_pb.gif
别名/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
的内容复制到您的虚拟主机DocumentRoot
看看Apache源代码,它可能就在那里。或者,如果这是一个dev服务器,您可以卸载Apache并重新安装,但请注意不要删除任何您自己的工作。