Solved

php log file access

Posted on 2004-08-23
7
205 Views
Last Modified: 2008-03-06
Hello,
I would like to have a log file directory that I can read and write to, but I don't want people to be able to see the files from the web.  What do I have to do?
0
Comment
Question by:jackjohnson44
7 Comments
 
LVL 8

Expert Comment

by:inq123
ID: 11874279
Hi jackjohnson44,

I would just use a directory that is unmapped on web server as log file directory.  Alternatively, you could always use .htaccess to control access or set passwords on directories to protect mapped directories.

Cheers!
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11874286
Just use any directory of your server.
Your Web configuration can avoid any visitor to access your specific directory though a browser or ftp.
0
 

Author Comment

by:jackjohnson44
ID: 11882419
how do I configure this?

Is there something to do with the permissions?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 50 total points
ID: 11882505
Yes, almost any Web server has a "control panel" where you can configure some directories (or better all) to be read directly like Windows Explorer, then you can just access it though contained Web pages.
0
 
LVL 8

Expert Comment

by:inq123
ID: 11882541
let's say your personal web root is at /home/myname/public_html, then all you need to do is mkdir /home/log and have your php script read and write to files in that directory.  That newly created log directory is not even mapped on your web server and not under your web root, so no www user can view anything in it.
0
 
LVL 8

Expert Comment

by:inq123
ID: 11882564
sorry, I meant you can mkdir /home/myname/log, which is the directory that you'd have file system permission to create.

If you're on Windows machine, same thing.  Just create a new directory that is not under your web server root directory, and let php read and write to it.
0
 
LVL 3

Expert Comment

by:gnudiff
ID: 11892110
Note also that PHP has syslog() function that can write to the standard syslog files on Unix machines and to the Event log on Windows machines.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Download a website to hdd 2 49
test if query has no results 2 19
get domain with php 7 19
Update from TABLE-A to TABLE-B 5 38
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now