Install/iRedMail/FreeBSD.Jail

From iRedMail

(Difference between revisions)
Jump to: navigation, search
(Prepare Jail)
(Prepare Jail)
Line 18: Line 18:
* Add below setting in /etc/rc.conf:
* Add below setting in /etc/rc.conf:
{{cfg|/etc/rc.conf|<pre>
{{cfg|/etc/rc.conf|<pre>
 +
# Start ezjail while system start up
 +
ezjail_enable="YES"
 +
 +
# Set security.jail.allow_raw_sockets=1 to allow PostgreSQL initial database.
jail_sysvipc_allow="YES"
jail_sysvipc_allow="YES"
</pre>}}
</pre>}}
Line 34: Line 38:
</pre>}}
</pre>}}
-
* In Jail, update /etc/resolv.conf with valid DNS server address(es).
+
* List all Jails:
-
* In Jail, install bash:
+
{{cmd|<pre>
 +
# jls
 +
  JID  IP Address      Hostname                      Path
 +
    10  172.16.122.244  mx.example.com              /jails/mx.example.com
 +
</pre>}}
 +
 
 +
It shows JID '''10''' of our newly created Jail in the command output, we can now enter this Jail with command '''jexec'''.
 +
{{cmd|<pre>
 +
# jexec 10 sh
 +
</pre>}}
 +
 
 +
* In Jail, update /etc/resolv.conf with valid DNS server address(es). For example:
 +
{{cfg|Jail: /etc/resolv.conf|<pre>
 +
nameserver 172.16.122.2
 +
</pre>}}
 +
 
 +
* In Jail, install binary package '''bash'''. Required by iRedMail.
{{cmd|<pre>
{{cmd|<pre>
-
# pkg_add -r bash-static
+
Jail # pkg_add -r bash-static
</pre>}}
</pre>}}
* Start iRedMail installer with your Jail ip address:
* Start iRedMail installer with your Jail ip address:
{{cmd|<pre>
{{cmd|<pre>
-
# bash
+
Jail # bash
bash # cd /root/iRedMail/
bash # cd /root/iRedMail/
bash # LOCAL_ADDRESS='192.168.1.2' bash iRedMail.sh
bash # LOCAL_ADDRESS='192.168.1.2' bash iRedMail.sh
</pre>}}
</pre>}}

Revision as of 12:14, 26 August 2012

Contents



This is a DRAFT, still working in progress. Don't try it on production server.


Summary

Requirements

  • iRedMail-0.8.2 or later releases.

Prepare Jail

  • Install ezjail:
Terminal:
# cd /usr/ports/sysutils/ezjail/
# make install clean
  • Add below setting in /etc/rc.conf:
File: /etc/rc.conf
# Start ezjail while system start up
ezjail_enable="YES"

# Set security.jail.allow_raw_sockets=1 to allow PostgreSQL initial database.
jail_sysvipc_allow="YES"
  • Reboot system.
Terminal:
# reboot
  • After system start up, create Jail for domain name mx.example.com, bound to internal IP address 172.16.122.244. All files are placed under /jails/mx.example.com:
Terminal:
# ezjail-admin create -r /jails/mx.example.com mx.example.com 172.16.122.244
  • Start Jail.
Terminal:
# /usr/local/etc/rc.d/ezjail restart
  • List all Jails:
Terminal:
# jls
   JID  IP Address      Hostname                      Path
    10  172.16.122.244  mx.example.com              /jails/mx.example.com

It shows JID 10 of our newly created Jail in the command output, we can now enter this Jail with command jexec.

Terminal:
# jexec 10 sh
  • In Jail, update /etc/resolv.conf with valid DNS server address(es). For example:
File: Jail: /etc/resolv.conf
nameserver 172.16.122.2
  • In Jail, install binary package bash. Required by iRedMail.
Terminal:
Jail # pkg_add -r bash-static
  • Start iRedMail installer with your Jail ip address:
Terminal:
Jail # bash
bash # cd /root/iRedMail/
bash # LOCAL_ADDRESS='192.168.1.2' bash iRedMail.sh
Personal tools