Setting up Awstats failed

Since our server migration AWStats has not worked though the backups were configured to include them and the restore process was selected to restore them

Edit Virtual Server > Enabled Features > Enable AWStats Reporting? is not checked. Selecting it and saving the change results in: Failed to modify server : AWstats reporting is already enabled for this domain

If I go over to Webmin > Servers > AWStats Reporting all my servers are listed but they are showing the same exact log file of /var/log/apache2/access.log instead of /var/log/virtualmin/domain.tld_access_log (with one exception which stats does work on). The permissions are also incorrect trying to run as root.

Changing a server to have the correct log file and correct permissions, when I try to view the log report I get this error

Error: SiteDomain parameter not defined in your config/domain file. You must edit it for using this version of AWStats.

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

I have even tried deleting the log file for reporting within Webmin > Servers > AWstats Reporting > domain > delete and then tried enabling AWstats reporting through Virtualmin > Edit Virtual Server > Enabled Features > Enable AWStats Reporting?. This time Virtualmin goes through the procedure of updating the domain. As soon as it hits the AWstats config it fails with this:

Setting up AWstats reporting ..
.. AWstats reporting failed! :

Now, though, Virtualmin shows AWstats is enabled but it still fails with the permissions error. Trying to disable it and re-enable it makes no change - same errors.

Status: 
Closed (fixed)

Comments

It sounds like the original error about AWstats already being enabled is due to the file /etc/awstats/domainname.com.conf already existing. I'd suggest moving those files to another directory, and then re-trying enabling AWstats for your domains ...

Jamie,

I copied all the conf files from /etc/awstats and tried to enable Awstats for a domain. It failed with the following below though Edit Virtual Server > Enabled Features shows it is enabled

Setting up AWstats reporting ..
.. template AWstats configuration file was not found

If I go to Logs and Reports > AWstats Configuration or View Awstats Report I get:

Failed to open /etc/awstats/awstats.domain.tld.conf : No such file or directory

You shouldn't remove the awstats.model.conf or awstats.conf file, as those are the templates Virtualmin copies to create the config for a new domain..

I copied awstats.conf back to /etc/awstats. However, there is no awstats.model.conf. No files were deleted, only moved.

That's OK, you only need one of those two files..

Ok, I was able to enable AWstats without error but when going to Logs and Reports > View AWstats Report I get this:

Error: Could not open include file: /etc/awstats/awstats.conf.local

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

What should the permissions be on those files? And why would it fail to create the proper permissions to a conf Virtualmin created for that domain?

Looks like the real issue is that /etc/awstats/awstats.conf.local is missing. If you renamed it elsewhere, you should put it back ..

Great, that worked! Thanks Jamie

Automatically closed -- issue fixed for 2 weeks with no activity.