PDA

View Full Version : Can't get cgi/web Update option to work


enthrop
7-21-04, 01:05 PM
Hey,

I can update all my stats manually from a command line, but I can't get the CGI version of the webpage to update when i hit the "update link." Here's the error msg I get:

Error: Couldn't open server log file "/var/log/httpd/access_log" : Permission denied

Setup ('/etc/awstats/awstats.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

So I thought that 'nobody' didn't have permission to access the logs, so:

[]# ls -la
total 3192
drwx------ 2 root root 4096 Jul 18 04:03 .
drwxr-xr-x 8 root root 4096 Jul 18 04:03 ..
-rw-r--r-- 1 root awstats 196940 Jul 21 13:08 access_log
-rw-r--r-- 1 root awstats 993463 Jul 18 03:28 access_log.1
-rw-r--r-- 1 root awstats 416705 Jul 11 03:18 access_log.2
-rw-r--r-- 1 root awstats 715358 Jul 4 02:12 access_log.3
-rw-r--r-- 1 root awstats 673450 Jun 27 02:34 access_log.4
[cut off rest]

[]# groups nobody
nobody : nobody awstats

Is there some setting or something that I'm forgetting? I would perfer if I could keep all ownership and group to root, but if this is the only way to do it, what am I doing wrong?

Thanks in advance - I couldn't find any other thread related to this.

extras
7-21-04, 01:57 PM
You need to change the settings in awstat.pl or whatever.
Your log is located at /www/U/USERNAME/logs/ directory
if you are talking about the awstat installed on your site (on PowWeb server).

If you are talking about local machine, just change the paermission
to 755 for the DIRECTORY logs files are in.(It's 700, now)
sudo chmod 755 /var/log/httpd

enthrop
7-21-04, 02:28 PM
Thank you.

That helped and solved my problem :) Never thought to chmod the whole directory.

Quick follow up question: what does the chmod for the /data have to be (the folder awstats writes to). Can i use 755? or do I need 777?

I perfer to keep all permissions as tight/secure as possible, while still allowing for full functionality.

Thank you.

extras
7-21-04, 03:14 PM
It depends on the ownership of the directory/file and awstat progrom.
If the CGI is running as nobody, and the owner is anything other than nobody,
then you may need 777.
If the owner and CGI is the same, then directory=700, files=600 should be enough.

On PowWeb, CGI runs with user's ID., and directories and files (other than log files)
are owned by the same user.
So, generally, we need only 400 for r/o and 600 for r/w files.
For a directory, 700 is enough.
(But normal HTTP access requires 440 or 640 for files and 710 for directories.)

Note.
You should not openn any services/ports of your home machine to public
unless you know exactly what you are doing.
So many people/bots are scanning for vulnerabilities these days.