Install/iRedAdmin-Pro/MySQL/FreeBSD

From iRedMail

(Difference between revisions)
Jump to: navigation, search
(Install necessary packages)
(Download iRedAdmin and configure Apache web server)
Line 22: Line 22:
= Download iRedAdmin and configure Apache web server =
= 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 [http://www.iredmail.org/download.html#iredadmin download page].
 +
 +
* Copy iRedAdmin to /usr/local/www/, set correct file permissions, and create symbol link.
 +
{{cmd|<pre>
 +
# 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
 +
</pre>}}
 +
 +
* Add apache configure file: /usr/local/etc/apache22/Includes/iredadmin.conf.
 +
{{cfg|/usr/local/etc/apache22/Includes/iredadmin.conf|<pre>
 +
#
 +
# Note: Uncomment below two lines if you want to make iRedAdmin accessable via HTTP.
 +
#
 +
#WSGIScriptAlias /iredadmin /usr/local/www/iredadmin/iredadmin.py/
 +
#Alias /iredadmin/static /usr/local/www/iredadmin/static/
 +
 +
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>
 +
</pre>}}
 +
 +
* Edit /usr/local/etc/apache22/extra/httpd-ssl.conf, make iredadmin accessable via HTTPS. Add below lines before </VirtualHost>:
 +
{{cfg|/usr/local/etc/apache22/extra/httpd-ssl.conf|<pre>
 +
WSGIScriptAlias /iredadmin /usr/local/www/iredadmin/iredadmin.py/
 +
Alias /iredadmin/static /usr/local/www/iredadmin/static/
 +
</pre>}}
 +
 +
* Restart apache to enable mod_wsgi:
 +
{{cmd|<pre>
 +
# /usr/local/etc/rc.d/apache22 restart
 +
</pre>}}
 +
= Create necessary MySQL database and grant privileges =
= Create necessary MySQL database and grant privileges =
= Configure iRedAdmin =
= Configure iRedAdmin =
= Troubleshooting =
= Troubleshooting =

Revision as of 03:31, 29 January 2011

Contents

System requirements

  • Apache, 2.2+. Web server. Already shipped within RHEL/CentOS 5.x.
    • mod_wsgi 2.1+. Apache module used to host Python application which supports the Python WSGI interface.
  • Python 2.4+, core programming language. Already shipped within RHEL/CentOS 5.x. 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.

Add new system account: iredadmin

We will make iRedAdmin run with Apache web server, but as non-apache, low privilege user: iredadmin.

Terminal:
# pw useradd -s /sbin/nologin -d /home/iredadmin -n iredadmin

Install necessary packages

Install several devel binary packages, used for building python modules.

Terminal:
# bash
# for p in www/mod_wsgi www/webpy databases/py-dbutils devel/py-Jinja2 databases/py-MySQLdb net/py-netifaces; do cd /usr/ports/${i} && make install clean; done

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 /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
#
# Note: Uncomment below two lines if you want to make iRedAdmin accessable via HTTP.
#
#WSGIScriptAlias /iredadmin /usr/local/www/iredadmin/iredadmin.py/
#Alias /iredadmin/static /usr/local/www/iredadmin/static/

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

Create necessary MySQL database and grant privileges

Configure iRedAdmin

Troubleshooting

Personal tools