1 (edited by andy.astrand 2013-06-19 22:36:15)

Topic: Installation Problems - iRedMail 0.8.4 / CentOS 6.3

iRedMail 0.8.4
CentOS 6.3
Storing mail accounts in either MySQL (tried first) or LDAP (tried second)

Brand new user.

I'm installing iRedMail on a freshly imaged VM. That's had nothing done to it.
Initally chose MySQL as the account storer, then tried a fresh VM using LDAP.
Both have given the same problems.

Install runs fine until this:

********************************************************************
* Start iRedMail Configurations
********************************************************************
< INFO > Create self-signed SSL certification files.
< INFO > Create required system accounts: vmail, iredapd, iredadmin.
< INFO > Configure Apache web server and PHP.
< INFO > Configure LDAP server: OpenLDAP.
< INFO > Configure MySQL database server.
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
< INFO > Configure Postfix (Message Transfer Agent).
< INFO > Configure Policyd (postfix policy server, version 1.8).
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
< INFO > Configure Dovecot (pop3/imap/managesieve server, version 2).
< INFO > Configure ClamAV (anti-virus toolkit).
< INFO > Configure Amavisd-new (interface between MTA and content checkers).
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
< INFO > Configure SpamAssassin (content-based spam filter).
< INFO > Configure iRedAPD (postfix policy daemon).
< INFO > Configure iRedAdmin (official web-based admin panel).
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
< INFO > Configure Fail2ban (authentication failure monitor).
< INFO > Configure Awstats (logfile analyzer for mail and web server).
< INFO > Configure Roundcube webmail.
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
< INFO > Configure phpLDAPadmin (web-based LDAP management tool).
< INFO > Configure phpMyAdmin (web-based MySQL management tool).

*************************************************************************
* iRedMail-0.8.4 installation and configuration complete.
*************************************************************************

< INFO > Disable SELinux in /etc/selinux/config.
< Question > Would you like to use firewall rules provided by iRedMail now?
< Question > File: /etc/sysconfig/iptables, with SSHD port: 22. [Y|n]


I let the install continue to completion, reboot, and attempt to go to the /mail
URL and I get a similar error saying cannot connect to the database.

I can confirm both during installation (I checked on a seperate terminal while
the installation was asking that firewall question) and after reboot that mysqld
is running.

I assume that getting the database to talk now will be a bit late as a fair amount
of important table creation and population will have failed to happen during the
install step.

I'm going to go and purge this VM, make another one and before installing
iRedMail just check that the install image we're getting hasn't pre-installed
something unexpected.

Any other ideas?

If I could get this to work out of the box it would be a massive relief.

----

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

2

Re: Installation Problems - iRedMail 0.8.4 / CentOS 6.3

Do you have MySQL server running before installing iRedMail? Do you set a password for MySQL root user?

Here's my suggestion: iRedMail is designed to be deployed on a FRESH server, so you'd better install a minimal server to install iRedMail.

Also, next time you install iRedMail, try using below command instead of "bash iRedMail.sh", it will print addition details on terminal, please paste it here to help troubleshoot if it failed again.

# IREDMAIL_DEBUG='YES' bash iRedMail.sh

3

Re: Installation Problems - iRedMail 0.8.4 / CentOS 6.3

Excuse for replying to my own thread.

A bit more research.

Looking at the /etc/my.cnf thats present at mid install, before the install copies
it's own my.cnf, it looks like this:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
skip-networking

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid


Now the error message banging on about 127.0.0.1 suggests that the various install scripts
are attempting to connect to mysqld using TCP/IP. But the my.cnf present during the time
clearly says "skip-networking".

It's my understanding that this prevents mysqld listening on any socket.

I'll start a fresh VM, check to see if the image has dumped it there, if so I'll edit it. Otherwise
I'll fiddle your scripts to make sure that line gets commented out after mysql installation but
before anything tries to use it.

Ill let you know.

4

Re: Installation Problems - iRedMail 0.8.4 / CentOS 6.3

ZhangHuangbin wrote:

Do you have MySQL server running before installing iRedMail? Do you set a password for MySQL root user?

Here's my suggestion: iRedMail is designed to be deployed on a FRESH server, so you'd better install a minimal server to install iRedMail.

Also, next time you install iRedMail, try using below command instead of "bash iRedMail.sh", it will print addition details on terminal, please paste it here to help troubleshoot if it failed again.

# IREDMAIL_DEBUG='YES' bash iRedMail.sh

It's a completely fresh VM. I don't "believe" it has anything installed. But as I said I'll double check.

I certainly haven't set any mysql root password and can confirm that once the iRedMail install has completed
the mysql root password is set to what I entered during the iRedMail install. So I don't think the install is
failing to connect due to a password issue.

I'll try that extra debug option too.

5

Re: Installation Problems - iRedMail 0.8.4 / CentOS 6.3

I'm please to say we have progress.

Fresh VM (This is using bigv.io by the way)

Checked and it does come with mysql installed, not running, but installed.
It was this installation that had stuck the /etc/my.cnf with the skip-networking option.

So all I've done is comment out that skip-networking line, and tried the
iRedMail installation again.

It managed to complete with no errors and after a reboot I have a much happier
looking roundcube logon page sitting at /mail

I haven't tried logging in yet as I don't have any users definied. But everything looks
much, much happier.

Thank you

6

Re: Installation Problems - iRedMail 0.8.4 / CentOS 6.3

"skip-networking" is the root cause.

iRedMail connects to MySQL server via TCP/IP by default, not socket file.

7

Re: Installation Problems - iRedMail 0.8.4 / CentOS 6.3

Yes, and although the iRedMail definitely downloaded and upgraded the MySQL
installation that process doesn't usually override any pre-existing my.cnf file.

I'd suggest a helpful piece of additional script to automatically comment out any
such line during installation but my brain is mush at the moment and I don't want
to stick my scripting hat on.

Thanks for your help.

8

Re: Installation Problems - iRedMail 0.8.4 / CentOS 6.3

Good idea. i will let iRedMail check "skip-networking" in my.cnf first. Enable it and restart MySQL service before importing SQL data.

9

Re: Installation Problems - iRedMail 0.8.4 / CentOS 6.3

Hi Andy,

Fixed moment ago:
https://bitbucket.org/zhb/iredmail/comm … c720bfbf4e

Thanks again for your suggestion. smile