This maybe covered in the documentation, but I've tried Googling a few times for the answer but have come up blank. The issue I'm having is that having migrated a few website over to linux from a windows webserver, I'm trying to gain some of the functionality back with awstats. On the windows box we use Plesk as the hosting panel. To get awstats for a particular domain all the customer needs to do is add plesk-stat/webstat after the trailing slash in the domain name in the address bar of the browser. This brings up the awstats report quite nicely (if it's the one chosen for stats).

Is there a way to do something similar in Virtualmin? I know it can be done with typing /stats after the domain name but is there a way to show awstats instead webalizer? I can see the familiar stats using the logs and reports in virtualmin but I don't want customers logging in to see their report that way.

While on this topic can I also turn off the requirement to enter a username and password when accessing stats using the domain as can be done in Plesk?

Many thanks for any help, it's appreciated.

Status: 
Closed (fixed)

Comments

Assuming the AWstats feature is enabled for a domain, it should be possible to access stats at /awstats/awstats.pl.

Thanks for getting back. Awstats is enabled for the domains (well I assume it is as it's ticked under enabled features). Going to www.domain.com/awstats/awstats.pl throws up the open or save dialogue box. Not sure what to do with the saved file and not sure what I can use to open the file either. Is there perhaps some step I'm missing?

Thanks again for the help.

That shouldn't happen - you should see the AWstats UI instead at that URL.

Is this in a cPanel-migrated domain, on an Ubuntu 14.04 system?

No it's just Ubuntu 14.04 install with webmin/virtualmin. No other panel.

Ok, but was this particular domain created entirely in Virtualmin, or migrated from Plesk?

It was originally created in Plesk. What I do to migrate a site is to back up it's database in plesk using phpmyadmin, create the domain in virtualmin, install WordPress using the script available in virtualmin, delete all files from this install via ftp and drop all tables in the database, copy all files and the three WordPress folders httpdocs in Windows except the wp-config file and Web.config file via ftp, and then import the database from Windows.

I do have a site that was created entirely in virtualmin and has never been on the windows box, so will test it once I get to a pc and get back to you.

Thanks again for helping.

Ok have had a chance to check the site that has not been migrated and it too does the same thing with awstats. Wants me to login with username and password, then wants me to either save or open with, the file "awstats.pl. So it doesn't appear to be a migration issue.

I'm guessing I haven't done something simple but can't for the life of me work out what it might be.

Unfortunately I haven't been able to re-produce this. Did you change any of the settings on your system related to the default Apache configuration in Virtualmin that might effect the way CGI scripts are run?

Not that I'm aware of. I'm nervous about making changes if I don't understand what they are meant to do, and linux is a different beast compared to windows. Did you want me to do a screenshot of things in Virtualmin or Webmin? If you do just let me know what you need and I'll grab it.

But I can say that cgi in Apache module configuration is disabled. Is this normal?

Ok, let me try installing on a test Ubuntu 14.04 system first, to see if I can re-produce this there.

Lack of CGI support does appear to be the cause - try SSHing in and running :

a2enmod cgi
service apache2 restart

Thanks Jamie,

Fcgid is enabled and before I do anything I thought I'd best ask, will enabling cgi impact that at all? cgid is also disabled, does it need to be enabled too? And if I get the green light to all of these, can I just enable it through webmin or is SSH better?

Thanks again.

Enabling CGI is perfectly safe, can be done via SSH, and on most systems it is enabled by default. The next release of the Virtualmin installer will do this as part of the install process.

Jamie you're a legend, AWstats now works thank you very much. Just another question is it possible make it so that there is no need to login with a username or password?

Thanks for your help.

Unfortunately not - also, it would probably be a bad idea as anyone on the internet would be able to access you're website's traffic stats.

Hi Jamie,

Take the password thing on board. Will let you know though that after enabling CGI via SSH, Webmin now complains with with the warning below

Warning! Webmin has detected that the program https://xxx.xxx.xxx.xxx:10000/apache/edit_mods.cgi was linked to from an unknown URL, which appears to be outside the Webmin server. This may be an attempt to trick your server into executing a dangerous command.

Make sure your browser is configured to send referrer information so that it can be verified by Webmin.

Alternately, you can configure Webmin to allow links from unknown referers by :

Login as root, and edit the /etc/webmin/config file.
Find the line referers_none=1 and change it to referers_none=0.
Save the file.

Is it ok to do what it says i.e edit /etc/webmin/config file? And can you enlighten me as to what the issue may be?

Thanks.

That error seems unrelated - it can happen if you link or load a Virtualmin page without going through the regular UI. Does it happen if you logout and login to Virtualmin again?

That's probably it then. I use Firefox as my browser of choice and when I restart the browser my tabs are still available as well as any running sessions (if they haven't got a session time out in place). This is the first time I have seen this error though since starting this journey with Virtualmin.

Yeah, that would explain it - Firefox presumably isn't passing in the original referrer header in this case.

Hi Jamie,

One last issue with AWstats. It's working fine now with the exception of two domains. With these two domains when I enter credentials it just keeps asking for them again and again. I can briefly see the stats (maybe a second). I have checked and double checked them but it doesn't make any difference. The only common denominator between these two Virtual Servers is that both have a directory called .usermin. However another Virtual Server has that too but it's stats are accessible. I can view the stats in virtualmin ui but can't using the URL. Any idea what may cause this? Apache log show the error to be "authentication failure for "/awstats/awstats.pl": Password Mismatch". Yet I know the password is correct, it's the one I use for ftp access and that works.

I know this isn't related to the ticket but...

Thanks for your help.

The .usermin directory is unlikely to be related to this issue. Perhaps the password protecting AWstats just needs to be changed? This can be done by selecting the domain from the left menu in Virtualmin, and going to Services -> Protected Directories.

I did that to one of them thinking that might help and basically removed the protected directory (the only option in there apart from adding a protected directory). That effectively killed the stats with the error message

Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at [no address given] to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log.

Apache error log (2)No such file or directory: [client xxx.xxx.xxx] AH01620: Could not open password file: /home/xxxxxxxxxxx/.awstats-htpasswd

Not sure how to recreate the file it's looking for?

You can edit the file /etc/apache2/sites-enabled/yourdomain.com.conf and remove the block starting with \<Files awstats.pl\> , and then restarting Apache.

Mmmm can't see a backslash in the conf file though. Plenty of forward slashes in directory paths. What would happen if I commented out the AuthUserFile or deleted that line? When checking via FTP that file .awstats-htpasswd is missing. That's also the error message I get. Or can I just create the file and place it in the directory?

Sorry, I messed up the formatting of the post - it should say <Files awstats.pl>

Hi Jamie,

That fixed it. May try that with the other domain that refuses to show AWstats.

Thanks

Yeah, that will forcibly disable password protection for awstats.

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