apache tomcat|apache nginx设置目录无执行权限的方法

更新时间:2016-10-28    来源:apache    手机版     字体:

【www.bbyears.com--apache】

apache nginx设置目录无执行权限的方法web服务有iis,apache,nginx,使用操作系统无非是windows or *nux

 

 代码如下 location ~ ^/upload/.*.(php教程|php5)$
{
deny all;
}

来看俩段通常对上传目录设置无权限的列子,配置如下:

 代码如下



order allow,deny
deny from all


*nux就不同了,大家都是知道的*nux操作系统是区分大小写的

 代码如下
//?是尽可能多的匹配.php的字符串,i是不区分大小写,然后冒号后面跟上正则表达式
order allow,deny
deny from all


另外看一一nginx虚拟主机防webshell完美版

nginx.conf

 代码如下

server
{
listen 80;
server_name www.a.com;
index index.html index.htm index.php;
root /data/htdocs/www.a.com/;

#limit_conn crawler 20;

location ~ .*.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}

}

server
{
listen 80;
server_name www.b.com;
index index.html index.htm index.php;
root /data/htdocs/www.111cn.net/;

#limit_conn crawler 20;

location ~ .*.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
}

}

本文来源:http://www.bbyears.com/jiaocheng/27885.html

猜你感兴趣

热门标签

更多>>

本类排行