為了加強(qiáng)網(wǎng)站安全性,我們除了限制目錄權(quán)限外,還需要禁用某此目錄禁止執(zhí)行php。在IIS中可以直接將目錄的腳本執(zhí)行權(quán)限去掉,而針對(duì)非windows系統(tǒng)如何做呢?
<Directory /website/attachments>
php_flag engine off
</Directory>
location /upload/ {
location ~ .*.(php)?$
{
deny all;
}
}
location ~* ^/(upload|images)/.*.(php|php5)$
{
deny all;
}
$HTTP[
"url"] =~ “^
/(forumdata|templates|customavatars?)/” {
fastcgi.server = ()
}
Apache
<Location “/forumdata”>
php_admin_flag engine off
Options -ExecCGI
AddType text/plain .html .htm .shtml .php
</Location>