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).
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.
I have changed this log files: /var/log/virtualmin to 0777
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!
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.
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.
@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.
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?
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.