[英]prevent php files from being downloaded in apache or Windows Server 2008
The question is must I configure the apache file in order to prevent listing of my php files and hence to prevent download of my php files ? 问题是我是否必须配置apache文件以防止列出我的php文件,从而防止下载我的php文件?
[Edited] I want the php file to be executed and produce desired web pages but the sourcecode files not to be downloaded by anyone. [编辑]我希望执行php文件并生成所需的网页,但是任何人都不要下载源代码文件。 My php files are placed under /var/www/html in a Ubuntu On AWS EC2. 我的php文件放在AWS EC2的Ubuntu的/ var / www / html下。 Then I try to do something like: type awsec2ip/mywebsiteRootDirectory/ , if there ain't an index.html, then the server lists my php files and allow me to right-click the php files and then download them. 然后,我尝试执行以下操作:键入awsec2ip / mywebsiteRootDirectory /,如果没有index.html,则服务器会列出我的php文件,并允许我右键单击php文件,然后下载它们。
[not so related to question 1]Also I want to ask if I only want my android application to run some php files for dealing with the database, where should I put the php files or how should I configure the apache? [与问题1无关]我也想问一下,我是否只想让我的android应用程序运行一些php文件来处理数据库,我应该将php文件放在哪里或应该如何配置apache?
Thanks for your help and sorry for my inexperience 多谢您的协助,也很抱歉
将其添加到您的Web根文件夹/var/www/html
.htaccess文件中:
Options -Indexes
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.