Awstats is not working (no results)

Hi,

Awstats shows no results. Here is what i have got, if i generate the report:

Create/Update database for config "/etc/awstats/awstats.example.com.conf" by AWStats version 7.8 (build 20200416)
From data in log file "gunzip -c /var/log/virtualmin/example.com_access_log.2.gz |"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...

> Error: Command for pipe gunzip -c /var/log/virtualmin/example.com_access_log.2.gz | failed

Setup (/etc/awstats/awstats.example.com.conf file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in docs directory).
Create/Update database for config "/etc/awstats/awstats.example.com.conf" by AWStats version 7.8 (build 20200416)
From data in log file "gunzip -c /var/log/virtualmin/example.com_access_log.1.gz |"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...

> Error: Command for pipe gunzip -c /var/log/virtualmin/example.com_access_log.1.gz |failed

Setup (/etc/awstats/awstats.example.com.conf file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in docs directory).
Create/Update database for config "/etc/awstats/awstats.example.com.conf" by AWStats version 7.8 (build 20200416)
From data in log file "/var/log/virtualmin/example.com_access_log"...

> Error: Couldnt open server log file "/var/log/virtualmin/example.com_access_log" : Permission denied

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

In the: public_html → awstats → index.html the owner is: example:example and permission is: 0664
And the log files: var → log → virtualmin the owner is: www-data:www-data and the permission is: 0660

I have changed the root users name (if this is important). :slight_smile:

SYSTEM INFORMATION
Ubuntu Linux 22.04.2
Virtualmin version: 7.7
nginx
Awstats

I hope, someone can help me…, thanks!!

Error: Command for pipe gunzip -c /var/log/virtualmin/example.com_access_log.2.gz | failed
Error: Command for pipe gunzip -c /var/log/virtualmin/example.com_access_log.1.gz | failed
Error: Couldnt open server log file “/var/log/virtualmin/example.com_access_log” : Permission denied

push… please

probably. was it working before you did that? Never seen a problem with awstats on a new install.

“permission denied” for a standard access_log file is almost certainly pointing to some incorrect permission change. I would retrace your steps with all these permission changes back to an installed status then ask yourself why are you making/breaking it.

Note. your access_log and error_log are normally 0777

Hi,
I have checked this after I change the username. Can not say, if it was working before.

Now I have checked the permission and it was something like 0660 after your post. I changed/edit it to 0777 and it is working now. But is 0777 safe or good practice? I am a beginner in hosting websites and a bit scared. :slight_smile:

I have changed this log files: /var/log/virtualmin to 0777

Thanks for your help

if it is only being accessed by “safe” programs. so if you trust “root” or “root” owned processes then I guess it is. If you don’t trust “root” then you are really stuffed!

Glad it is fixed

The files located in the directory /var/log/virtualmin must have as
owner and group: [vm_user or domain] www-data
access permissions: 0660 / -rw-rw----

If as root you move the files temporarily and restart the webserver service they should be created from scratch when you access the domain page in the browser.

Perhaps you could explain why 0777 seems to be default here


OK they are symlinks. but I always thought a symlink carried the same permission as the linked to file.
Here the owner:group is the VS domain owner and the domain owner(www-data is a nonsense on my VS boxes)

hi,
thanks for your post @ADDISON74 !!
owner and group was both www-data:www-data
have changed it to user:www-data now… but i guess it is not working anymore.

If I move the old log files and delete /var/log/virtualmin/_access-log and restart the nginx server then root:root is the owner and group with permission 0644. :frowning:

@Stegan what group/permission do you have in: /var/log/virtualmin ?
Symlinks are 0777… but in virtulmin logs 0660

which makes no sense at all. There is no group on this system www-data
when I do a cut -d: -f1 /etc/group it contains everything else but no www-data
just like yourself I use Nginx not Apache

the difference in symlink permission did surprise me. I thought they default to the original file (I don’t understand why they are different except that they have the owner:group of the parent directory - which does make sense)

I would expect awstats to look at the symlink of the domain.

my expectation stands to be corrected!

OK…
I changed it back to: www-data:www-data and 0660
My logs are updating(size increases) but I can not access them with awstat.

If I regenerate the log files I get this error:
Error: Command for pipe ‘gunzip -c /var/log/virtualmin/example.com_access_log.5.gz |’ failed
Setup (‘/etc/awstats/awstats.example.com.conf’ file, web server or permissions) may be wrong.

I am confused…

edit:

I have changed the owner and group to: example:example but with permission 0664 and it works.
Now, is 0644 safe?

So am I - I thought this was fixed back post 4

I have edited my post… look one post up please.

0777 was working in the virtualmin log file… but you have www-data there and 0660.

I am on holiday next days… will anwser later, thanks.

yes but as I was responding to @ADDISON74 I do not understand why the group www-data has any relevance here or anywhere

The logs in /var/log/virtualmin/log are 0660 almost certainly because they are all files in the parent directory virtualmin which probably put them there.

The symlinks are in /home/domain/logs/ are owned by the domain owner:domain which makes complete sense. As awstats is either on or off depending on the VS setup I would expect it to look here for the log file to analyse.
why should it bother with all those other log files (see 48 of them listed in the virtualmin list) most of those other files awstats has no interest in.

Also I note gunzip is tripping up I believe these symlinks are not just pointing to a single file domain_access.log but also any of the compressed files domain_access.log.1.gz I am pretty sure that gunzip will require e(x)ecute permission to unzip those.

have a good holiday :slight_smile:

SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04.3
Webmin version 2.101
Usermin version 2.001
Virtualmin version 7.7
Theme version 21.04
Package updates 1 package update is available

Might try owner and group to: username:www-data permission 0660
I am Ubuntu Linux 22.04.3 and this is how mine is set

also just for reference these are my default unchanged settings:

for clarity ? you have a group www-data as shown by listing groups with cut -d: -f1 /etc/group? because I don’t seem to.

yes I have a www-data

All the domain (users) are members of www-data. www-data has no login privileges.

Hi, I am back. :slight_smile:

Have changed my owner to user:www-data and permission to 0660 and it is working.

@Stegan I have the group www-data too.

Thanks for help!!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.