1 (edited by Guido64 2016-05-28 03:50:31)

Topic: Can't login to awstats & can't setup DBD auth for vhosts

==== Required information ====
0.9.5-1                    - iRedMail version (check /etc/iredmail-release):
Debian 8.4 (Jessie) - Linux/BSD distribution name and version:
MySQL                     - Store mail accounts in which backend (LDAP/MySQL/PGSQL):
Apache                    - Web server (Apache or Nginx):
I'm poor so no          - Manage mail accounts with iRedAdmin-Pro?
                                - Related log if you're reporting an issue:
====

I'm using iRedmail since like 2 weeks so i'm not very familiar with it yet.

I installed iRedmail on a OpenVZ VPS to start building a new server to replace my old debian wheezy/Squeeze systems. Instead of setting it all up by myself manually i think iRedmail can be a huge time saver.

iRedmail seems to work now I want to setup the rest of my new server. One of the things I have setup on my old web server are some web pages which have apache mysql authentication but this apache mod does not work anymore with apache 2.4 now we need to use the dbd mod which was already installed.

After I configured a vhost with dbd authentication, error messages showed up in the log saying:
"failed to prepare SQL statements: Table 'apacheauth.mailbox' doesn't exist" mailbox ??? I didn't set that.

I found out that in /etc/apache/conf-enabled there is a file awstats.conf which also has dbd configuration seetings to secure the awstats.pl script but this is a global setting therefor wen I setup a different dbd configuration in a vhost it gives above error message. Wen I comment out the awstat dbd config my vhost auth works.

How can I make it so that awstats is secured but I can still use different dbd configurations in vhosts with different DB names?

A other thing (maybe related) is wen I go to https://mydomain.tld/awstats/awstat.pl and try to login the logs say there is a password mismatch while i'm sure its the correct password since I use it also to login to roundcude/iredmail etc.

I use the postmaster@mydomain.tld as the username. I saw in the database this user has isglobaladmin=1 set so this should work.

----

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

2

Re: Can't login to awstats & can't setup DBD auth for vhosts

You must move Auth_MySQL_* from /etc/apache2/apache.conf to /etc/apache2/conf-available/awstats.pl to avoid conflict, or, disable awstats.conf (a2disconf awstats), then comment out Auth_MySQL_*, then setup your vhost.

3 (edited by Guido64 2016-05-28 09:15:51)

Re: Can't login to awstats & can't setup DBD auth for vhosts

I searched (ctrl-f) in /etc/apache2/apache.conf for Auth_MySQL this is not in this file present.
There is no file /etc/apache2/conf-available/awstats.pl there is a /etc/apache2/conf-available/awstats.conf so i gues you ment this one. In /etc/apache2/conf-available/awstats.conf there is no Auth_MySQL in it.

4

Re: Can't login to awstats & can't setup DBD auth for vhosts

Disable awstats.conf with 'a2disconf awstats', then configure your own settings for your vhosts.

5

Re: Can't login to awstats & can't setup DBD auth for vhosts

I did what you suggested with "a2disconf awstats && a2enconf dbd_mysql". I gues then the awstats.pl is not secured anymore. That is not a real big problem since the server is behind a firewall anyway. But I was curious if and how to use multiple different dbd configurations in one and the same apache server. But I guest thats not a iRedmail specific think but more a Apache / dbd mod thing.

Thank you ZhangHuangbin!