Most of the software is included in your Linux distribution. SuSE is shipping Cyrus as far as I know since 7.1. Since SuSE 8.1, cyrus-imap 2.1 and sasl2 is included, but not yet tested for this setup.
Redhat ships no cyrus-IMAP, but sasl1 is included (useless for this setup)
Origin-Site: http://www.mysql.com/downloads/
cd /usr/local tar -xvzf mysql-3.23.53.tar.gz cd mysql-3.23.53 ./configure \ --prefix=/usr/local/mysql \ --enable-assembler \ --with-innodb make make install /usr/local/mysql/bin/mysql_install_db echo /usr/local/mysql/lib/mysql >> /etc/ld.so.conf ldconfig ln -s /usr/local/mysql/include/mysql /usr/include/mysql ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql |
For security-improvement add a mysql-user on your system i.e. "mysql", then
chown -R mysql /usr/local/mysql/var |
and change the line user=root to user=mysql in the file /usr/local/mysql/bin/safe_mysqld
you may wish to start mysql automatically at boottime, copy /usr/local/mysql/share/mysql/mysql.server to /etc/init.d/ for SuSE, for Redhat it is /etc/rc.d/init.d instead of /etc/init.d/. Further you need to add Symlinks to /etc/init.d/rc3.d for SuSE and /etc/rc.d/rc3.d
The following example is for SuSE Linux and should be easily changed for Redhat and other Linux distributions and commercial Unixes.
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/ ln -s /etc/init.d/mysql.server /etc/init.d/rc3.d/S20mysql ln -s /etc/init.d/mysql.server /etc/init.d/rc3.d/k08mysql |
The Berkeley DB is a requirement for building Cyrus-SASL and Cyrus-IMAP. Some Systems comes with recent versions but without the header files installed. Please see your distributors CD/DVD to check if you can install the header files from a package.
The version that comes with GNU/Debian Linux is out of Date, you will need to compile most recent version instead. If you already installed Berkely DB on your Debian Box, please fist uninstall the software to prevent conflicts.
It is also very important, that Cyrus-SASL and Cyrus-IMAP is compiled with the same version of Berkely DB of else you can run into problems
cd dist ./configure --prefix=/usr/local/bdb make make install echo /usr/local/bdb/lib >> /etc/ld.so.conf ldconfig |
Building Cyrus SASL and IMAP from source is not a easy task. There are some prerequisites to be fulfilled, and lots of difficult authentication related stuff to be considered.
Origin-Site: ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.9.tar.gz
Origin-Site: ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-imapd-2.1.9.tar.gz
tar -xvzf cyrus-sasl-2.1.9.tar.gz cd cyrus-sasl-2.1.9 ./configure \ --enable-anon \ --enable-plain \ --enable-login \ --disable-krb4 \ --with-saslauthd=/var/run/saslauthd \ --with-pam \ --with-dblib=berkeley \ --with-bdb-libdir=/usr/local/bdb/lib \ --with-bdb-incdir=/usr/local/bdb/include \ --with-openssl-dir=/usr/local/ssl \ --with-plugindir=/usr/local/lib/sasl2 make make install mkdir -p /var/run/saslauthd cd saslauthd make testsaslauthd cp testsaslauthd /usr/local/bin ldconfig |
The SASL library is installed in /usr/local/lib/sasl2 but some programs are expecting SASL in /usr/lib/sasl2. So it is a good idea to create a symlink: ln -s /usr/local/lib/sasl2 /usr/lib/sasl2.
The testsaslauthd program allows you to test the saslauthd, description follows later.
tar -xvzf cyrus-imapd-2.1.9.tar.gz cd cyrus-imapd-2.1.9 export CPPFLAGS="-I/usr/include/et" ./configure \ --with-sasl=/usr/local/lib \ --with-perl \ --with-auth=unix \ --with-openssl=/usr/local/ssl \ --without-ucdsnmp make depend make make install |
If you wish to start the Cyrus IMAP daemon automatically after booting, you need a startupscript. Place the following script in /etc/init.d/ for Redhat it is /etc/rc.d/init.d instead of /etc/init.d/.
#!/bin/bash # # Cyrus startup script case "$1" in start) # Starting SASL saslauthdaemon /usr/local/sbin/saslauthd -a pam& # Starting Cyrus IMAP Server /usr/cyrus/bin/master & ;; stop) # Stopping SASL saslauthdaemon killall saslauthd # Stopping Cyrus IMAP Server killall /usr/cyrus/bin/master ;; *) echo "Usage: $0 {start|stop}" exit 1 ;; esac |
If I get the time, I'll provide a more sophisticated script, but this script works
Now create the Symlinks in the runlevel directory (SuSE):
ln -s /etc/init.d/cyrus /etc/init.d/rc3.d/S20 ln -s /etc/init.d/cyrus /etc/init.d/rc3.d/K10 |
For Redhat:
ln -s /etc/rc.d/init.d/cyrus /etc/rc.d/rc3.d/S20cyrus ln -s /etc/rc.d/init.d/cyrus /etc/rc.d/rc3.d/K10cyrus |
Attn the distributors: W H E N will all distributors use the same paths for the init script? thanks!
Origin-Site: http://www.postfix.org/ftp-sites.html
If you want to use SMTP authentication, you need to download the latest snapshot release, version 1.1.11 does NOT work with sasl2. Use 1.1.11-20020928 or newer.
Before you can build and install postfix you have to be sure a »postfix« and a »postdrop« groups and users exists on the System. First check for the groups. You can check this by grep postfix /etc/group and grep maildrop /etc/group
If there are no such groups and users, you just create them. Search for a free nummeric UID and GID. In the following example I will use UID and GID 33333 for Postfix and 33335 for the maildrop UID and GID. This ID's are corresponding to other documents.
groupadd -g 33333 postfix groupadd -g 33335 postdrop useradd -u 33333 -g 33333 -d /dev/null -s /bin/false postfix |
The following screen shows what you have to do, if you installed MySQL from source as described above. If you installed MySQL from a binary package such as rpm or deb, then you have to change the include and library-flags to -I/usr/include/mysql and -L/usr/lib/mysql.
tar -xvzf postfix-1.1.11-20020928.tar.gz cd postfix-1.1.11-20020928 make makefiles 'CCARGS=-DHAS_MYSQL \ -I/usr/local/mysql/include/mysql -DUSE_SASL_AUTH \ -I/usr/local/include/sasl' 'AUXLIBS=-L/usr/local/mysql/lib/mysql \ -lmysqlclient -lz -lm -L/usr/local/lib -lsasl2' make make install |
During make install a few question are asked. Just pressing Enter should match your needs. For Redhat users it could be useful to enter /usr/local/share/man
If you compiled MySQL by yourself, you need to create a symlink to the MySQL includes and libraries
Additionally there is a bug in the Makefile which you need to correct. Edit the file and replace as follow:
old: export LD_D=gcc -shared -Xlinker -x -L/usr/lib/mysql new: export LD_D=gcc -shared -Xlinker -x -L/usr/lib/mysql -lz |
After customizing that file go ahead with compiling pam_mysql
tar -xvzf pam_mysql-0.4.7.tar.gz cd pam_mysql make cp pam_mysql.so /lib/security ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock |
Origin-Site: http://www.web-cyradm.org
Web-cyradm is written in PHP. If you don't have a webserver with php installed, I like to refer to my Apache-Compile-HOWTO. That document describes how to set up Apache with PHP and other modules
I M P O R T A N T : Since web-cyradm is under heavy development, it maybe does not work properly with PHP 4.2.1 or newer. Please edit your /usr/local/lib/php.ini and set »register_globals=On« to be sure it works. please report any bugs to web-cyradm at test.delouw.ch (after subscribing the list).
Since web-cyradm uses PEAR for its database abstraction, you will also need a recent copy of PEAR. This is included in recent PHP Versions. I strongly suggest to update PHP anyway to 4.2.3 because a lot of important bugs have been fixed.
An often error done is to forget to touch the logfile and change the owner to the UID that Apache use. This is usually »nobody« or »wwwrun«.
cd /usr/local/apache/htdocs tar -xvzf web-cyradm-0.5.1.tar.gz touch /var/log/web-cyradm.log chown nobody /var/log/web-cyradm.log |
After unpacking web-cyradm move it to a place in your webservers DocumentRoot
This is all, now we need to configure the whole bunch of software