Addition/Secure.Your.Exist.iRedAdmin

From iRedMail
(Difference between revisions)
Jump to: navigation, search
 

Latest revision as of 17:31, 11 October 2013

Contents



WARNING: IREDMAIL HAS THIS AS DEFAULT SETTING, YOU DO NOT NEED THIS TUTORIAL AT ALL.


If you already have iRedAdmin installed, either iRedAdmin-Pro or open source edition, you can simply secure it by following below tutorial.

[edit] Create a new system account

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

Terminal:
#
# ---- On Linux ----
# 
# useradd -s /sbin/nologin -m -d /home/iredadmin iredadmin

#
# ---- On FreeBSD ----
#
# pw useradd -s /sbin/nologin -d /home/iredadmin -m -n iredadmin

Note: Don't forget to use -m flag to create HOME directory, otherwise apache can't chroot process to this directory.

[edit] Configure Apache

Edit Apache config file of iRedAdmin, make iRedAdmin run as user 'iredadmin'. File localtion on different distributions:

  • RHEL/CentOS: /etc/httpd/conf.d/iredadmin.conf
  • Debian/Ubuntu: /etc/apache2/conf.d/iredadmin.conf
  • FreeBSD: /usr/local/etc/apache22/Includes/iredadmin.conf
File: iredadmin.conf
WSGISocketPrefix /var/run/wsgi
WSGIDaemonProcess iredadmin user=iredadmin threads=15
WSGIProcessGroup iredadmin

[edit] Change file permissions

Change current directory to apache server root directory:

Terminal:
#
# ---- On RHEL/CentOS ----
#
# cd /var/www/

#
# ---- On Debian/Ubuntu ----
#
# cd /usr/share/apache2/

#
# ---- On FreeBSD ----
#
# cd /usr/local/www/

Change file permissions:

Terminal:
# chown -R iredadmin:iredadmin iRedAdmin-x.y.z
# chmod -R 0755 iRedAdmin-x.y.z
# chmod 0600 iRedAdmin-x.y.z/settings.ini

[edit] Restart Apache

Restart Apache to make changes work.

[edit] Verify it

On Linux/OpenBSD, you can simply use top -u iredadmin command to verify it. On FreeBSD, please use top -Uiredadmin instead.

Terminal:
#
# ---- Sample output ----
#
# top -u iredadmin
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                        
 3978 iredadmi  25   0  458m 7052 1028 S  0.0  1.4   0:00.00 httpd

[edit] Credits

We'd like to thank supanji12@YouTube for his/her great video tutorial: http://www.youtube.com/watch?v=o285XYJTGQw

Personal tools