1

Topic: 0.9.2 CentOS 7 apache problem

======== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.2
- Linux/BSD distribution name and version: CentOS Linux 7 (Core)
- 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:
====

Hi,
I have running iRedmail server with very old version (0.6.2). I'm preparing to update to current version by installing quite new 0.9.2 and performing procedure http://www.iredmail.org/docs/migrate.to … erver.html

After install iRedMail in 0.9.2 version and after reboot I have problem with httpd service. Occurs error:

-- Unit httpd.service has begun starting up.
Sep 16 09:13:48 test kernel: httpd[3169]: segfault at 7f872b6010b0 ip 00007f872b6010b0 sp 00007fff9f894148 error 14 in mod_systemd.so[7f872b610000+200
Sep 16 09:13:48 test systemd[1]: httpd.service: main process exited, code=killed, status=11/SEGV
Sep 16 09:13:48 test kill[3171]: kill: cannot find process ""
Sep 16 09:13:48 test systemd[1]: httpd.service: control process exited, code=exited status=1
Sep 16 09:13:48 test systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has failed.
--
-- The result is failed.
Sep 16 09:13:48 test systemd[1]: Unit httpd.service entered failed state.

Is anyone who can help me ?

Wojtek

----

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

2

Re: 0.9.2 CentOS 7 apache problem

*) Any related log in Apache log file?
*) Do you have Nginx running?

3

Re: 0.9.2 CentOS 7 apache problem

Hi,
In /var/log/messages I can't see nothing new

Sep 16 20:04:05 test kernel: httpd[2930]: segfault at 7fef70d990b0 ip 00007fef70d990b0 sp 00007ffcca994ff8 error 14 in mod_systemd.so[7fef70da8000+2000]
Sep 16 20:04:05 test systemd: httpd.service: main process exited, code=killed, status=11/SEGV
Sep 16 20:04:05 test kill: kill: cannot find process ""
Sep 16 20:04:05 test systemd: httpd.service: control process exited, code=exited status=1
Sep 16 20:04:05 test systemd: Failed to start The Apache HTTP Server.
Sep 16 20:04:05 test systemd: Unit httpd.service entered failed state.

During installation process I choose Apache instead Nginx.
I did some tests with Nginx and as I remember awstat didn't install automatically.

Wojtek

4

Re: 0.9.2 CentOS 7 apache problem

Does Apache work if you disable module 'mod_systemd'?

5

Re: 0.9.2 CentOS 7 apache problem

Hi,
If I disable mod_systemd module, Apache crashes during launching mod_cgi.so.

Wojtek

6

Re: 0.9.2 CentOS 7 apache problem

In addition,
I performed some tests:
- CentOS 7
- iRedMail 0.9.2

During installation process I choose NGINX and I dont have access to https://<my domain>/cluebringer/
I think that there is an error in installator script.

Wojtek

7

Re: 0.9.2 CentOS 7 apache problem

I have no idea here, didn't experience this issue before.

Do you have SELinux enabled in /etc/selinuc/config?

8

Re: 0.9.2 CentOS 7 apache problem

ZhangHuangbin wrote:

I have no idea here, didn't experience this issue before.

Do you have SELinux enabled in /etc/selinuc/config?

Got same problem on my test-system.
SelLinux disabled.
Found that the new awstat.conf produces the failure.

Old:
Alias /awstatsclasses "/usr/share/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/share/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/share/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/share/awstats/wwwroot/cgi-bin/"
<Directory "/usr/share/awstats/wwwroot">
    Options None
    AllowOverride None
    <IfModule mod_authz_core.c>
        # Apache 2.4
        Require local
    </IfModule>
    <IfModule !mod_authz_core.c>
        # Apache 2.2
        Order allow,deny
        Allow from 127.0.0.1
        Allow from ::1
    </IfModule>
</Directory>
<IfModule mod_env.c>
    SetEnv PERL5LIB /usr/share/awstats/lib:/usr/share/awstats/plugins
</IfModule>

New:
DBDriver mysql
DBDParams "host=127.0.0.1 port=3306 dbname=vmail user=vmail pass=kjJ0b6FtEQ2rSHCisiReQfUBqXRrjW"
<Directory /usr/share/awstats/wwwroot/cgi-bin>
    DirectoryIndex awstats.pl
    Options ExecCGI
    AuthType Basic
    AuthName "Authentication required"
    AuthBasicProvider dbd
    AuthDBDUserPWQuery "SELECT password FROM mailbox WHERE username = %s AND isglobaladmin=1 LIMIT 1"
    Require valid-user
</Directory>
[root@test conf.d]# cat awstats.conf.neu |grep -v "^#"
DBDriver mysql
DBDParams "host=127.0.0.1 port=3306 dbname=vmail user=vmail pass=kjJ0b6FtEQ2rSHCisiReQfUBqXRrjW"
<Directory /usr/share/awstats/wwwroot/cgi-bin>
    DirectoryIndex awstats.pl
    Options ExecCGI
    AuthType Basic
    AuthName "Authentication required"
    AuthBasicProvider dbd
    AuthDBDUserPWQuery "SELECT password FROM mailbox WHERE username = %s AND isglobaladmin=1 LIMIT 1"
    Require valid-user
</Directory>

If I use the old one httpd startup is normal
Using the old one:
-- Unit httpd.service has begun starting up.
Dez 28 20:27:48 test.heiner.local kernel: httpd[3832]: segfault at 7f4648832630 ip 00007f4648832630 sp 00007fff315cdb68 error 14 in mod_systemd.so[7f4648841000+2000]
Dez 28 20:27:48 test.heiner.local systemd[1]: httpd.service: main process exited, code=killed, status=11/SEGV
Dez 28 20:27:48 test.heiner.local kill[3847]: kill: cannot find process ""
Dez 28 20:27:48 test.heiner.local systemd[1]: httpd.service: control process exited, code=exited status=1
Dez 28 20:27:48 test.heiner.local systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li … temd-devel
--
-- Unit httpd.service has failed.

9

Re: 0.9.2 CentOS 7 apache problem

Try to disable Apache module 'mod_systemd'.

10 (edited by intlhouseofdan 2015-12-29 12:03:04)

Re: 0.9.2 CentOS 7 apache problem

gibor wrote:
ZhangHuangbin wrote:

I have no idea here, didn't experience this issue before.

Do you have SELinux enabled in /etc/selinuc/config?

Got same problem on my test-system.
SelLinux disabled.
Found that the new awstat.conf produces the failure.

Old:
Alias /awstatsclasses "/usr/share/awstats/wwwroot/classes/"
Alias /awstatscss "/usr/share/awstats/wwwroot/css/"
Alias /awstatsicons "/usr/share/awstats/wwwroot/icon/"
ScriptAlias /awstats/ "/usr/share/awstats/wwwroot/cgi-bin/"
<Directory "/usr/share/awstats/wwwroot">
    Options None
    AllowOverride None
    <IfModule mod_authz_core.c>
        # Apache 2.4
        Require local
    </IfModule>
    <IfModule !mod_authz_core.c>
        # Apache 2.2
        Order allow,deny
        Allow from 127.0.0.1
        Allow from ::1
    </IfModule>
</Directory>
<IfModule mod_env.c>
    SetEnv PERL5LIB /usr/share/awstats/lib:/usr/share/awstats/plugins
</IfModule>

New:
DBDriver mysql
DBDParams "host=127.0.0.1 port=3306 dbname=vmail user=vmail pass=kjJ0b6FtEQ2rSHCisiReQfUBqXRrjW"
<Directory /usr/share/awstats/wwwroot/cgi-bin>
    DirectoryIndex awstats.pl
    Options ExecCGI
    AuthType Basic
    AuthName "Authentication required"
    AuthBasicProvider dbd
    AuthDBDUserPWQuery "SELECT password FROM mailbox WHERE username = %s AND isglobaladmin=1 LIMIT 1"
    Require valid-user
</Directory>
[root@test conf.d]# cat awstats.conf.neu |grep -v "^#"
DBDriver mysql
DBDParams "host=127.0.0.1 port=3306 dbname=vmail user=vmail pass=kjJ0b6FtEQ2rSHCisiReQfUBqXRrjW"
<Directory /usr/share/awstats/wwwroot/cgi-bin>
    DirectoryIndex awstats.pl
    Options ExecCGI
    AuthType Basic
    AuthName "Authentication required"
    AuthBasicProvider dbd
    AuthDBDUserPWQuery "SELECT password FROM mailbox WHERE username = %s AND isglobaladmin=1 LIMIT 1"
    Require valid-user
</Directory>

If I use the old one httpd startup is normal
Using the old one:
-- Unit httpd.service has begun starting up.
Dez 28 20:27:48 test.heiner.local kernel: httpd[3832]: segfault at 7f4648832630 ip 00007f4648832630 sp 00007fff315cdb68 error 14 in mod_systemd.so[7f4648841000+2000]
Dez 28 20:27:48 test.heiner.local systemd[1]: httpd.service: main process exited, code=killed, status=11/SEGV
Dez 28 20:27:48 test.heiner.local kill[3847]: kill: cannot find process ""
Dez 28 20:27:48 test.heiner.local systemd[1]: httpd.service: control process exited, code=exited status=1
Dez 28 20:27:48 test.heiner.local systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li … temd-devel
--
-- Unit httpd.service has failed.


Thank you for this, I have been bashing my head off the damn desk for a week trying to figure out why my server wasn't working. I reinstalled CentOS 7 Minimal Web Server and omitted AWStats from my iRedMail install and now it works perfectly!

FWIW: Disabling mod_systemd causes a domino effect as far as errors are concerned. I think the segfault indicating mod_systemd is caused by systemd *NOT* being able to start Apache do to some unknown issue (now known to be the AWStats configuration). The logs show no useful information. Thank you again gibor!