Install/iRedAdmin-Pro/MySQL/RHEL

From iRedMail

(Difference between revisions)
Jump to: navigation, search
(Update iRedMail)
(System requirements)
 
(11 intermediate revisions not shown)
Line 1: Line 1:
 +
__TOC__
 +
 +
If you already have iRedAdmin open source edition installed, you can migrate from iRedAdmin open source edition to iRedAdmin-Pro with just few steps:
 +
* [[Migrate/iRedAdmin-Pro/OSE-Pro |Migrate from iRedAdmin open source edition to iRedAdmin-Pro]]
 +
 +
= Summary =
 +
* This installation guide is used to install iRedAdmin-Pro-MySQL on Red Hat Enterprise Linux, CentOS, Scientific Linux. Both 5.x and 6.x are supported.
 +
* iRedAdmin-Pro is official web-based admin panel for iRedMail. There're three editions available:
 +
** '''iRedAdmin-Pro-LDAP''': works with OpenLDAP backend.
 +
** '''iRedAdmin-Pro-MySQL''': works with MySQL backend.
 +
** '''iRedAdmin-Pro-PGSQL''': works with PostgreSQL backend.
 +
= System requirements =
= System requirements =
-
* iRedMail-0.6.0 and newer versions. '''Note''': addition update is required. We will cover it below.
+
* iRedMail-0.8.0 or later releases. If you're looking for installation guide for iRedMail-0.7.4 or eailier releases, please go to [[Install/iRedAdmin-Pro/MySQL/RHEL/OLD |this tutorial]] instead.
-
* Packages:
+
* iRedAdmin-Pro-MySQL-1.3.0 or later releases.
 +
 
 +
* Required Packages. They all are installed automatically during iRedMail installation.
** '''Apache''', 2.2+. Web server.
** '''Apache''', 2.2+. Web server.
*** '''mod_wsgi''' 2.1+. Apache module used to host Python application which supports the Python WSGI interface.
*** '''mod_wsgi''' 2.1+. Apache module used to host Python application which supports the Python WSGI interface.
** '''Python''' 2.4+, core programming language. Warning: Python 3.x is not supported yet.
** '''Python''' 2.4+, core programming language. Warning: Python 3.x is not supported yet.
-
** '''Web.py''', 0.32+. A python-powered web framework.
+
*** '''Web.py''', 0.32+. A python-powered web framework.
*** '''MySQLdb'''. A thread-compatible interface to the popular MySQL database server that provides the Python database API.
*** '''MySQLdb'''. A thread-compatible interface to the popular MySQL database server that provides the Python database API.
-
= Update iRedMail =
+
iRedAdmin will run with a low-privileged system user: iredadmin, which is created automatically during iRedMail installation, too.
-
Addition update is required to use iRedAdmin-Pro-MySQL, please follow links to apply them.
+
-
 
+
-
* Update MySQL database '''vmail'''. Required by iRedAdmin-Pro.
+
-
{{cmd|<pre>
+
-
$ mysql -u root -p
+
-
mysql> USE vmail;
+
-
 
+
-
mysql> ALTER TABLE mailbox ADD COLUMN enablesmtpsecured TINYINT(1) NOT NULL DEFAULT '1';
+
-
mysql> ALTER TABLE admin ADD COLUMN name VARCHAR(255) DEFAULT '' COLLATE utf8_general_ci;
+
-
mysql> ALTER TABLE alias ADD COLUMN name VARCHAR(255) DEFAULT '' COLLATE utf8_general_ci;
+
-
mysql> ALTER TABLE domain ADD COLUMN defaultuseraliases TEXT NOT NULL DEFAULT '';
+
-
</pre>}}
+
-
 
+
-
* Upgrade Dovecot from 1.1.x to 1.2, so that iRedAdmin-Pro can show real-time quota usage. If you don't need this feature, just skip it. No addition configure is required in iRedAdmin-Pro.
+
-
** [[iRedMail/FAQ/Upgrade.Dovecot.1.1.to.1.2 |Upgrade Dovecot 1.1.x to 1.2.x]]
+
-
** [[iRedMail/FAQ/Store.Realtime.Quota.In.MySQL |Store Real-time Quota in MySQL with Dovecot 1.2]]
+
-
 
+
-
* If you want to quarnatine SPAM into MySQL, then manage (delete, release) them in iRedAdmin-Pro, below update is required.
+
-
** [[iRedMail/FAQ/Quarantining.Messages |Quarantining SPAM into MySQL with Amavisd]]
+
-
 
+
-
= Add new system account: iredadmin =
+
-
 
+
-
We will make iRedAdmin run with Apache web server, but as non-apache, low privilege user: '''iredadmin'''.
+
-
{{cmd|<pre>
+
-
# useradd -s /sbin/nologin -m -d /home/iredadmin iredadmin
+
-
</pre>}}
+
-
 
+
-
= Install necessary packages =
+
-
 
+
-
* Make sure you have iRedMail yum repository configured: /etc/yum.repos.d/iRedMail.repo.
+
-
{{cfg|/etc/yum.repos.d/iRedMail.repo|<pre>
+
-
[iRedMail]
+
-
name=iRedMail
+
-
baseurl=http://iredmail.org/yum/rpms/5/
+
-
enabled=1
+
-
gpgcheck=0
+
-
priority=1
+
-
</pre>}}
+
-
 
+
-
* Install necessary packages.
+
-
{{cmd|<pre>
+
-
# ---- For i386 ----
+
-
# yum install python-webpy python-jinja2 MySQL-python mod_wsgi
+
-
 
+
-
# ---- For x86_64 ----
+
-
# yum install MySQL-python.x86_64 python-webpy.noarch python-jinja2.x86_64 mod_wsgi.x86_64
+
-
</pre>}}
+
= Download iRedAdmin and configure Apache web server =
= Download iRedAdmin and configure Apache web server =
Line 73: Line 40:
* Add apache configure file: /etc/httpd/conf.d/iredadmin.conf.
* Add apache configure file: /etc/httpd/conf.d/iredadmin.conf.
{{cfg|/etc/httpd/conf.d/iredadmin.conf|<pre>
{{cfg|/etc/httpd/conf.d/iredadmin.conf|<pre>
-
#
 
-
# Note: Uncomment below two lines if you want to make iRedAdmin accessable via HTTP.
 
-
#
 
-
#WSGIScriptAlias /iredadmin /var/www/iredadmin/iredadmin.py/
 
-
#Alias /iredadmin/static /var/www/iredadmin/static/
 
-
 
WSGISocketPrefix /var/run/wsgi
WSGISocketPrefix /var/run/wsgi
WSGIDaemonProcess iredadmin user=iredadmin threads=15
WSGIDaemonProcess iredadmin user=iredadmin threads=15
Line 114: Line 75:
* Grant privileges to iredadmin user and set password for it.
* Grant privileges to iredadmin user and set password for it.
-
'''WARNING''': Here we use 'secret_passwd' as password of iredadmin user, please replace it with your own password.
+
'''WARNING''': Here we use 'plain_passwd' as password of iredadmin user, please replace it with your own password.
{{cmd|<pre>
{{cmd|<pre>
# mysql -uroot -p
# mysql -uroot -p
-
mysql> GRANT SELECT,INSERT,UPDATE,DELETE ON iredadmin.* TO iredadmin@localhost IDENTIFIED BY 'secret_passwd';
+
mysql> GRANT SELECT,INSERT,UPDATE,DELETE ON iredadmin.* TO iredadmin@localhost IDENTIFIED BY 'plain_passwd';
mysql> FLUSH PRIVILEGES;
mysql> FLUSH PRIVILEGES;
</pre>}}
</pre>}}
= Configure iRedAdmin =
= Configure iRedAdmin =
 +
 +
The major config file of iRedAdmin is file '''/var/www/iredadmin/settings.ini'''.
* Copy example config file, and set correct file permission.
* Copy example config file, and set correct file permission.
{{cmd|<pre>
{{cmd|<pre>
# cd /var/www/iredadmin/
# cd /var/www/iredadmin/
-
# cp settings.ini.ldap.sample settings.ini
+
# cp settings.ini.mysql.sample settings.ini
# chown iredadmin:iredadmin settings.ini
# chown iredadmin:iredadmin settings.ini
-
# chmod 0600 settings.ini
+
# chmod 0400 settings.ini
</pre>}}
</pre>}}
-
* Edit settings.ini and set several variables.
+
 
-
** '''NOTE''': For more inforamtion, please open '''settings.ini''', it's self-documented.
+
'''NOTE''': If you are installing iRedAdmin-Pro, and have iRedAdmin open source edition installed, you can simply copy '''settings.ini''' from open source edition. Don't forget to set correct file owner and permission after copied.
 +
 
 +
 
 +
* Edit '''settings.ini'''.
 +
 
 +
'''NOTE''':
 +
** All required usernames/passwords are stored in '''iRedMail.tips''' which generated during iRedMail installation, placed under iRedMail directory. e.g. /root/iRedMail-0.8.0/iRedMail.tips.
 +
** For more inforamtion, please open '''settings.ini''', it's self-documented.
{{cfg|settings.ini|<pre>
{{cfg|settings.ini|<pre>
[general]
[general]

Current revision as of 03:43, 6 May 2012

Contents


If you already have iRedAdmin open source edition installed, you can migrate from iRedAdmin open source edition to iRedAdmin-Pro with just few steps:

Summary

  • This installation guide is used to install iRedAdmin-Pro-MySQL on Red Hat Enterprise Linux, CentOS, Scientific Linux. Both 5.x and 6.x are supported.
  • iRedAdmin-Pro is official web-based admin panel for iRedMail. There're three editions available:
    • iRedAdmin-Pro-LDAP: works with OpenLDAP backend.
    • iRedAdmin-Pro-MySQL: works with MySQL backend.
    • iRedAdmin-Pro-PGSQL: works with PostgreSQL backend.

System requirements

  • iRedMail-0.8.0 or later releases. If you're looking for installation guide for iRedMail-0.7.4 or eailier releases, please go to this tutorial instead.
  • iRedAdmin-Pro-MySQL-1.3.0 or later releases.
  • Required Packages. They all are installed automatically during iRedMail installation.
    • Apache, 2.2+. Web server.
      • mod_wsgi 2.1+. Apache module used to host Python application which supports the Python WSGI interface.
    • Python 2.4+, core programming language. Warning: Python 3.x is not supported yet.
      • Web.py, 0.32+. A python-powered web framework.
      • MySQLdb. A thread-compatible interface to the popular MySQL database server that provides the Python database API.

iRedAdmin will run with a low-privileged system user: iredadmin, which is created automatically during iRedMail installation, too.

Download iRedAdmin and configure Apache web server

  • Get iRedAdmin:
    • If you purchased iRedAdmin-Pro-MySQL, you should already have it. If not, please mail to support@ iredmail.org to get a download link.
    • If you didn't purchase iRedAdmin-Pro-MySQL, download iRedAdmin open source edition from download page.
  • Copy iRedAdmin to /var/www/, set correct file permissions, and create symbol link.
Terminal:
# tar xjf iRedAdmin-x.y.z.tar.bz2 -C /var/www/
# cd /var/www/
# chown -R iredadmin:iredadmin iRedAdmin-x.y.z
# chmod -R 0755 iRedAdmin-x.y.z
# ln -s iRedAdmin-x.y.z iredadmin
  • Add apache configure file: /etc/httpd/conf.d/iredadmin.conf.
File: /etc/httpd/conf.d/iredadmin.conf
WSGISocketPrefix /var/run/wsgi
WSGIDaemonProcess iredadmin user=iredadmin threads=15
WSGIProcessGroup iredadmin

AddType text/html .py

<Directory /var/www/iredadmin/>
    Order deny,allow
    Allow from all
</Directory>
  • Edit /etc/httpd/conf.d/ssl.conf, make iredadmin accessable via HTTPS. Add below lines before </VirtualHost>:
File: /etc/httpd/conf.d/ssl.conf
WSGIScriptAlias /iredadmin /var/www/iredadmin/iredadmin.py/
Alias /iredadmin/static /var/www/iredadmin/static/
  • Restart apache to enable mod_wsgi:
Terminal:
# /etc/init.d/httpd restart

Create necessary MySQL database and grant privileges

  • Create MySQL database: iredadmin. Used to store sessions, admin operation logs, etc.
Terminal:
# mysql -uroot -p
mysql> CREATE DATABASE iredadmin DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> USE iredadmin;
mysql> SOURCE /var/www/iredadmin/docs/samples/iredadmin.sql;
  • Grant privileges to iredadmin user and set password for it.

WARNING: Here we use 'plain_passwd' as password of iredadmin user, please replace it with your own password.

Terminal:
# mysql -uroot -p
mysql> GRANT SELECT,INSERT,UPDATE,DELETE ON iredadmin.* TO iredadmin@localhost IDENTIFIED BY 'plain_passwd';
mysql> FLUSH PRIVILEGES;

Configure iRedAdmin

The major config file of iRedAdmin is file /var/www/iredadmin/settings.ini.

  • Copy example config file, and set correct file permission.
Terminal:
# cd /var/www/iredadmin/
# cp settings.ini.mysql.sample settings.ini
# chown iredadmin:iredadmin settings.ini
# chmod 0400 settings.ini


NOTE: If you are installing iRedAdmin-Pro, and have iRedAdmin open source edition installed, you can simply copy settings.ini from open source edition. Don't forget to set correct file owner and permission after copied.


  • Edit settings.ini.

NOTE:

    • All required usernames/passwords are stored in iRedMail.tips which generated during iRedMail installation, placed under iRedMail directory. e.g. /root/iRedMail-0.8.0/iRedMail.tips.
    • For more inforamtion, please open settings.ini, it's self-documented.
File: settings.ini
[general]
# General settings ...

[iredadmin]
# Database "iredadmin". required by iRedAdmin.

[vmaildb]
# Database "vmail", stored all mail accounts.

[policyd]
# Database "policyd". Required for policyd integration.

[amavisd]
# Database "amavisd". Required for Amavisd-New integration. includes spam quarantining/releasing.
  • Restart apache web server.
Terminal:
# /etc/init.d/httpd restart

Troubleshooting

If iRedAdmin doesn't work as expected, you can set debug = True in settings.ini to turn on debug mode, restart apache web server, use your favourite web browser to access it again, create a new forum topic and paste error message in forum topic.

File: settings.ini
[general]
debug = True
Personal tools