Install/iRedAdmin-Pro/PGSQL/FreeBSD

From iRedMail
(Difference between revisions)
Jump to: navigation, search
(Created page with ' __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/iRedAd…')
 
 
Line 82: Line 82:
 
= Configure iRedAdmin =
 
= Configure iRedAdmin =
  
The major config file of iRedAdmin is file '''/usr/local/www/iredadmin/settings.ini'''.
+
The major config file of iRedAdmin is file '''/usr/local/www/iredadmin/settings.py'''.
  
 
* Copy example config file, and set correct file permission.
 
* Copy example config file, and set correct file permission.
 
{{cmd|<pre>
 
{{cmd|<pre>
 
# cd /usr/local/www/iredadmin/
 
# cd /usr/local/www/iredadmin/
# cp settings.ini.pgsql.sample settings.ini
+
# cp settings.py.pgsql.sample settings.py
# chown iredadmin:iredadmin settings.ini
+
# chown iredadmin:iredadmin settings.py
# chmod 0400 settings.ini
+
# chmod 0400 settings.py
 
</pre>}}
 
</pre>}}
  
  
'''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.
+
'''NOTE''': If you are installing iRedAdmin-Pro, and have iRedAdmin open source edition installed, you can simply copy '''settings.py''' from open source edition. Don't forget to set correct file owner and permission after copied.
  
  
* Edit '''settings.ini'''.
+
* Edit '''settings.py'''.
  
 
'''NOTE''':
 
'''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.
 
** 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.
+
** For more inforamtion, please open '''settings.py''', it's self-documented.
{{cfg|settings.ini|<pre>
+
[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.
+
</pre>}}
+
  
 
* Restart apache web server.
 
* Restart apache web server.
Line 127: Line 111:
  
 
= Troubleshooting =
 
= 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.
+
If iRedAdmin doesn't work as expected, you can set '''debug = True''' in settings.py 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.
{{cfg|settings.ini|<pre>
+
{{cfg|settings.py|<pre>
 
[general]
 
[general]
 
debug = True
 
debug = True
 
</pre>}}
 
</pre>}}

Latest revision as of 18:15, 14 May 2014

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:

[edit] Summary

  • This installation guide is used to install iRedAdmin-Pro-PGSQL 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.

[edit] System requirements

  • iRedMail-0.8.0 or later releases.
  • iRedAdmin-Pro-PGSQL-1.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.
      • psycopg2. A interface to the popular PostgreSQL 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.

[edit] Download iRedAdmin and configure Apache web server

  • Get iRedAdmin:
    • If you purchased iRedAdmin-Pro-PGSQL, 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-PGSQL, download iRedAdmin open source edition from download page.
  • Copy iRedAdmin to /usr/local/www/, set correct file permissions, and create symbol link.
Terminal:
# tar xjf iRedAdmin-x.y.z.tar.bz2 -C /usr/local/www/
# cd /usr/local/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: /usr/local/etc/apache22/Includes/iredadmin.conf.
File: /usr/local/etc/apache22/Includes/iredadmin.conf
WSGISocketPrefix /var/run/wsgi
WSGIDaemonProcess iredadmin user=iredadmin threads=15
WSGIProcessGroup iredadmin

AddType text/html .py

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

[edit] Create necessary PostgreSQL database and grant privileges

  1. Create SQL database: iredadmin. Used to store sessions, admin operation logs, etc.
  2. Create SQL user: iredadmin, with password 'plain_password' (without quotes).
  3. Create required SQL tables and grant privileges.
Terminal:
# su - postgres
$ psql
sql> CREATE DATABASE iredadmin WITH TEMPLATE template0 ENCODING 'UTF8';
sql> CREATE ROLE iredadmin WITH LOGIN ENCRYPTED PASSWORD 'plain_password' NOSUPERUSER NOCREATEDB NOCREATEROLE;
sql> \c iredadmin;
sql> \i /usr/local/www/iredadmin/docs/samples/iredadmin.pgsql;
sql> GRANT INSERT,UPDATE,DELETE,SELECT on sessions,log,updatelog to iredadmin;
sql> GRANT UPDATE,USAGE,SELECT ON log_id_seq TO iredadmin;

[edit] Configure iRedAdmin

The major config file of iRedAdmin is file /usr/local/www/iredadmin/settings.py.

  • Copy example config file, and set correct file permission.
Terminal:
# cd /usr/local/www/iredadmin/
# cp settings.py.pgsql.sample settings.py
# chown iredadmin:iredadmin settings.py
# chmod 0400 settings.py


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


  • Edit settings.py.

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.py, it's self-documented.
  • Restart apache web server.
Terminal:
# /usr/local/etc/rc.d/apache22 restart

[edit] Troubleshooting

If iRedAdmin doesn't work as expected, you can set debug = True in settings.py 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.py
[general]
debug = True
Personal tools