1

Topic: Problem with awstat

==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- Related log if you're reporting an issue:
============ Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.4
- Linux/BSD distribution name and version: CentOS Linux 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue:
====

Hello, I installed iredmail on two differnet vservers and everything works perfectly besides awstats.
I cannot access  https://mydomainname.org/awstats/awstats.pl on any server. The file is password protected with .htaccess. Yes, I am using the password from “iRedMail.tips” and yes, the other
password from this file work for example the mysqlpassword  works very well.
On my second server, I get at every hour and a minute a email with the following subject

/usr/bin/perl /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=smtp -update >/dev/null

and content
sh: /var/log/maillog: No such file or directory

And the message is correct.  There is no file or directory with the name maillog.
Doing a quick search  shows me

# find -iname awstats
./usr/share/awstats
./etc/cron.hourly/awstats
./etc/awstats
./var/lib/awstats
./temp/iRedMail-0.9.4/conf/awstats

So there is awstat installed, but something wrong with the installation: Can you give me an
advice?

----

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

2

Re: Problem with awstat

What's the output of command below?

/usr/bin/perl /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=smtp -update

/var/log/maillog is Postfix log file, it should exist.

3

Re: Problem with awstat

the output is

/usr/bin/perl /usr/share/awstats/wwwroot/cgi-bin/awstats.pl -config=smtp -update
Create/Update database for config "/etc/awstats/awstats.smtp.conf" by AWStats version 7.3 (build 20140126)
From data in log file "perl /usr/share/awstats/tools/maillogconvert.pl standard < /var/log/maillog |"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
sh: /var/log/maillog: No such file or directory
Error: Command for pipe 'perl /usr/share/awstats/tools/maillogconvert.pl standard < /var/log/maillog |' failed
Setup ('/etc/awstats/awstats.smtp.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

The Machine has just 1Gig RAM and one 1 gig swap. There is nothing else running besides iredmail.
Might this be a problem?


top - 13:50:42 up 18 min,  1 user,  load average: 0.16, 0.14, 0.14
Tasks:  57 total,   1 running,  56 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  1048576 total,    30144 free,   666756 used,   351676 buff/cache
KiB Swap:  1048576 total,   994940 free,    53636 used.   172140 avail Mem

4

Re: Problem with awstat

cron job is ran by root user, so it should have required permission to open /var/log/maillog. I'm confused now. and i cannot reproduce this issue on my servers and testing machines. sad

5

Re: Problem with awstat

I am confused to, it was a brand new server.
I want to start from scratch and uninstall IredMail completely.
I used the shell script linked in this thread
http://www.iredmail.org/forum/topic333- … dmail.html
to remove everything. But I can confirm what is written in this forum
https://www.digitalocean.com/community/ … e-iredmail
The shell script does not remove everything completely

6

Re: Problem with awstat

Please reinstall server os, then install iRedMail.

7

Re: Problem with awstat

same error here.
i reinstalled the os and installed iRedMail FRESH and no login in awstats.

8

Re: Problem with awstat

ZhangHuangbin wrote:

Please reinstall server os, then install iRedMail.

I did with the same result.
Each hour, one email to postmaster@domain

9

Re: Problem with awstat

What's the owner and permission of file /var/log/maillog? Does it work if you set it to 0777? (don't forget to revert the permission after testing)

10

Re: Problem with awstat

Hello ZhangHuangbin,
like I said in the first post,
there is no file /var/log/maillog, not even an invisible file
maillog.

[root@mx ~]# cd /var/log/
[root@mx log]# ls -la
total 324
drwxr-xr-x  5 root    root         4096 Feb 18 04:10 .
drwxr-xr-x 21 root    root         4096 Feb 17 16:18 ..
-rw-------  1 root    utmp       157824 Feb 20 07:44 btmp
-rw-r--r--  1 root    root            0 Feb 17 16:27 dmesg
-rw-r--r--  1 root    root            0 Feb 17 16:18 dmesg.old
-rw-------  1 vmail   vmail           0 Feb 17 16:13 dovecot-lmtp.log
-rw-------  1 vmail   vmail       11303 Feb 20 10:01 dovecot-sieve.log
-rw-------  1 vmail   vmail       43845 Feb 20 07:13 dovecot.log
-rw-r--r--  1 root    root          168 Feb 17 16:27 firewalld
-rw-rw-r--  1 root    clamupdate      0 Feb 17 16:10 freshclam.log
drwx------  2 root    root         4096 Feb 17 16:18 httpd
drwxr-xr-x  2 iredapd iredapd      4096 Feb 17 16:18 iredapd
-rw-r--r--  1 root    root       584876 Feb 20 10:46 lastlog
drwxr-x---  2 mysql   mysql        4096 Feb 17 16:10 mariadb
-rw-r--r--  1 root    root          178 Feb 20 04:42 sa-update.log
-rw-------  1 root    root            0 Jul 21  2014 tallylog
-rw-rw-r--  1 root    utmp        11136 Feb 20 10:46 wtmp
-rw-------  1 root    root        19999 Feb 17 16:10 yum.log

I created now an empty file var/log/maillog and we will see.

11

Re: Problem with awstat

ole wrote:

there is no file /var/log/maillog, not even an invisible file

This doesn't make any sense.

Postfix, Amavisd-new, Roundcube are configured to log to /var/log/maillog with default iRedMail settings. Please try to restart syslog (first one), postfix, amavisd, and httpd services, it should create /var/log/maillog as expected.

Also, please show us full content of /etc/rsyslog.conf (and all files under /etc/rsyslog.d/ -- if exists).

12

Re: Problem with awstat

I restarted the server already several times
[qoute]
[root@mx rsyslog.d]# service syslog restart
Redirecting to /bin/systemctl restart  syslog.service
Failed to restart syslog.service: Unit syslog.service failed to load: No such file or directory.
[/qoute]

Maybe the installation is messed up, but i did not see any error message while installing.

[root@mx rsyslog.d]# service syslog restart
Redirecting to /bin/systemctl restart  syslog.service
Failed to restart syslog.service: Unit syslog.service failed to load: No such file or directory.
[root@mx rsyslog.d]#

bash: cd: /etc/rsyslog.conf: No such file or directory
[root@mx log]#

[root@mx rsyslog.d]# pwd
/etc/rsyslog.d
[root@mx rsyslog.d]# ls –la
total 12
drwxr-xr-x  2 root root 4096 Feb 17 15:52 .
drwxr-xr-x 73 root root 4096 Feb 22 13:26 ..
-rw-r--r--  1 root root   49 Feb 16 10:55 listen.conf
[root@mx rsyslog.d]#

13

Re: Problem with awstat

On CentOS 7, syslog program name is "rsyslog". please try: service rsyslog restart

14

Re: Problem with awstat

Hello ZhangHuangbin,
I think  rsyslog does not work at all.

[root@mx ~]# service rsyslog restart
Redirecting to /bin/systemctl restart  rsyslog.service
Failed to restart rsyslog.service: Unit rsyslog.service failed to load: No such file or directory.
[root@mx ~]# service rsyslog status
Redirecting to /bin/systemctl status  rsyslog.service
* rsyslog.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)
[root@mx ~]#

15

Re: Problem with awstat

Does your server have any syslog program? like syslog, rsyslog, syslog-ng.
Show us output please:

rpm -qa |grep -i syslog

16

Re: Problem with awstat

Hello Zhang, the output is

perl-Sys-Syslog-0.33-3.el7.x86_64
perl-Unix-Syslog-1.1-17.el7.x86_64

17

Re: Problem with awstat

btw on my ubuntu 14.04 lts machine i dont have "maillog" neither, i only have

-rw-r----- 1 syslog adm 1171751 Mar  5 18:10 /var/log/mail.log

18

Re: Problem with awstat

ole wrote:

Hello Zhang, the output is

perl-Sys-Syslog-0.33-3.el7.x86_64
perl-Unix-Syslog-1.1-17.el7.x86_64

Please install package 'rsyslog', then restart 'rsyslog' and other services. If it doesn't work, try rebooting the server.

19

Re: Problem with awstat

lordhelmet wrote:

btw on my ubuntu 14.04 lts machine i dont have "maillog" neither, i only have

-rw-r----- 1 syslog adm 1171751 Mar  5 18:10 /var/log/mail.log

Correct. Reference:
http://www.iredmail.org/docs/file.locat … ml#postfix