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.
Comments
Submitted by JamieCameron on Fri, 08/21/2015 - 00:45 Comment #1
Assuming the AWstats feature is enabled for a domain, it should be possible to access stats at /awstats/awstats.pl.
Submitted by aremdee on Fri, 08/21/2015 - 01:45 Pro Licensee Comment #2
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.
Submitted by JamieCameron on Fri, 08/21/2015 - 11:19 Comment #3
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?
Submitted by aremdee on Fri, 08/21/2015 - 17:57 Pro Licensee Comment #4
No it's just Ubuntu 14.04 install with webmin/virtualmin. No other panel.
Submitted by JamieCameron on Fri, 08/21/2015 - 18:08 Comment #5
Ok, but was this particular domain created entirely in Virtualmin, or migrated from Plesk?
Submitted by aremdee on Fri, 08/21/2015 - 22:41 Pro Licensee Comment #6
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.
Submitted by aremdee on Sat, 08/22/2015 - 00:34 Pro Licensee Comment #7
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.
Submitted by JamieCameron on Sat, 08/22/2015 - 00:57 Comment #8
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?
Submitted by aremdee on Sat, 08/22/2015 - 04:43 Pro Licensee Comment #9
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?
Submitted by JamieCameron on Sun, 08/23/2015 - 02:41 Comment #10
Ok, let me try installing on a test Ubuntu 14.04 system first, to see if I can re-produce this there.
Submitted by JamieCameron on Sun, 08/23/2015 - 13:02 Comment #11
Lack of CGI support does appear to be the cause - try SSHing in and running :
a2enmod cgi
service apache2 restart
Submitted by aremdee on Sun, 08/23/2015 - 21:51 Pro Licensee Comment #12
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.
Submitted by JamieCameron on Sun, 08/23/2015 - 23:20 Comment #13
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.
Submitted by aremdee on Sun, 08/23/2015 - 23:39 Pro Licensee Comment #14
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.
Submitted by JamieCameron on Sun, 08/23/2015 - 23:52 Comment #15
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.
Submitted by aremdee on Mon, 08/24/2015 - 17:44 Pro Licensee Comment #16
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 :
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.
Submitted by JamieCameron on Mon, 08/24/2015 - 23:14 Comment #17
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?
Submitted by aremdee on Tue, 08/25/2015 - 01:11 Pro Licensee Comment #18
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.
Submitted by JamieCameron on Tue, 08/25/2015 - 18:36 Comment #19
Yeah, that would explain it - Firefox presumably isn't passing in the original referrer header in this case.
Submitted by aremdee on Wed, 08/26/2015 - 19:39 Pro Licensee Comment #20
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.
Submitted by JamieCameron on Wed, 08/26/2015 - 23:42 Comment #21
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.Submitted by aremdee on Thu, 08/27/2015 - 00:09 Pro Licensee Comment #22
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?
Submitted by JamieCameron on Fri, 08/28/2015 - 00:04 Comment #23
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.Submitted by aremdee on Fri, 08/28/2015 - 01:54 Pro Licensee Comment #24
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?
Submitted by JamieCameron on Fri, 08/28/2015 - 20:54 Comment #25
Sorry, I messed up the formatting of the post - it should say <Files awstats.pl>
Submitted by aremdee on Sun, 08/30/2015 - 19:37 Pro Licensee Comment #26
Hi Jamie,
That fixed it. May try that with the other domain that refuses to show AWstats.
Thanks
Submitted by JamieCameron on Mon, 08/31/2015 - 21:57 Comment #27
Yeah, that will forcibly disable password protection for awstats.
Submitted by Issues on Mon, 09/14/2015 - 22:00 Comment #28
Automatically closed -- issue fixed for 2 weeks with no activity.