1

Topic: iRedMail Pre-Installed VPS

==== Required information ====
- iRedMail version: Current
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: CentOS 6
====

I'm curious if there's a way to do like an OEM install on a VPS? I own a VPS company and I would like to make an image pre-built with iRedAdmin ready to use. Problem being that when you install it, you're asked for hostname and a few other things default for that server.

Can anyone help me come up with an idea to pre-setup iRedAdmin on a VPS image ready for the user to install then easily change main hostname and account? Thanks.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: iRedMail Pre-Installed VPS

*) Check file iRedMail-x.y.z/config after iRedMail installation, it's generated during installation wizard. iRedMail will detect whether this file exists before showing you configuration wizard (ask for first mail domain, mysql root password, etc), if it exists, iRedMail asks you whether to use it directly or generating a new one.

*) You can write a shell script to perform some after-install tasks if necessary, like updating hostname for new VPS.

Here's how i preform iRedMail test daily with VMware Fusion, all are completed with a shell script and VMware command line tool "vmrun" and "scp", "ssh". Hope it helps.

*) Install a clean, basic/minimal OS (Debian/CentOS/openSUSE/OpenBSD/etc), set proper hostname, then create snapshot.
*) Revert VM to the latest snapshot (a clean, basic, minimal OS) with "vmrun".
*) Start this VM with "vmrun", sleep 30 (or 60) seconds waiting for OS start up.
*) Detect network connection to this VM, if it's up, upload required files with "scp": The latest development edition of iRedMail, source tarballs required by iRedMail (Roundcube, iRedAdmin, iRedAPD, etc), the downloaded Debian/CentOS/openSUSE/OpenBSD binary packages, etc. The most important one is a prepared iRedMail config file: iRedMail-x.y.z/config.
*) Create/Update iRedMail installation status file: iRedMail-x.y.z/.status to skip downloading source tarballs, etc.
*) Perform installation via ssh like this:

ssh root@[SERVER] "cd /root/iRedMail/ && IREDMAIL_DEBUG='NO' AUTO_USE_EXISTING_CONFIG_FILE=y AUTO_INSTALL_WITHOUT_CONFIRM=y AUTO_CLEANUP_REMOVE_SENDMAIL=y AUTO_CLEANUP_REMOVE_MOD_PYTHON=y AUTO_CLEANUP_REPLACE_FIREWALL_RULES=y AUTO_CLEANUP_RESTART_IPTABLES=y AUTO_CLEANUP_REPLACE_MYSQL_CONFIG=y AUTO_CLEANUP_RESTART_POSTFIX=n bash iRedMail.sh "

*) Perform after-installation tasks: upload downloaded ClamAV database, ..., reboot server.

It should be finished in 2-3 minutes (uploading binary packages takes most time), then i got a working iRedMail server. I do this many times everyday.

I have 4 prepared iRedMail config files for different backends: OpenLDAP, MySQL, PostgreSQL, ldapd (OpenBSD only). i run my script with an option to install iRedMail with specified backend like below, the script will upload proper config file to server:

# bash my_script.sh ldap
# bash my_script.sh mysql
# bash my_script.sh pgsql
# bash my_script.sh ldapd

3

Re: iRedMail Pre-Installed VPS

That's awesome! Never knew I could do that with the iRed install. Thanks, going to set it up this week and give it a try smile