1

Topic: AwStats Internal Server error

==== Required information ====
- iRedMail version: v0.8.6
- Store mail accounts in which backend (MySQL):
- Linux/BSD distribution name and version: Ubuntu 12.04.4 LTS (Server)
- Related log if you're reporting an issue: apache2 error.log
====

I am trying to access awstats but I keep an error code 500 (Internal Server Error) after logging in.

The apache error.log file states:

[Tue Feb 25 07:27:46 2014] [error] Failed to run mod-auth-mysql for /awstats/awstats.pl?config=web: No database name specified
[Tue Feb 25 07:27:46 2014] [crit] [client X.X.X.X] configuration error:  couldn't check user.  Check your authn provider!: /awstats/awstats.pl

I took a look at the awstats.conf file in /etc/apache2/conf.d but it seems fairly generic and compared it to a working awstats.conf file and they look the same.

Where can I find the database information at for awstats to confirm that it is configured correctly?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: AwStats Internal Server error

I thing, awstats are not part of iRedMail package - anyway it's clear you have wrong setup of authentication.

Locate the configuration of /awstats directory in apache2 configs (under /etc/apache2) and adjust the mod-auth-mysql setup (basically you need to tell where in mysql can apache find the username/password pairs for authentication).

You can inspirate yourself in e.g. cluebringer setup - file /etc/apache2/conf.d/cluebringer.conf

3

Re: AwStats Internal Server error

camel1cz wrote:

I thing, awstats are not part of iRedMail package - anyway it's clear you have wrong setup of authentication.

Locate the configuration of /awstats directory in apache2 configs (under /etc/apache2) and adjust the mod-auth-mysql setup (basically you need to tell where in mysql can apache find the username/password pairs for authentication).

You can inspirate yourself in e.g. cluebringer setup - file /etc/apache2/conf.d/cluebringer.conf

Looking at the cluebringer.conf looks identical to the awstats config:

<Directory /usr/share/postfix-cluebringer-webui/webui/>
    DirectoryIndex index.php
    Options ExecCGI
    Order allow,deny
    #allow from 127.0.0.1
    allow from all

    AuthType basic
    AuthName "Authorization Required"
    AuthMYSQL on
    AuthBasicAuthoritative Off
    AuthUserFile /dev/null

    # Database related.
    AuthMySQL_Password_Table mailbox
    Auth_MySQL_Username_Field username
    Auth_MySQL_Password_Field password

    # Password related.
    AuthMySQL_Empty_Passwords off
    AuthMySQL_Encryption_Types Crypt_MD5
    Auth_MySQL_Authoritative On

    Require valid-user
</Directory>

4

Re: AwStats Internal Server error

Try to set also DB and Host...

AuthMySQL_DB authdb
Auth_MySQL_Host localhost

What AuthType do you have?

Can you post the config of awstats in apache?

5

Re: AwStats Internal Server error

This is the /etc/apache2/conf.d/awstats.conf file that was generated by the iRedMail installer in full. I have not made any modifications to it.

#
# File generated by iRedMail (2014.02.10.12.13.58):
#
# Version:  0.8.6
# Project:  http://www.iredmail.org/
#
# Community: http://www.iredmail.org/forum/
#

# Note: Please refer to /etc/apache2/sites-available/default-ssl for SSL/TLS setting.
#Alias /awstats/icon "/usr/share/awstats/icon/"
#Alias /awstats/css "/usr/share/awstats/css/"
#Alias /awstats/js "/usr/share/awstats/js/"
#ScriptAlias /awstats "/usr/lib/cgi-bin/"

<Directory /usr/lib/cgi-bin/>
    DirectoryIndex awstats.pl
    Options ExecCGI
    Order allow,deny
    allow from all
    #allow from 127.0.0.1

    AuthName "Authorization Required"
    AuthType Basic
    AuthMYSQL on
    AuthBasicAuthoritative Off
    AuthUserFile /dev/null

    # Database related.
    AuthMySQL_Password_Table mailbox
    Auth_MySQL_Username_Field username
    Auth_MySQL_Password_Field password

    # Password related.
    AuthMySQL_Empty_Passwords off
    AuthMySQL_Encryption_Types Crypt_MD5
    Auth_MySQL_Authoritative On
    #AuthMySQLUserCondition "isglobaladmin=1"

    Require valid-user
</Directory>

6

Re: AwStats Internal Server error

Don't know, what can be the problem, sorry.

You can try to access http://your.server/cluebringer and see, if it shows similar error. If it works as expected, just replicate the same setup for awstats...

7

Re: AwStats Internal Server error

camel1cz wrote:

Don't know, what can be the problem, sorry.

You can try to access http://your.server/cluebringer and see, if it shows similar error. If it works as expected, just replicate the same setup for awstats...

I get the same error for cluebringer, 500 internal server error.

Apache2 error.log:

[Tue Feb 25 11:23:13 2014] [error] Failed to run mod-auth-mysql for /cluebringer: No database name specified
[Tue Feb 25 11:23:13 2014] [crit] [client 199.123.79.97] configuration error:  couldn't check user.  Check your authn provider!: /cluebringer

8

Re: AwStats Internal Server error

Eh, my mistake - I didn't scroll to the right to see the error.

Add in the configuration following:

AuthMySQL_DB vmail
Auth_MySQL_Host localhost

9 (edited by QuantumPhysGuy 2014-02-26 01:00:50)

Re: AwStats Internal Server error

camel1cz wrote:

Eh, my mistake - I didn't scroll to the right to see the error.

Add in the configuration following:

AuthMySQL_DB vmail
Auth_MySQL_Host localhost

Now I get this:

[Tue Feb 25 11:50:01 2014] [error] Connection error: Access denied for user 'www-data'@'localhost' (using password: NO)

I know that means that the www-data user was denied, should I create it a read-only account in MySQL?

10 (edited by QuantumPhysGuy 2014-02-26 01:00:34)

Re: AwStats Internal Server error

camel1cz wrote:

Eh, my mistake - I didn't scroll to the right to see the error.

Add in the configuration following:

AuthMySQL_DB vmail
Auth_MySQL_Host localhost

Just as a test I added

AuthMySQL_User USERNAME_HERE
AuthMySQL_Password PASSWORD_HERE

And it worked, should I leave it configured with the MySQL credentials?

11

Re: AwStats Internal Server error

On my system in cluebringer.conf is configured vmail user... but I would say it's better to setup new read only account.

It's up to your taste...

12

Re: AwStats Internal Server error

camel1cz wrote:

On my system in cluebringer.conf is configured vmail user... but I would say it's better to setup new read only account.

It's up to your taste...

Alright, thanks for all the help awstats and cluebringer are working now.