<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://iredmail.org/wiki/skins/common/feed.css?207"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>Install/iRedAdmin-Pro/MySQL/Debian/OLD - Revision history</title>
		<link>http://iredmail.org/wiki/index.php?title=Install/iRedAdmin-Pro/MySQL/Debian/OLD&amp;action=history</link>
		<description>Revision history for this page on the wiki</description>
		<language>en</language>
		<generator>MediaWiki 1.15.5</generator>
		<lastBuildDate>Thu, 23 May 2013 00:54:49 GMT</lastBuildDate>
		<item>
			<title>ZhangHuangbin:&amp;#32;Created page with '= Summary = * This installation guide is used to install iRedAdmin-Pro-MySQL on Debian 5.x, Ubuntu 8.x, 9.x, 10.x. * iRedAdmin-Pro is official web-based admin panel for iRedMail.…'</title>
			<link>http://iredmail.org/wiki/index.php?title=Install/iRedAdmin-Pro/MySQL/Debian/OLD&amp;diff=2008&amp;oldid=prev</link>
			<description>&lt;p&gt;Created page with &amp;#39;= Summary = * This installation guide is used to install iRedAdmin-Pro-MySQL on Debian 5.x, Ubuntu 8.x, 9.x, 10.x. * iRedAdmin-Pro is official web-based admin panel for iRedMail.…&amp;#39;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Summary =&lt;br /&gt;
* This installation guide is used to install iRedAdmin-Pro-MySQL on Debian 5.x, Ubuntu 8.x, 9.x, 10.x.&lt;br /&gt;
* iRedAdmin-Pro is official web-based admin panel for iRedMail. There're two editions:&lt;br /&gt;
** '''iRedAdmin-Pro-LDAP''': works with OpenLDAP backend.&lt;br /&gt;
** '''iRedAdmin-Pro-MySQL''': works with MySQL backend.&lt;br /&gt;
* [[Release.Notes/iRedAdmin-Pro/MySQL/1.0 |Release Notes of iRedAdmin-Pro-MySQL-1.0]]&lt;br /&gt;
&lt;br /&gt;
= System requirements =&lt;br /&gt;
* iRedMail-0.6.0 and newer versions. '''Note''': addition update is required. We will cover it below.&lt;br /&gt;
* Packages:&lt;br /&gt;
** '''Apache''', 2.2+. Web server.&lt;br /&gt;
*** '''mod_wsgi''' 2.1+. Apache module used to host Python application which supports the Python WSGI interface.&lt;br /&gt;
** '''Python''' 2.4+, core programming language. Warning: Python 3.x is not supported yet.&lt;br /&gt;
** '''Web.py''', 0.32+. A python-powered web framework.&lt;br /&gt;
*** '''MySQLdb'''. A thread-compatible interface to the popular MySQL database server that provides the Python database API.&lt;br /&gt;
&lt;br /&gt;
= Update iRedMail =&lt;br /&gt;
Addition update is required to use iRedAdmin-Pro-MySQL, please follow links to apply them.&lt;br /&gt;
&lt;br /&gt;
* '''[This step is required for iRedMail-0.6.1 and earlier versions]''' Update MySQL database '''vmail'''. Required by iRedAdmin-Pro.&lt;br /&gt;
{{cmd|&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mysql -u root -p&lt;br /&gt;
mysql&amp;gt; USE vmail;&lt;br /&gt;
&lt;br /&gt;
mysql&amp;gt; ALTER TABLE mailbox ADD COLUMN enablesmtpsecured TINYINT(1) NOT NULL DEFAULT '1';&lt;br /&gt;
mysql&amp;gt; ALTER TABLE admin ADD COLUMN name VARCHAR(255) DEFAULT '' COLLATE utf8_general_ci;&lt;br /&gt;
mysql&amp;gt; ALTER TABLE alias ADD COLUMN name VARCHAR(255) DEFAULT '' COLLATE utf8_general_ci;&lt;br /&gt;
mysql&amp;gt; ALTER TABLE domain ADD COLUMN defaultuseraliases TEXT NOT NULL DEFAULT '';&lt;br /&gt;
mysql&amp;gt; ALTER TABLE domain ADD COLUMN defaultpasswordscheme VARCHAR(10) NOT NULL DEFAULT '';&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* Upgrade Dovecot from 1.1.x to 1.2, so that iRedAdmin-Pro can show real-time quota usage.&lt;br /&gt;
** '''[This step is required for iRedMail-0.6.1 and earlier versions]''' [[iRedMail/FAQ/Upgrade.Dovecot.1.1.to.1.2 |Upgrade Dovecot 1.1.x to 1.2.x]]&lt;br /&gt;
** [[iRedMail/FAQ/Store.Realtime.Quota.In.MySQL |Store Real-time Quota in MySQL with Dovecot 1.2]]&lt;br /&gt;
&lt;br /&gt;
* If you want to quarnatine SPAM into MySQL, then manage (delete, release) them in iRedAdmin-Pro, below update is required.&lt;br /&gt;
** [[iRedMail/FAQ/Quarantining.Messages |Quarantining SPAM into MySQL with Amavisd]]&lt;br /&gt;
&lt;br /&gt;
= Add new system account: iredadmin =&lt;br /&gt;
&lt;br /&gt;
We will make iRedAdmin run with Apache web server, but as non-apache, low privilege user: '''iredadmin'''.&lt;br /&gt;
{{cmd|&amp;lt;pre&amp;gt;&lt;br /&gt;
# useradd -m -s /sbin/nologin -d /home/iredadmin iredadmin&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
= Install necessary packages =&lt;br /&gt;
&lt;br /&gt;
* Install binary packages as dependences, used for building python modules.&lt;br /&gt;
{{cmd|&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo apt-get install gcc python-setuptools python-dev \&lt;br /&gt;
                        libldap2-dev libmysqlclient15-dev \&lt;br /&gt;
                        libsasl2-dev libssl-dev \&lt;br /&gt;
                        libapache2-mod-wsgi \&lt;br /&gt;
                        python-mysqldb&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* Install required python modules.&lt;br /&gt;
{{cmd|&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo easy_install web.py Jinja2 netifaces DBUtils&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
= Download iRedAdmin and configure Apache web server =&lt;br /&gt;
&lt;br /&gt;
* Get iRedAdmin:&lt;br /&gt;
** If you purchased iRedAdmin-Pro-MySQL, you should already have it. If not, please mail to '''support@ iredmail.org''' to get a download link.&lt;br /&gt;
** If you didn't purchase iRedAdmin-Pro-MySQL, download iRedAdmin open source edition from [http://www.iredmail.org/download.html#iredadmin download page].&lt;br /&gt;
&lt;br /&gt;
* Copy iRedAdmin to /usr/share/apache2/, set correct file permissions, and create symbol link.&lt;br /&gt;
{{cmd|&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo tar xjf iRedAdmin-x.y.z.tar.bz2 -C /usr/share/apache2/&lt;br /&gt;
$ cd /usr/share/apache2/&lt;br /&gt;
$ sudo chown -R iredadmin:iredadmin iRedAdmin-x.y.z&lt;br /&gt;
$ sudo chmod -R 0755 iRedAdmin-x.y.z&lt;br /&gt;
$ sudo ln -s iRedAdmin-x.y.z iredadmin&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* Add apache configure file: /etc/apache2/conf.d/iredadmin.conf.&lt;br /&gt;
{{cfg|/etc/apache2/conf.d/iredadmin.conf|&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# Note: Uncomment below two lines if you want to make iRedAdmin accessable via HTTP.&lt;br /&gt;
#&lt;br /&gt;
#WSGIScriptAlias /iredadmin /usr/share/apache2/iredadmin/iredadmin.py/&lt;br /&gt;
#Alias /iredadmin/static /usr/share/apache2/iredadmin/static/&lt;br /&gt;
&lt;br /&gt;
WSGISocketPrefix /var/run/wsgi&lt;br /&gt;
WSGIDaemonProcess iredadmin user=iredadmin threads=15&lt;br /&gt;
WSGIProcessGroup iredadmin&lt;br /&gt;
&lt;br /&gt;
AddType text/html .py&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Directory /usr/share/apache2/iredadmin/&amp;gt;&lt;br /&gt;
    Order deny,allow&lt;br /&gt;
    Allow from all&lt;br /&gt;
&amp;lt;/Directory&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* Edit /etc/apache2/sites-enabled/default-ssl, make iredadmin accessable via HTTPS. Add below lines before &amp;lt;/VirtualHost&amp;gt;:&lt;br /&gt;
{{cfg|/etc/apache2/sites-enabled/default-ssl|&amp;lt;pre&amp;gt;&lt;br /&gt;
WSGIScriptAlias /iredadmin /usr/share/apache2/iredadmin/iredadmin.py/&lt;br /&gt;
Alias /iredadmin/static /usr/share/apache2/iredadmin/static/&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* Enable mod_wsgi module and restart apache to make it work:&lt;br /&gt;
{{cmd|&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo a2enmod *wsgi&lt;br /&gt;
$ sudo /etc/init.d/apache2 restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
= Create necessary MySQL database and grant privileges =&lt;br /&gt;
* Create MySQL database: iredadmin. Used to store sessions, admin operation logs, etc.&lt;br /&gt;
{{cmd|&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mysql -uroot -p&lt;br /&gt;
mysql&amp;gt; CREATE DATABASE iredadmin DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;&lt;br /&gt;
mysql&amp;gt; USE iredadmin;&lt;br /&gt;
mysql&amp;gt; SOURCE /usr/share/apache2/iredadmin/docs/samples/iredadmin.sql;&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* Grant privileges to iredadmin user and set password for it.&lt;br /&gt;
&lt;br /&gt;
'''WARNING''': Here we use 'secret_passwd' as password of iredadmin user, please replace it with your own password.&lt;br /&gt;
&lt;br /&gt;
{{cmd|&amp;lt;pre&amp;gt;&lt;br /&gt;
$ mysql -uroot -p&lt;br /&gt;
mysql&amp;gt; GRANT SELECT,INSERT,UPDATE,DELETE ON iredadmin.* TO iredadmin@localhost IDENTIFIED BY 'secret_passwd';&lt;br /&gt;
mysql&amp;gt; FLUSH PRIVILEGES;&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
= Configure iRedAdmin =&lt;br /&gt;
&lt;br /&gt;
* Copy example config file, and make it not world-writeable.&lt;br /&gt;
{{cmd|&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /usr/share/apache2/iredadmin/&lt;br /&gt;
$ cp settings.ini.mysql.sample settings.ini&lt;br /&gt;
# chown iredadmin:iredadmin settings.ini&lt;br /&gt;
# chmod 0600 settings.ini&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* Edit settings.ini and set correct values.&lt;br /&gt;
** '''NOTE''': For more inforamtion, please open '''settings.ini''', it's self-documented.&lt;br /&gt;
{{cfg|settings.ini|&amp;lt;pre&amp;gt;&lt;br /&gt;
[general]&lt;br /&gt;
# General settings ...&lt;br /&gt;
&lt;br /&gt;
[iredadmin]&lt;br /&gt;
# Database &amp;quot;iredadmin&amp;quot;. required by iRedAdmin.&lt;br /&gt;
&lt;br /&gt;
[vmaildb]&lt;br /&gt;
# Database &amp;quot;vmail&amp;quot;, stored all mail accounts.&lt;br /&gt;
&lt;br /&gt;
[policyd]&lt;br /&gt;
# Database &amp;quot;policyd&amp;quot;. Required for policyd integration.&lt;br /&gt;
&lt;br /&gt;
[amavisd]&lt;br /&gt;
# Database &amp;quot;amavisd&amp;quot;. Required for Amavisd-New integration. includes spam quarantining/releasing.&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* Restart apache web server.&lt;br /&gt;
{{cmd|&amp;lt;pre&amp;gt;&lt;br /&gt;
# /etc/init.d/apache2 restart&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
* Open your web browser to access iRedAdmin: https://your_server_ip_address/iredadmin/&lt;br /&gt;
** '''NOTE''': Make sure you use HTTPS:// instead of HTTP://.&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
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.&lt;br /&gt;
{{cfg|settings.ini|&amp;lt;pre&amp;gt;&lt;br /&gt;
[general]&lt;br /&gt;
debug = True&lt;br /&gt;
&amp;lt;/pre&amp;gt;}}&lt;/div&gt;</description>
			<pubDate>Sun, 06 May 2012 00:25:45 GMT</pubDate>			<dc:creator>ZhangHuangbin</dc:creator>			<comments>http://iredmail.org/wiki/index.php?title=Talk:Install/iRedAdmin-Pro/MySQL/Debian/OLD</comments>		</item>
	</channel>
</rss>