Rootop 服务器运维与web架构

Install iRedMail on Red Hat Enterprise Linux, CentOS, Scientific Linux

| 暂无评论


System Requirements

WARNING: iRedMail is designed to be deployed on a FRESH server system, which means your server does NOT have mail related components installed, e.g. MySQL, OpenLDAP, Postfix, Dovecot, Amavisd, etc. Otherwise it may override your existing files/configurations althought it will backup files before modifing, and it may be not working as expected.

To install iRedMail, you need:

  • FRESH, working RHEL, CentOS, Scientific Linux system. Supported releases are listed on page Features of iRedMail.
  • At least 1GB of memory is required for production use.
  • #上面说了一通说需要一个全新安装的系统,不要安装mysql、openldap、postfix、dovecot、amavisd等等,总之就是很新鲜很新鲜的系统。啧啧,可以吃了。


Set a fully qualified domain name (FQDN) hostname on your server

Enter command ‘hostname -f’ to view the current hostname:

$ hostname -f #设置主机名

On RHEL/CentOS/Scientific Linux, hostname is set in two files:

  • /etc/sysconfig/network: hostname setting
# Part of file: /etc/sysconfig/network #在redhat/centos之类的还需要改此文件。 
  • /etc/hosts: hostname <=> IP address mapping. Warning: List the FQDN hostname as first item.
# Part of file: /etc/hosts  #通过hosts文件设置ip跟主机名的映射,主机名放在最前面! demo localhost localhost.localdomain 

Verify the FQDN hostname. If it wasn’t changed, please reboot server to make it work.

$ hostname -f #确认设置的是否正确!

Enable yum repositories for installing new packages

  • For CentOS or Scientific Linux, please enable CentOS/Scientific official yum repositories, and DISABLE all third-party yum repositories to avoid package conflict.
  • For Red Hat Enterprise Linux, please enable Red Hat Network to install packages, or create a local yum repository with DVD/CD ISO images.
  • 上面这几句可以忽视,如果是redhat,需要自动用iso镜像做一个yum源,并启用。推荐还是用centos比较靠谱。

Download the latest release of iRedMail

  • Visit Download page to get the latest release of iRedMail.
  • Upload iRedMail to your mail server via ftp or scp or whatever method you can use, login to the server to install iRedMail. We assume you uploaded it to directory/root/iRedMail-x.y.z.tar.bz2 (replace x.y.z by the actual version number).
  • Uncompress iRedMail tarball:
  • 下载iredmail,目前最新版:
  • 下载完解压。
# tar xjf iRedMail-x.y.z.tar.bz2 

Start iRedMail installer

It’s now ready to start iRedMail installer, it will ask you some simple questions, that’s all steps to setup a full-featured mail server.

For Chinese users: Our domain name “” is blocked in China mainland since Jun 04, 2011, please replace all ‘’ by its IP address “” (without quotes) in /root/iRedMail-x.y.z/pkgs/ BEFORE executing “”.
[root@mail ~]# vim iRedMail-0.8.6/pkgs/
# cd /root/iRedMail-x.y.z/ 
# bash #直接运行脚本开始安装

Screenshots of installation:

1) Welcome and thanks for your use

2) Specify location to store all mailboxes. Default is /var/vmail/.  #设置邮件存放路径

3) Choose backend used to store mail accounts. Please choose the one which you’re familiar with. You can manage mail accounts with iRedAdmin, our web-based iRedMail admin panel. #比较喜欢用mysql存储账户信息

4) If you choose to store mail accounts in OpenLDAP, iRedMail installer will ask you two questions about OpenLDAP.

4.1) LDAP suffix.

4.2) Password of LDAP root dn.

5) Set password of MySQL root user. MySQL is used to store data of other applications, e.g. Roundcube webmail, Policyd, Amavisd-new. If you choose to store mail accounts in MySQL, you will see this dialog too. #设置mysql的root密码

6) Add your first mail domain name #输入你的域名

7) Set password of admin account of your first mail domain. Note:

  • This account is used only for system administration, not a mail user. That means you CANNOT login to webmail with this account.
  • You can login to iRedAdmin (web-based iRedMail admin panel) with this account for mail accont management, login name is full email address.
  • Admin username is hard-coded, you can create new admins with iRedAdmin after installation completed.  #设置postmaster的密码。最大权限。

8) Set password of first mail user of your first mail domain. Note:

  • This account is a normal mail user, that means you can login to webmail with this account, login name is full email address.
  • Username is hard-coded, you can create new mail users with iRedAdmin after installation completed.

9) Choose optional components #设置安装的组件

After answered these questions, iRedMail installer will ask your confirm to start installation. It will install and configure required packages automatically. Type ‘y’ or ‘Y’ (without quotes) and press ‘Enter’ to confirm.

Configuration completed. ************************************************************************* **************************** WARNING *********************************** ************************************************************************* * * * Please do remember to *REMOVE* configuration file after installation * * completed successfully. * * * * * /root/iRedMail-x.y.z/config * * ************************************************************************* <<< iRedMail >>> Continue? [Y|n] # <- Type 'Y' or 'y' here, and press 'Enter' to continue 

Important things you should know after installation

  • Read file /root/iRedMail-x.y.z/ first, it contains:
    • URLs, usernames and passwords of web-based applications
    • Location of mail serve related software configuration files
    • Some other important and/or sensitive information
  • Setup DNS record for SPF     #设置dns的spf记录
  • Setup DNS record for DKIM #设置dkim电子邮件验证标准

Access webmail and other web applications

After installation successfully completed, you can access web-based programs if you choose to install them. Replace ‘your_server’ below by your actual server name or IP address.

Component URL Accessible via HTTP Accessible via HTTPS
Webmail http://your_server/mail/ (or /webmail, /roundcube)
iRedAdmin (admin panel) httpS://your_server/iredadmin/
phpMyAdmin httpS://your_server/phpmyadmin/
phpLDAPadmin httpS://your_server/phpldapadmin/
Awstats httpS://your_server/awstats/ (or ?config=smtp)



专注于 服务器运维与web架构