1、在/usr/local/apache2/htdocs/目录下写一个.txt文件

[root@localhost htdocs]# echo "1212" >1.txt

2、改写配置文件

[root@localhost htdocs]# vim /usr/local/apache2/conf/httpd.conf
<Directory "/usr/local/apache2/htdocs">
   Options Indexes FollowSymLinks
   AllowOverride All
   Order allow,deny
   Deny from all
</Directory>

3、重启Apache



[root@localhost htdocs]# /usr/local/apache2/bin/apachectl restart
4、访问测试

[root@localhost ~]# curl 192.168.0.104/1.txt -I
curl: (7) couldn't connect to host