Home >php教程 >php手册 >jsp与php混用的漏洞

jsp与php混用的漏洞

WBOY
WBOYOriginal
2016-06-06 19:47:481705browse

接手一个项目是jsp写的,用起来感觉开发是在太麻烦了。于是新功能就用php写的,jsp、php两者之间相互跳转, 突然一天发现在tomcat的web站下打开php竟然显示了php源码,在php站下看jsp也是显示的源码, 立即度娘解决问题 apache增加: FilesMatch \.(jsp|inc)

接手一个项目是jsp写的,用起来感觉开发是在太麻烦了。于是新功能就用php写的,jsp、php两者之间相互跳转,

突然一天发现在tomcat的web站下打开php竟然显示了php源码,在php站下看jsp也是显示的源码,

 

立即度娘解决问题

apache增加:

<filesmatch>
Order Deny,Allow
Deny from all
</filesmatch>


 

tomcat web.xml增加:

<security-constraint>
                 <web-resource-collection>
			<web-resource-name>Members Only</web-resource-name>
                        <url-pattern>*.php</url-pattern>
                 </web-resource-collection>
                 <auth-constraint></auth-constraint>
         </security-constraint>


 

重启,访问都回得到403错误
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn