473,395 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Protect files (on web server) from web admin

Hi guys.

I’m still occupied with school, however, I can’t quite help thinking about a part of my project that I’m very curious about.

I want to protect files and folders on the web server, so that no one can access the files through the web server OS (using e.g. windows explorer to see, open and edit the html or php files).

I want to clarify: I do not want to “hide” the html source file, or any other file that otherwise is accessible through a web browser (e.g. javascript).

The main idea is to make sure that the only way you have access to the files would be through a web browser.
E.g. let’s say that the web site contains html and php files. The html files are accessible as usual (http://server/file.html) and the php code is run as usual (action=”form.php”), but only if you access them through the URI adress (i.e. through Apache).
In other words I want to restrict access (not privileges like create/delete etc.) to the files and folders on the server from the server holder (and basically myself).

There are three ways I can think of doing this:
1) Using password protected zip files (I know that PHP support this). This is the most favourable solution.

2) Encrypting the files (with PHP). This method would still leave the folders open (If not possible to encrypt the entire site directory structure to one big file?)

3) Using some form of folder lock program, making sure that privileges like create/delete are restricted for the server owner (although this is somewhat unrelated to PHP).


I need some expert opinions and suggestions.

Oh, this is my second post (... kind of), so play nice.

PS. I know that this is more of a general web site question (no forums that quite match up? ----- perhaps it should have been put in the Apache forum?), however I can currently only think about PHP solutions to this problem and for that reason posted in this forum.
Nov 7 '07 #1
3 4819
Atli
5,058 Expert 4TB
Hi.

There is no way to hide files and folders from the root user on a Linux machine (the favorite platform for Apache server) and I think the same applies to Windows and Mac. The root or Administrative user has access to all parts of the system without limitations.

It is however possible to encrypt the files using 3rd party tools so that the root user can't use the files. That is to say; root has full access to the files but is unable to use them. This of course does not protect the file from being deleted or altered in some way.
This could be accomplished by adding the files to a password protected ZIP file, like you mentioned.
Nov 7 '07 #2
Hi Atli, thanks for your reply!

It is however possible to encrypt the files using 3rd party tools so that the root user can't use the files. That is to say; root has full access to the files but is unable to use them. This of course does not protect the file from being deleted or altered in some way.
I suppose, in a nutshell, that this is what I'm trying to do.

I would guess that using ZIP to achieve whatever I am trying to achieve would perhaps be the best way to achieve it, no? Anyway, I will start with it. There are several question surrounding the use of ZIP to do this. I will however start a new thread for those questions (it would be more relevant to PHP and ZIP); Security questions regarding password protected ZIP files.

In the mean while: if anyone else have any different ideas, recommendations and suggestions, please, you’re welcome to share them.
Nov 8 '07 #3
i have same problem my php web site has folder that have some video files but that file can download in web browser i what to restrict that download and only login user can download video files how can i do this?
Jun 11 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: travelling_nerd | last post by:
Folks: I have some zip files I'd like to serve to authenticated users on my site, but would like to prevent unauthorized users from using an absolute path to get to these zip files. For example...
1
by: Tom I | last post by:
I am interested if anyone can point me to "best practices" regarding the level of administrative authority a SQL Server database administrator should have. Alternatively, I'd be interested hearing...
3
by: Parham | last post by:
Hello, How to protect structures(Tables,SP,Views and Functions) of a SQL Server Database?(Password protect a database file) I have a SQL database that will distribute with my application, I want...
4
by: Ray Stevens | last post by:
How do you protect files (such as .PDF) in a hosted (Interland) environment when you have no access to IIS?
2
by: Gary | last post by:
How do you administer ASP.NET on the IIS server. I'm using XP Pro. I need to update ASP.NET on the server from 1.0 to 1.1. Thanks, Gary
4
by: Siv Hansen | last post by:
I'm currently working with a server with error reporting level 0, which is good if this was purely a production server. It's not. I have fourty students trying to learn php programming on this...
1
JamieHowarth0
by: JamieHowarth0 | last post by:
Hi folks, As a mod in the ASP Forum I'm fairly proficient in server administration stuff. I've taken the initiative of getting a virtual dedicated server with GoDaddy (whom I believe are fairly...
0
by: peter | last post by:
Hi, Here is an urgent requirement with one of our direct customer for Sr.Windows Server Administrator.Client is an Financial Services company looking for Senior Consultants for this position....
9
luckysanj
by: luckysanj | last post by:
I am developing the free e-book sites.so i I want to know how to prevent the subfolders from websites. Means, when we open the home page like www.best4knowledge.com then it first open index page...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.