e23ewe 发表于 2014-4-19 20:20:13

apache设置禁止访问

1、在/usr/local/apache2/htdocs/目录下写一个.txt文件
# echo "1212" >1.txt
2、改写配置文件


# 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
# /usr/local/apache2/bin/apachectl restart
4、访问测试


# curl 192.168.0.104/1.txt -I
curl: (7) couldn't connect to host

页: [1]
查看完整版本: apache设置禁止访问