Php visitor logging


#1

hey everybody. i am tracking visitors to my site using a php script. it puts visitor information (ip address, hostname, etc) into a .txt file.

right now i have created a directory in my mydomain.com directory to store the log files. the problem is that anybody who finds out the address can view these files and i want this information to be private.

is there any way to store the files somewhere that is not public? how would i specify the path to store the files in a private location?


#2

I think this link should be of help:

Regards


#3

You could password protect that directory or url as the poster above points out.

You could also create and write to the log file in a path that is above or outside of the area that apache makes available. For example /home/USER/mywebsiteslogs/logfile.txt


#4

If you don’t want the files to be pulic accessable, don’t store the file in your domain directory /home/yourusername/yourdomain.com directory. That is public. Store the files in your user’s home directory /home/youruser


#5

Storing it in the /home/yourusername area sounds like what I need. How would I find my username in the /home/username path? Is it the same name as the ftp login?[hr]
Never mind, I figured out the correct path. Quick question though. Is there any harm in changing the permissions of the /home/username/logs directory to 750 (that is, adding user write permission) and storing the logs there?

It seems like /home/username/logs/mysite.com is the best place to put the logs but there is a problem if I try to use that directory. Why?


#6

The directories in /home/username/logs are reserved for the use of the web server. Put your own log files somewhere else.