11.28 限定某個目錄禁止解析php
11.29 限制user_agent
11.30/11.31 php相關配置php
11.2八、限定某個目錄禁止解析phphtml
#編輯配置文件,添加如下內容。linux
[root@zgxlinux-01 111.com]# /usr/local/apache2.4.37/bin/apachectl -t
Syntax OK
[root@zgxlinux-01 111.com]# /usr/local/apache2.4.37/bin/apachectl graceful
[root@zgxlinux-01 111.com]# mkdir upload
[root@zgxlinux-01 111.com]# cp 123.php upload/shell
[root@zgxlinux-01 111.com]# curl -x127.0.0.1:80 'http://111.com/upload/123.php' -I
HTTP/1.1 403 Forbidden
Date: Wed, 21 Nov 2018 05:01:46 GMT
Server: Apache/2.4.37 (Unix) PHP/5.6.32
Content-Type: text/html; charset=iso-8859-1apache
11.29 限制user_agentvim
#編輯配置文件,加入如下內容:瀏覽器
[root@zgxlinux-01 111.com]# vim /usr/local/apache2.4.37/conf/extra/httpd-vhosts.conf
[root@zgxlinux-01 111.com]# /usr/local/apache2.4.37/bin/apachectl -t
Syntax OK
[root@zgxlinux-01 111.com]# /usr/local/apache2.4.37/bin/apachectl graceful
[root@zgxlinux-01 111.com]# !curl
curl -x127.0.0.1:80 'http://111.com/upload/123.php' -I
HTTP/1.1 403 Forbidden
Date: Wed, 21 Nov 2018 09:22:43 GMT
Server: Apache/2.4.37 (Unix) PHP/5.6.32
Content-Type: text/html; charset=iso-8859-1curl
[root@zgxlinux-01 111.com]# curl -x127.0.0.1:80 'http://111.com/123.php' -I
HTTP/1.1 403 Forbidden
Date: Wed, 21 Nov 2018 09:23:26 GMT
Server: Apache/2.4.37 (Unix) PHP/5.6.32
Content-Type: text/html; charset=iso-8859-1socket
[root@zgxlinux-01 111.com]# curl -A zhangguoxiang -x127.0.0.1:80 'http://111.com/123.php' -I
HTTP/1.1 200 OK
Date: Wed, 21 Nov 2018 09:27:18 GMT
Server: Apache/2.4.37 (Unix) PHP/5.6.32
X-Powered-By: PHP/5.6.32
Content-Type: text/html; charset=UTF-8
測試
11.30/11.31 php相關配置