Quote:
|
Originally Posted by cmyksteve
Hi Ed,
First I used cPanel/WHM/VoxExtreme Hacks. The php script for veiwing webalizer stats outside cPanel works great, but I didn't like having my cPanel password in the script. Ed if you're interested in using awstats check out these scripts, he has one posted.
Later I ran across a symlink solution from the cPanel forums. Page-Zone Tech support helped me with the symlink setup- and the stats have been working fine. The cPanel thread is were I read that awstats won't work with a symlink setup.
|
I looked at both of these solutions. The hacks are something I wouldn't do. I'd have to put the username and password in the php file. The symlink looks like a better solution.
I'm sticking with what I have for now. It needs a little polish in the script (to copy only the files that are newer), but it gives me better control over security.
1. I created a folder public_html/stats.
2. I password protected the folder, and created a user (cpanel)
3. Put a script in cgi-bin called "update.sh" which looks like:
#!/bin/bash
cp tmp/webalizer/*.html tmp/webalizer/*.png tmp/webalizer/webalizer.* public_html/stats
4. Created a cron (in cpanel) that has one command:
/home/account/public_html/cgi-bin/update.sh
and run it 4AM each day ( 0 4 * * * ).
As I said at the top, I'll find a way to test the source file date/time, and only copy what is newer.
The user logs in to the folder with the name and pass I set up in cpanel. I don't want to expose these files to the public.