Home > php教程 > php手册 > body text

jsp与php混用的漏洞

WBOY
Release: 2016-06-06 19:47:48
Original
1660 people have browsed it

接手一个项目是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>
Copy after login


 

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>
Copy after login


 

重启,访问都回得到403错误
Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!