Scalix mit Debian Etch: Unterschied zwischen den Versionen

Aus Neobikers Wiki
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
 
(37 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 8: Zeile 8:
<pre>
<pre>
apt-get install xen-tools
apt-get install xen-tools
vi /etc/xen-tools/xen-tools.conf
</pre>
Konfigdatei '''/etc/xen-tools/xen-tools.conf''':
<pre>
#
#
# ...
# ...
Zeile 19: Zeile 21:
#
#
size  = 4Gb      # Disk image size.
size  = 4Gb      # Disk image size.
memory = 128Mb   # Memory size
memory = 256Mb   # Memory size
swap  = 128Mb   # Swap size
swap  = 512Mb   # Swap size
# noswap = 1      # Don't use swap at all for the new system.
# noswap = 1      # Don't use swap at all for the new system.
fs    = ext3    # use the EXT3 filesystem for the disk image.
fs    = ext3    # use the EXT3 filesystem for the disk image.
dist  = etch    # Default distribution to install.
dist  = etch    # Default distribution to install.
image  = sparse  # Specify sparse vs. full disk images.
image  = full    # Specify sparse vs. full disk images.
dhcp = 1
#
# Uncomment and adjust these network settings if you wish to give your
# new instances static IP addresses.
#
gateway  = 192.168.2.1
netmask  = 255.255.255.0
#
# Uncomment this if you wish the images to use DHCP
#
#dhcp = 1
#
#
# Default kernel and ramdisk to use for the virtual servers
# Default kernel and ramdisk to use for the virtual servers
#
#
kernel = /boot/vmlinuz-2.6.18-4-xen-686
kernel = /boot/vmlinuz-2.6.18-6-xen-686
initrd = /boot/initrd.img-2.6.18-4-xen-686
initrd = /boot/initrd.img-2.6.18-6-xen-686
#
#
# The default mirror for debootstrap which can be used to install
# The default mirror for debootstrap which can be used to install
Zeile 39: Zeile 50:
</pre>
</pre>


Etch-DomU Image erstellen und anschliessend starten
XEN-DomU (Etch) erstellen, die DomU starten und die Netzwerkkonfiguration der DomU vornehmen:
<pre>
xen-create-image --hostname=scx --ip=192.168.2.51
 
vi /etc/xen/scx.cfg              # XEN-Config Anpassungen
 
xm create -c /etc/xen/scx.cfg    # DomU starten
scp xen1:/usr/sbin/ethtool /usr/sbin  # ethtool aus der Dom0 in die DomU kopieren
aptitude install ethtool locales
</pre>
 
'''/etc/network/interfaces''': IP, DNS, Gateway etc. konfigurieren
<pre>
<pre>
xen-create-image --hostname=scx
# This file describes the network interfaces available on your system
vi /etc/xen/scx.cfg
# and how to activate them. For more information, see interfaces(5).
xm create -c /etc/xen/scx.cfg
 
...
# The loopback network interface
auto lo
iface lo inet loopback
 
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.2.51
gateway 192.168.2.1
netmask 255.255.255.0
dns-nameservers 192.168.2.20
dns-search zuhause.lan
post-up  ethtool -K eth0 tx off


vi /etc/network/interfaces
# The commented out line above will disable TCP checksumming which
  post-up ethtool -K eth0 tx off
# might resolve problems for some users.  It is disabled by default
# uncomment ethtool
#
# post-up ethtool -K eth0 tx off
</pre>
</pre>


Zeile 60: Zeile 93:
* SASL2
* SASL2
* diverse Libraries
* diverse Libraries
* Sun Java
* Sun Java, python
* gawk, wget, elinks, ethtool, less, host
* gawk, wget, elinks, ethtool, less, host
* libmilter0 (ab 11.4.2, wird aber nicht unbedingt verwendet)
* libmilter0 (ab 11.4.2, wird aber nicht unbedingt verwendet)
Zeile 69: Zeile 102:
apt-get install -u libsasl2-modules libsasl2-gssapi-mit sasl2-bin libssl0.9.7
apt-get install -u libsasl2-modules libsasl2-gssapi-mit sasl2-bin libssl0.9.7
apt-get install -u libxml2 libglib2.0-0 libstdc++2.10-glibc2.2 libstdc++5
apt-get install -u libxml2 libglib2.0-0 libstdc++2.10-glibc2.2 libstdc++5
apt-get install -u sun-java5-jre
apt-get install -u sun-java5-jre python
apt-get install -u gawk elinks wget w3m less ethtool host bzip2
apt-get install -u gawk elinks wget w3m less ethtool host bzip2
apt-get install -u libmilter0
apt-get install -u libmilter0
Zeile 79: Zeile 112:
* Amavisd-new, Clamav, Spamassassin integrieren
* Amavisd-new, Clamav, Spamassassin integrieren


Ich fange mit Sendmail, Amavisd-new, Spamassassin und Clamav an.
Ich fange mit Sendmail, Amavisd-new, Spamassassin und Clamav an. Für Spam- und Virenfilter verwende ich das ''volatile'' Repository, da diese Programme häufig zu aktualisieren sind und die alten Versionen aus ''stable'' teilw. Fehler produzieren (Clamav 100%CPU).


=== Sendmail unter Debian Etch ===
=== Sendmail unter Debian Etch ===
Zeile 87: Zeile 120:
[[sendmail Installation|Hier]] beschreibe ich meine [[sendmail Installation]] unter Debian Etch zusammen mit '''amavisd-new''', '''clamav''' und '''spamassassin'''.
[[sendmail Installation|Hier]] beschreibe ich meine [[sendmail Installation]] unter Debian Etch zusammen mit '''amavisd-new''', '''clamav''' und '''spamassassin'''.


Wenn die Email-Konfiguration mit sendmail funktioniert, kann Scalix installiert werden. Scalix passt die sendmail Konfiguration so an, dass Emails  an den Mail-Server Scalix ausgeliefert werden.
Wenn die Email-Konfiguration mit sendmail funktioniert, kann Scalix installiert werden. Die Scalix Installation passt die sendmail Konfiguration so an, dass Emails  an den Mail-Server Scalix ausgeliefert werden.


== Scalix Installation ==
== Scalix Installation ==
Zeile 97: Zeile 130:
wget http://downloads.scalix.com/.community/11.0.4/scalix-11.0.4-GA-debian-intel.tgz
wget http://downloads.scalix.com/.community/11.0.4/scalix-11.0.4-GA-debian-intel.tgz
tar xvzf scalix-11.0.4-GA-debian-intel.tgz
tar xvzf scalix-11.0.4-GA-debian-intel.tgz
</pre>
bzw. bei den neueren Versionen (inkl. Stand heute 11.4.3)
<pre>
wget -c http://downloads.scalix.com/.community/11.4.2/scalix-11.4.2-GA-debian-intel.bin
sh ./scalix-11.4.2-GA-debian-intel.bin
</pre>
</pre>


Zeile 116: Zeile 154:
</pre>
</pre>


Jetzt kann man die Scalix-Pakete installieren:
Jetzt kann man die Scalix-Pakete installieren (Bitte neue Versionen aus dem Wiki verwenden!):


'''/usr/src/scx-install.sh'''
'''/usr/src/scx-install-lenny.sh'''
<pre>
<pre>#!/bin/bash
#!/bin/bash
# Scalix 11.x install script
# Author: neobiker
# Version: $Id: scx-install-lenny.sh,v 1.2 2009/07/25 15:53:32 root Exp root $
#
# $Log: scx-install-lenny.sh,v $
# Revision 1.2  2009/07/25 15:53:32  root
# Revision 1.1  2009/07/13 19:53:32  root
# Initial revision
#
 
set -e


#echo -n "What should the name of your primary mailnode be? "
# Adjust next settings
#read mnode
src_dir=/usr/src
#echo -n "Please enter the admin password for the Scalix admin user (sxadmin)? "
#read admpwd
#echo -n "Please enter a password for the ldap query user? "
#read ldappwd
#echo -n "Please enter a password for the db user? " &&
#read dbpwd
#echo -n "Please enter the external ip address of your Scalix box? " &&
#read ip


mnode=scx
# Admin password (sxadmin)
admpwd=geheim
admpwd=geheim
ldappwd=geheim
dbpwd=geheim
ip=`ifconfig eth0|grep 'inet addr:' | cut -d: -f2 | cut -d\  -f1`


java_mem=128
# JAVA Memory usage (ca. 50% of RAM)
tomcatport=80
java_mem=256
 
# load and decompress scalix packages
scalix11version=11.4.6
scalix11downloadurl="http://downloads.scalix.com/.community/${scalix11version}/scalix-${scalix11version}-GA-unsupported-debian-intel.bin"
scalix11bin=`basename $scalix11downloadurl`
scalix11dir=scalix-debian-${scalix11version}-GA
 
# Extract and install packages
if [ ! -e $scalix11dir ]; then
 
    # Download Scalix 11
    if [ ! -e $scalix11bin ]; then
        cd $src_dir
        wget -N $scalix11downloadurl
    fi
 
    sh ./$scalix11bin
fi
cd $scalix11dir/software/scalix_server/
 
 
# initialise variables for installation script
mnode=$(hostname -s)
ip=$(hostname -i)
 
# optional: ask user or comment out
# --------
echo -n "Name of your mailnode [$mnode] ? "
read a ; [ -n "$a" ] && mnode=$a
 
echo -n "Admin password for Scalix admin user (sxadmin) [$admpwd] ? "
read a ; [ -n "$a" ] && admpwd=$a
 
dbpwd=$admpwd
echo -n "Please enter a password for the db user [sxadmin-password] ? "
read a ; [ -n "$a" ] && dbpwd=$a
 
ldappwd=$admpwd
echo -n "Please enter a password for the ldap query user [sxadmin-password] ? "
read a ; [ -n "$a" ] && ldappwd=$a
 
echo -n "Please enter the external ip address of your Scalix box [$ip]? "
read a ; [ -n "$a" ] && ip=$a
 
echo -n "Please enter JAVA Memory usage (e.g. 50% of total MEM) [$java_mem]? "
read a ; [ -n "$a" ] && java_mem=$a
 
# modify scalix deb packages (for lenny)
fix_scalix_debs ()
{
  deb=`/bin/ls -1 scalix-${1}*.deb`
  if  [ -e "$deb" ]; then
 
    [ -d old ] || mkdir old
    [ -d new_$1 ] && rm -rf new_$1
    [ -d new_$1/DEBIAN ] || mkdir -p new_$1/DEBIAN
    [ -e old/$deb ] || cp $deb old/$deb
 
    dpkg -x old/$deb new_$1
    dpkg -e old/$deb new_$1/DEBIAN
 
    case $1 in
        iconv)
            file=new_$1/DEBIAN/preinst
            cat $file | sed -e 's/ "\$1" -gt 1 / -n "\$1" /g' >$file.neu
            mv $file.neu $file
            chmod a+x $file
 
            file=new_$1/DEBIAN/postrm
            cat $file | sed -e 's/ "\$1" -eq 0 / -z "\$1" /g' >$file.neu
            mv $file.neu $file
            chmod a+x $file
 
            dpkg -b new_$1 $deb
            ;;
 
        server)
            file=new_$1/DEBIAN/control
            cat $file | sed -e 's/libsasl2,/libsasl2-2,/g' \
                -e 's/libmilter[^,]*,//g' \
                -e 's/libstdc++2[^,]*,//g' >$file.neu
            mv $file.neu $file
 
            file=new_$1/DEBIAN/postinst
            cat $file | sed -e "s#OMLOGFILE='~/sys/install/log'#OMLOGFILE='~/sys/install/log';#g" >$file.neu
            mv $file.neu $file
            chmod a+x $file
 
            dpkg -b new_$1 $deb
            ;;
 
        postgres)
            file=new_$1/DEBIAN/control
            cat $file | sed -e 's/| postgresql-client-.\..//g' \
                -e 's/| postgresql-.\..//g' >$file.neu
            mv $file.neu $file
 
            dpkg -b new_$1 $deb
            ;;
 
        *)
            ;;
    esac
  fi
}
 
# Initialise more variables
# get scalix pakage filenames: main_files, app_files, other_files
# define config_files etc.
# only variable settings made here until -- Step 0 -- below !
 
scx_main="server postgres"
scx_apps="tomcat-connector tomcat_ mobile platform res sac sis swa"
 
if [ `ls -1 scalix-*.deb 2>/dev/null | wc -l` -gt 0 ] ; then
    for f in `ls -1 scalix-*.deb | cut -d_ -f1`; do
        scalix_pakages="$scalix_pakages $f"
    done
 
    for f in ${scx_main}; do
        main_files="${main_files} "`ls scalix-${f}*.deb`
        dropme="${dropme} | grep -v $f"
    done
 
    for f in ${scx_apps}; do
        app_files="${app_files} "`ls scalix-${f}*.deb`
        dropme="${dropme} | grep -v $f"
    done
 
    other_files=`eval "ls -1 scalix-*.deb ${dropme}"`
 
    pid=$$
    host=$(hostname -s)
    ldomain=$(hostname -d)
    fqdn=$(hostname -f)
    short=${mnode:0:1}${mnode: -1:1}
    net="$(echo $ip | cut -d. -f-3)".0/24
 
    base=/var/opt/scalix/${short}
    tomcatport=80
 
    config_files="\
      ${base}/caa/scalix.res/config/ubermanager.properties \
      ${base}/mobile/mobile.properties \
      ${base}/platform/platform.properties \
      ${base}/res/config/res.properties \
      ${base}/sis/sis.properties \
      ${base}/webmail/swa.properties"
 
else
    echo 'Sorry, no scalix-\*.deb packages found.'
    echo "Please change to the directory which contains the files and try again."
    exit 1
fi
 
# backup scalix config files
scx_backup_config ()
{
    for f in ${config_files}; do
      if [ -e $f ]; then
          mkdir -p `dirname /var/opt/scalix/scalix-config-backup-${pid}${f}`
          cp ${f} /var/opt/scalix/scalix-config-backup-${pid}${f}
          cp ${f} ${f}.bak
      fi
    done
}
 
# show differences to new config files
scx_diff_config ()
{
    for file in ${config_files}; do
 
      sed -e 's/#.*//g' \
          -e '/^$/ D' \
          ${file} | sort > ${file}.new
 
      sed -e 's/#.*//g' \
          -e '/^$/ D' \
          /var/opt/scalix/scalix-config-backup-${pid}${file} | sort > ${file}.old
 
      if ! diff -q ${file}.old ${file}.new; then
          echo "-------------------------------------------------"
          echo "Check changes in ${file}:"
 
          diff ${file}.old ${file}.new || true
 
          echo ">>> Restore old Configfile [y] ?"
          read a
 
          if [ -z "$a" -o "$a" == "y" -o "$a" == "Y" ]; then
            cp ${file} ${file}.new.update
            cp /var/opt/scalix/scalix-config-backup-${pid}${file} ${file}
            echo "restored ${file} !!! <<<"
          fi
          echo "-------------------------------------------------"
          echo ""
      fi
 
    done
 
    echo ">>> Remove temp. Backupfiles (/var/opt/scalix/scalix-config-backup-${pid}) [y] ?"
    read a
 
    if [ -z "$a" -o "$a" == "y" -o "$a" == "Y" ]; then
          rm -rf /var/opt/scalix/scalix-config-backup-${pid}
          echo "/var/opt/scalix/scalix-config-backup-${pid} deleted"
    fi
}
 
cat << EOT
 
>>>> Step 0: check for old Scalix installation
 
EOT
sleep 2
 
# Scalix already installed, remove ?
if [ -d ${base} ]; then
    echo "Scalix directory found: $base"
    echo "Remove Scalix Installation (not the datastore!) [n] ? "
    read a
    if [ "x$a" == "x" -o "x$a" == "xn" ]; then
      echo "leaving old Scalix installion (files) untouched"
    else
      scx_backup_config
      aptitude purge ${scalix_pakages}  # sun-java5-jre postgresql
      echo ""
      echo "delete scalix pakages (${base}, but save the Data-Store!) [y] ? "
      read a
      if [ "x$a" == "x" -o "x$a" == "xy" ]; then
          if [ -d /var/opt/scalix/s.bak ]; then
              mv /var/opt/scalix/s.bak /var/opt/scalix/s.bak.$$
          fi
          mv ${base}/s /var/opt/scalix/s.bak
          ls -l /var/opt/scalix/
          du -sk /var/opt/scalix/s.bak*
          echo ""
          echo "saved data-store, delete all scalix files ${base} now [y] ?"
          read a
          if [ "x$a" == "x" -o "x$a" == "xy" ]; then
              scalix_config_dirs="${base} /opt/scalix* /etc/opt/scalix* /etc/init.d/scalix*"
              rm -rf ${scalix_config_dirs}
          fi
      fi
    fi
fi
 
cat << EOT


ldomain=$(hostname -d)
>>>> Step 1a: install dependencies for Lenny
host=$(hostname)
fqdn=$(hostname -f)
short=${host:0:1}${host: -1:1}


# Update and install required packages
Please configure a UTF-8 locale or setup will fail later on.
# scalix11downloadurl="http://downloads.scalix.com/.community/11.4.2/scalix-11.4.2-GA-debian-intel.bin"
(en_US.UTF-8)
scalix11dir="scalix-debian-11.4.2-GA/software/scalix_server"


# Download Scalix 11
EOT
# cd /usr/src
sleep 2
# wget -N $scalix11downloadurl


# Extract and install packages
# Remove sendmail startup links
# ./scalix-11.4.2-GA-debian-intel.bin
# This disables outgoing mail
# /etc/init.d/sendmail stop
# update-rc.d -f sendmail remove
 
#aptitude update
#aptitude upgrade
aptitude install locales
 
if [ ! $(echo "$LANG" | grep UTF-8) ]; then
  echo "Please set e.g. en_US.UTF-8 locale and re-login and restart script"
  exit 0
fi
 
aptitude install apache2 gawk krb5-config krb5-doc krb5-user libkadm55 libkrb53 \
      libglib2.0-0 libxml2 sgml-base xml-core postgresql postgresql-client \
      libsasl2-modules libsasl2-2 libstdc++5 wget \
      sendmail mailx elinks w3m sun-java5-jre libssl0.9.8
 
# fix sendmail configfile
if [ -e /etc/mail/sendmail.mc ]; then
  grep MAILER /etc/mail/sendmail.mc > /tmp/sendmail.mc.mailer.tmp
  grep -v MAILER /etc/mail/sendmail.mc > /tmp/sendmail.mc.feature.tmp
  cat /tmp/sendmail.mc.feature.tmp >/etc/mail/sendmail.mc
  cat /tmp/sendmail.mc.mailer.tmp >> /etc/mail/sendmail.mc
  rm /tmp/sendmail.mc.*.tmp
fi


[ -e $scalix11dir ] && cd $scalix11dir
# some Lenny hacks for scalix binaries
[ -e /usr/lib/libssl.so.0.9.7 ] || ln -s /usr/lib/libssl.so.0.9.8 /usr/lib/libssl.so.0.9.7
[ -e /usr/lib/libcrypto.so.0.9.7 ] || ln -s /usr/lib/libcrypto.so.0.9.8 /usr/lib/libcrypto.so.0.9.7
[ -e /usr/lib/liblber.so.2 ] || ln -s /usr/lib/liblber-2.4.so.2 /usr/lib/liblber.so.2
[ -e /usr/lib/libldap_r.so.2 ] || ln -s /usr/lib/libldap_r-2.4.so.2 /usr/lib/libldap_r.so.2


cat << EOF
cat << EOT


>>>> Step 1: install Scalix-server
>>>> Step 1b: install Scalix-server


EOF
EOT
sleep 2
sleep 2
echo "continue installation [y] ? "
read a ; [ -z "$a" -o "x$a" == "xy" ] || exit 0


aptitude update
fix_scalix_debs iconv
aptitude upgrade
fix_scalix_debs server
aptitude install apache2 libapache2-mod-jk gawk krb5-config krb5-doc krb5-user libkadm55 libkrb53 \
fix_scalix_debs postgres
      libglib2.0-0 libstdc++2.10-glibc2.2 libxml2 sgml-base xml-core postgresql libsasl2-modules \
 
      libsasl2-gssapi-mit sendmail elinks w3m sun-java5-jre libssl0.9.7 libstdc++5 wget libmilter0
export PATH=/opt/scalix/bin:$PATH


dpkg -i scalix-libical_*.deb scalix-chardet_*.deb scalix-iconv-extras_*.deb
dpkg -i scalix-libical_*.deb scalix-chardet_*.deb scalix-iconv-extras_*.deb
dpkg -i scalix-server_*.deb
dpkg -i scalix-server_*.deb


export PATH=/opt/scalix/bin:$PATH


# Initialize the Scalix Message Store
# Setup mailnode
ommakeom
ommakeom


# Set Generation Rules for Display Name, Login Name and Internet Address
sxconfig --set -t general.usrl_cn_rule='G S'
sxconfig --set -t general.usrl_cn_rule='S, G'
sxconfig --set -t general.usrl_authid_rule='l@'
sxconfig --set -t general.usrl_authid_rule='gs@'
sxconfig --set -t orniasys.name_part_1='"C" <S>' -t orniasys.domain_part_1="$ldomain"
sxconfig --set -t orniasys.name_part_1='"C" <G.S>' -t orniasys.domain_part_1=$ldomain


# Creating the Default Mailnode
omaddmn -m $mnode
omaddmn -m $mnode


# Starting the Server Daemons
omrc -n
omrc -n


# Creating the Default Admin User
omaddu -n sxadmin/$mnode --class limited -c admin -p "$admpwd" sxadmin
omaddu -n sxadmin/$mnode --class limited -c admin -p "$admpwd" sxadmin
# Configuring the Admin User
omconfenu -n "sxadmin/$mnode"
omconfenu -n "sxadmin/$mnode"
omlimit -u "sxadmin/$mnode" -o -i 0 -m 0
omlimit -u "sxadmin/$mnode" -o -i 0 -m 0


# Creating the LDAP Query User
omaddu -n sxqueryadmin/$mnode --class limited -c admin -p $ldappwd sxqueryadmin@$fqdn
omaddu -n sxqueryadmin/$mnode --class limited -c admin -p $ldappwd sxqueryadmin@$fqdn


# Creating the Standard Scalix Admin Groups
omaddpdl -l ScalixUserAdmins/$mnode
omaddpdl -l ScalixUserAdmins/$mnode
omaddpdl -l ScalixUserAttributesAdmins/$mnode
omaddpdl -l ScalixUserAttributesAdmins/$mnode
Zeile 208: Zeile 510:
omaddpdl -l ScalixAdmins/$mnode
omaddpdl -l ScalixAdmins/$mnode


cat >>/var/opt/scalix/${short}/s/sys/general.cfg <<EOF
cat >> ${base}/s/sys/general.cfg <<EOT
#
#
# The CDA service (used for "type down" in some clients) is more
# The CDA service (used for "type down" in some clients) is more
Zeile 251: Zeile 553:
# system-defined aliases are permitted and it the alias name is ignored
# system-defined aliases are permitted and it the alias name is ignored
# for the purposes of message creation and so on.
# for the purposes of message creation and so on.
#  
#
# Note that changing these settings normally requires restarting Scalix.
# Note that changing these settings normally requires restarting Scalix.
#
#
Zeile 258: Zeile 560:
UAL_USE_SIGNON_ALIAS=FALSE
UAL_USE_SIGNON_ALIAS=FALSE


EOF
EOT
chmod 444 ${base}/s/sys/general.cfg


# Starting Scalix Services
omon -s all
omon -s all


cat << EOF
cat << EOT


>>>> Step 2: install Scalix packages
>>>> Step 2: install Scalix packages


EOF
EOT
sleep 2
sleep 2


# Installing the Scalix Server package
dpkg -i --force-overwrite scalix-tomcat_*.deb scalix-tomcat-connector_*.deb
dpkg -i scalix-postgres_*.deb scalix-tomcat_*.deb scalix-tomcat-connector_*.deb \
dpkg -i --force-overwrite scalix-postgres_*.deb
        scalix-mobile_*.deb scalix-platform_*.deb scalix-res_*.deb scalix-sac_*.deb \
        scalix-sis_*.deb scalix-swa_*.deb


# Java Memory anpassen (ca. 50% of Mem)
#set JAVA Memory usage
file=/etc/opt/scalix-tomcat/scalix-tomcat.conf
file=/etc/opt/scalix-tomcat/scalix-tomcat.conf
if [ -e $file ]; then
if [ -e $file ]; then
Zeile 285: Zeile 585:


# Setup DB
# Setup DB
/opt/scalix-postgres/bin/sxpsql-init                  # To create the database and tables
/opt/scalix-postgres/bin/sxpsql-setpwd $dbpwd
/opt/scalix-postgres/bin/sxpsql-setpwd $dbpwd
/opt/scalix-postgres/bin/sxpsql-whitelist 127.0.0.1 $ip
#/opt/scalix-postgres/bin/sxpsql-whitelist 127.0.0.1 $ip
/opt/scalix-postgres/bin/sxpsql-whitelist 127.0.0.1 $net


# Setting up Scalix-Tomcat
dpkg -i --force-overwrite \
# vi /etc/opt/scalix-tomcat/scalix-tomcat.conf
        scalix-mobile_*.deb scalix-platform_*.deb scalix-res_*.deb scalix-sac_*.deb \
# Set RAM Usage to 50% of complete RAM (or other, e.g. 40M)
        scalix-sis_*.deb scalix-swa_*.deb
# JAVA_OPTS="-server -Xms40m -Xmx40m"
cat << EOT
 
cat << EOF


>>>> Step 3: configure Scalix
>>>> Step 3: configure Scalix


EOF
EOT
sleep 2
sleep 2


# Configure Scalix
# Configure Scalix
base=/var/opt/scalix/${short}
for file in ${config_files}; do
files="$base/webmail/swa.properties \
   sed \
      $base/caa/scalix.res/config/ubermanager.properties \
    -e "s;%LOCALDOMAIN%;$ldomain;g" \
      $base/res/config/res.properties \
      $base/platform/platform.properties \
      $base/mobile/mobile.properties \
      $base/sis/sis.properties"
 
for file in $files; do
   sed -e "s;%LOCALDOMAIN%;$ldomain;g" \
     -e "s;%LOCALHOST%;$fqdn;g" \
     -e "s;%LOCALHOST%;$fqdn;g" \
     -e "s;%IMAPHOST%;$fqdn;g" \
     -e "s;%IMAPHOST%;$fqdn;g" \
Zeile 335: Zeile 626:
     -e "s;__TOMCAT_PORT__;$tomcatport;g" \
     -e "s;__TOMCAT_PORT__;$tomcatport;g" \
     -e "s;localhost;$fqdn;g" \
     -e "s;localhost;$fqdn;g" \
     -e "s;%SIS-LANGUAGE%;German;g" \
     -e "s;%SIS-LANGUAGE%;;g" \
     -e "s;%INDEX-WHITELIST%;$fqdn;g" \
     -e "s;%INDEX-WHITELIST%;$ip;g" \
     -e "s;%SEARCH-WHITELIST%;$fqdn;g" \
     -e "s;%SEARCH-WHITELIST%;$ip;g" \
     -e "s;%INDEXADMIN-WHITELIST%;;g" \
     -e "s;%INDEXADMIN-WHITELIST%;$ip;g" \
     $file > $file.neu
     $file > $file.neu
   mv $file.neu $file
   mv $file.neu $file
Zeile 347: Zeile 638:
   sed \
   sed \
       -e "s;ubermanager.console.defaultCountry=US;ubermanager.console.defaultCountry=DE;g" \
       -e "s;ubermanager.console.defaultCountry=US;ubermanager.console.defaultCountry=DE;g" \
       -e "s;ubermanager.console.defaultLanguage=AMERICAN;ubermanager.console.defaultLanguage=GERMAN;
       -e "s;ubermanager.console.defaultLanguage=AMERICAN;ubermanager.console.defaultLanguage=GERMAN;g" \
g" \
       -e "s;swa.user.locale=en_US;swa.user.locale=de_DE;g" \
       -e "s;swa.user.locale=en_US;swa.user.locale=de_DE;g" \
       -e "s;swa.user.preferredDateTimeFormat=1;swa.user.preferredDateTimeFormat=2;g" \
       -e "s;swa.user.preferredDateTimeFormat=1;swa.user.preferredDateTimeFormat=2;g" \
Zeile 357: Zeile 647:
     mv $file.new $file
     mv $file.new $file
done
done
[ -e /var/opt/scalix/scalix-config-backup-${pid} ] && scx_diff_config


# Write Ldappassword to psdata
# Write Ldappassword to psdata
echo "$ldappwd" > ${base}/caa/scalix.res/config/psdata
file=${base}/caa/scalix.res/config/psdata
chown root:root ${base}/caa/scalix.res/config/psdata
echo "$ldappwd" > ${file}
chmod 400 ${base}/caa/scalix.res/config/psdata
chown root:root $file
chmod 400 $file
 
# check files and permissions
file=$base/s/Copyright/OM-LDAP
[ -e $file ] || touch $file


# Setup Apache
omcheck -s | sh
cat << EOF
 
cat << EOT


>>>> Step 4: setup apache, restart Scalix(-tomcat)
>>>> Step 4: setup apache, restart Scalix(-tomcat)


EOF
EOT
sleep 2
sleep 2


# Restart Tomcat
# Setup Apache
/etc/init.d/scalix-tomcat restart
 
# Setup Apache configuration
[ -e /etc/apache2/conf.d/scalix-web-client.conf ] || \
[ -e /etc/apache2/conf.d/scalix-web-client.conf ] || \
     ln -s /opt/scalix/global/httpd/scalix-web-client.conf /etc/apache2/conf.d
     ln -s /opt/scalix/global/httpd/scalix-web-client.conf /etc/apache2/conf.d/scalix-web-client.conf


cat << EOF > /etc/apache2/conf.d/scalix-access.conf
cat << EOT > /etc/apache2/conf.d/scalix-access.conf
<Location />
<Location />
         Allow from all
         Allow from all
</Location>
</Location>
EOF
EOT
 
file=/etc/opt/scalix-tomcat/connector/ajp/instance-$mnode.conf
if [ ! -e $file ]; then
  echo 'Include /etc/opt/scalix-tomcat/connector/ajp/app-*.conf' > $file
fi


# delete <VirtualHost> Definitions
files="/etc/opt/scalix-tomcat/connector/ajp/*-$mnode.*conf \
# we'll use our own setup!
       /etc/opt/scalix-tomcat/connector/jk/*-$mnode.*conf"
files="/etc/opt/scalix-tomcat/connector/ajp/instance-scx.conf \
       /etc/opt/scalix-tomcat/connector/jk/instance-scx.conf"
for file in $files; do
for file in $files; do
   if [ -e $file ]; then
   if [ -e $file ]; then
Zeile 397: Zeile 695:
done
done


# restart Apache
/etc/init.d/apache2 restart
/etc/init.d/apache2 restart
# Restart Tomcat
/etc/init.d/scalix-tomcat restart


cat << EOT
cat << EOT
Zeile 406: Zeile 706:
# http://$fqdn/webmail
# http://$fqdn/webmail
#####################################################
#####################################################
EOT
EOT
if [ -e /var/opt/scalix/s.bak ]; then
cat << EOT
# restore your old scalix data-store with:
# - stop scalix            > for f in /etc/rc1.d/K*scalix*; do \$f stop; done
# - restore the data-store  > mv /var/opt/scalix/s.bak $base/s
# - and start scalix again  > for f in /etc/rc2.d/S*scalix*; do \$f start; done
#
for f in /etc/rc1.d/K*scalix*; do \$f stop; done
mv $base/s $base/s.new
mv /var/opt/scalix/s.bak $base/s
for f in /etc/rc2.d/S*scalix*; do \$f start; done
#
# if SAC Login fails, try this
ommodu sxqueryadmin -p $ldappwd
EOT
fi
</pre>
</pre>


Zeile 417: Zeile 737:




Um Ressourcen zu sparen, kann man den Speicherbedarf des Tomcat etwas zügeln (das ist in oberen skript bereits eingebaut):
Um Ressourcen zu sparen, kann man den Speicherbedarf des Tomcat etwas zügeln (das ist im install-skript bereits eingebaut):


'''/etc/opt/scalix-tomcat/scalix-tomcat.conf'''
'''/etc/opt/scalix-tomcat/scalix-tomcat.conf'''
Zeile 518: Zeile 838:
</pre>
</pre>


Die Scalix-Proxy Konfiguration:
Die Scalix-Proxy Konfigurationen: '''/etc/opt/scalix-tomcat/connector/ajp/app-scx.*.conf'''
'''/etc/opt/scalix-tomcat/connector/ajp/app-scx.*.conf'''
 
'''/etc/opt/scalix-tomcat/connector/ajp/app-scx.sac.conf'''
<pre>
<pre>
         ProxyPass /sac ajp://scx.neobiker.lan:8009/sac
         ProxyPass /sac ajp://scx.neobiker.lan:8009/sac
</pre>
</pre>


'''/etc/opt/scalix-tomcat/connector/ajp/app-scx.*.conf'''
'''/etc/opt/scalix-tomcat/connector/ajp/app-scx.webmail.conf'''
<pre>
<pre>
         ProxyPass /webmail ajp://scx.neobiker.lan:8009/webmail
         ProxyPass /webmail ajp://scx.neobiker.lan:8009/webmail
</pre>
</pre>


Unter Etch wird das Apache Modul mod_jk nicht mehr benötigt, da es von mod_proxy_ajp abgelöst wurde. Da ich letzteres Modul selber in der SSL-Konfiguration includiere, kommentiere ich es hier aus:
Unter Etch wird das Apache Modul mod_jk nicht mehr benötigt, da es von mod_proxy_ajp abgelöst wurde. Da ich das ajp-Modul selber in der SSL-Konfiguration includiere (vgl. oben), kommentiere ich es hier aus (entweder/oder):
 
 
'''/etc/apache2/conf.d/scalix-tomcat-connector.conf'''
'''/etc/apache2/conf.d/scalix-tomcat-connector.conf'''
<pre>
<pre>
Zeile 546: Zeile 869:


#<IfModule mod_proxy_ajp.c>
#<IfModule mod_proxy_ajp.c>
#  Include /etc/opt/scalix-tomcat/connector/ajp/instance-*.conf
#  Include /etc/opt/scalix-tomcat/connector/ajp/app*.conf
#</IfModule>
#</IfModule>


Zeile 566: Zeile 889:
JkRequestLogFormat "%w %V %T"
JkRequestLogFormat "%w %V %T"


Include /etc/opt/scalix-tomcat/connector/jk/instance-*.conf
Include /etc/opt/scalix-tomcat/connector/jk/app-*.conf
Include /etc/opt/scalix-tomcat/connector/jk/workers.conf
Include /etc/opt/scalix-tomcat/connector/jk/workers.conf



Aktuelle Version vom 16. Februar 2010, 19:19 Uhr

Vorbereitung

Ich habe Scalix in einer XEN-DomU installiert. Das ist natürlich optional. Ausserdem verwendet Scalix sendmail anstatt Exim als smtp-daemon. Analog zur Exim Installation habe ich sendmail in einer Dual-sendmail Konfiguration zusammen mit amavisd-new installiert, welche spamassassin und clamav als Spam- und Virenscanner integriert.

Etch Installation in XEN DomU

Ich starte mit der Installation auf einer frischen Etch-Installation unter XEN. Der Einfachheit halber benutze ich die xen-tools.

apt-get install xen-tools

Konfigdatei /etc/xen-tools/xen-tools.conf:

#
# ...
lvm = vg
debootstrap = 1
#
##
#  Disk and Sizing options.
##
#
size   = 4Gb      # Disk image size.
memory = 256Mb    # Memory size
swap   = 512Mb    # Swap size
# noswap = 1      # Don't use swap at all for the new system.
fs     = ext3     # use the EXT3 filesystem for the disk image.
dist   = etch     # Default distribution to install.
image  = full     # Specify sparse vs. full disk images.
#
# Uncomment and adjust these network settings if you wish to give your
# new instances static IP addresses.
#
gateway   = 192.168.2.1
netmask   = 255.255.255.0
#
# Uncomment this if you wish the images to use DHCP
#
#dhcp = 1
#
# Default kernel and ramdisk to use for the virtual servers
#
kernel = /boot/vmlinuz-2.6.18-6-xen-686
initrd = /boot/initrd.img-2.6.18-6-xen-686
#
# The default mirror for debootstrap which can be used to install
# Debian Sid, Sarge, and Etch.
#
mirror = http://ftp.de.debian.org/debian/
# ...

XEN-DomU (Etch) erstellen, die DomU starten und die Netzwerkkonfiguration der DomU vornehmen:

xen-create-image --hostname=scx --ip=192.168.2.51

vi /etc/xen/scx.cfg               # XEN-Config Anpassungen

xm create -c /etc/xen/scx.cfg     # DomU starten
scp xen1:/usr/sbin/ethtool /usr/sbin  # ethtool aus der Dom0 in die DomU kopieren
aptitude install ethtool locales

/etc/network/interfaces: IP, DNS, Gateway etc. konfigurieren

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
 address 192.168.2.51
 gateway 192.168.2.1
 netmask 255.255.255.0
 dns-nameservers 192.168.2.20
 dns-search zuhause.lan
 post-up  ethtool -K eth0 tx off

# The commented out line above will disable TCP checksumming which
# might resolve problems for some users.  It is disabled by default
#

Zusätzliche Pakete installieren

Jetzt die für Scalix zusätzlich notwendigen Pakete installieren:

  • Apache, Sendmail
  • Postgres
  • Kerberos
  • SASL2
  • diverse Libraries
  • Sun Java, python
  • gawk, wget, elinks, ethtool, less, host
  • libmilter0 (ab 11.4.2, wird aber nicht unbedingt verwendet)
apt-get install -u apache2 sendmail sendmail-doc
apt-get install -u postgresql
apt-get install -u krb5-config krb5-doc krb5-user libkadm55 libkrb53
apt-get install -u libsasl2-modules libsasl2-gssapi-mit sasl2-bin libssl0.9.7
apt-get install -u libxml2 libglib2.0-0 libstdc++2.10-glibc2.2 libstdc++5
apt-get install -u sun-java5-jre python
apt-get install -u gawk elinks wget w3m less ethtool host bzip2
apt-get install -u libmilter0

Folgendes habe ich anschliessend angepasst (siehe unten):

  • Sendmail-Dual Konfiguration
  • Smarthost, MasqueradeAs
  • Amavisd-new, Clamav, Spamassassin integrieren

Ich fange mit Sendmail, Amavisd-new, Spamassassin und Clamav an. Für Spam- und Virenfilter verwende ich das volatile Repository, da diese Programme häufig zu aktualisieren sind und die alten Versionen aus stable teilw. Fehler produzieren (Clamav 100%CPU).

Sendmail unter Debian Etch

Unter Debian ist standardmässig Exim als Maildaemon installiert. Scalix verwendet und konfiguriert sendmail.

Hier beschreibe ich meine sendmail Installation unter Debian Etch zusammen mit amavisd-new, clamav und spamassassin.

Wenn die Email-Konfiguration mit sendmail funktioniert, kann Scalix installiert werden. Die Scalix Installation passt die sendmail Konfiguration so an, dass Emails an den Mail-Server Scalix ausgeliefert werden.

Scalix Installation

Sourcen laden

Sourcen laden (82MB) und unter /usr/src auspacken:

cd /usr/src
wget http://downloads.scalix.com/.community/11.0.4/scalix-11.0.4-GA-debian-intel.tgz
tar xvzf scalix-11.0.4-GA-debian-intel.tgz

bzw. bei den neueren Versionen (inkl. Stand heute 11.4.3)

wget -c http://downloads.scalix.com/.community/11.4.2/scalix-11.4.2-GA-debian-intel.bin
sh ./scalix-11.4.2-GA-debian-intel.bin

Installation

Das Pakage von 11.0.4 war bei mir korrupt, in einem Tomcat-Paket ist ein Syntaxfehler. Den behebe ich zuerst:

cd /usr/src/scalix-debian-11.0.4-GA/software/scalix_server
mkdir -p new/DEBIAN old
mv scalix-tomcat_5.5.16-263_all.deb old 
dpkg -x old/scalix-tomcat_5.5.16-263_all.deb new
dpkg -e old/scalix-tomcat_5.5.16-263_all.deb new/DEBIAN

vi new/DEBIAN/postinst
# ... Zeile 21 die überflüssige ')' entfernen
    /opt/scalix-tomcat/bin/sxtomcat-create-instance ""
# ...

dpkg -b new scalix-tomcat_5.5.16-263_all_patched.deb

Jetzt kann man die Scalix-Pakete installieren (Bitte neue Versionen aus dem Wiki verwenden!):

/usr/src/scx-install-lenny.sh

#!/bin/bash
# Scalix 11.x install script
# Author: neobiker
# Version: $Id: scx-install-lenny.sh,v 1.2 2009/07/25 15:53:32 root Exp root $
#
# $Log: scx-install-lenny.sh,v $
# Revision 1.2  2009/07/25 15:53:32  root
# Revision 1.1  2009/07/13 19:53:32  root
# Initial revision
#

set -e

# Adjust next settings
src_dir=/usr/src

# Admin password (sxadmin)
admpwd=geheim

# JAVA Memory usage (ca. 50% of RAM)
java_mem=256

# load and decompress scalix packages
scalix11version=11.4.6
scalix11downloadurl="http://downloads.scalix.com/.community/${scalix11version}/scalix-${scalix11version}-GA-unsupported-debian-intel.bin"
scalix11bin=`basename $scalix11downloadurl`
scalix11dir=scalix-debian-${scalix11version}-GA

# Extract and install packages
if [ ! -e $scalix11dir ]; then

    # Download Scalix 11
    if [ ! -e $scalix11bin ]; then
        cd $src_dir
        wget -N $scalix11downloadurl
    fi

    sh ./$scalix11bin
fi
cd $scalix11dir/software/scalix_server/


# initialise variables for installation script
mnode=$(hostname -s)
ip=$(hostname -i)

# optional: ask user or comment out
# --------
echo -n "Name of your mailnode [$mnode] ? "
read a ; [ -n "$a" ] && mnode=$a

echo -n "Admin password for Scalix admin user (sxadmin) [$admpwd] ? "
read a ; [ -n "$a" ] && admpwd=$a

dbpwd=$admpwd
echo -n "Please enter a password for the db user [sxadmin-password] ? "
read a ; [ -n "$a" ] && dbpwd=$a

ldappwd=$admpwd
echo -n "Please enter a password for the ldap query user [sxadmin-password] ? "
read a ; [ -n "$a" ] && ldappwd=$a

echo -n "Please enter the external ip address of your Scalix box [$ip]? "
read a ; [ -n "$a" ] && ip=$a

echo -n "Please enter JAVA Memory usage (e.g. 50% of total MEM) [$java_mem]? "
read a ; [ -n "$a" ] && java_mem=$a

# modify scalix deb packages (for lenny)
fix_scalix_debs ()
{
  deb=`/bin/ls -1 scalix-${1}*.deb`
  if  [ -e "$deb" ]; then

    [ -d old ] || mkdir old
    [ -d new_$1 ] && rm -rf new_$1
    [ -d new_$1/DEBIAN ] || mkdir -p new_$1/DEBIAN
    [ -e old/$deb ] || cp $deb old/$deb

    dpkg -x old/$deb new_$1
    dpkg -e old/$deb new_$1/DEBIAN

    case $1 in
        iconv)
            file=new_$1/DEBIAN/preinst
            cat $file | sed -e 's/ "\$1" -gt 1 / -n "\$1" /g' >$file.neu
            mv $file.neu $file
            chmod a+x $file

            file=new_$1/DEBIAN/postrm
            cat $file | sed -e 's/ "\$1" -eq 0 / -z "\$1" /g' >$file.neu
            mv $file.neu $file
            chmod a+x $file

            dpkg -b new_$1 $deb
            ;;

        server)
            file=new_$1/DEBIAN/control
            cat $file | sed -e 's/libsasl2,/libsasl2-2,/g' \
                -e 's/libmilter[^,]*,//g' \
                -e 's/libstdc++2[^,]*,//g' >$file.neu
            mv $file.neu $file

            file=new_$1/DEBIAN/postinst
            cat $file | sed -e "s#OMLOGFILE='~/sys/install/log'#OMLOGFILE='~/sys/install/log';#g" >$file.neu
            mv $file.neu $file
            chmod a+x $file

            dpkg -b new_$1 $deb
            ;;

        postgres)
            file=new_$1/DEBIAN/control
            cat $file | sed -e 's/| postgresql-client-.\..//g' \
                -e 's/| postgresql-.\..//g' >$file.neu
            mv $file.neu $file

            dpkg -b new_$1 $deb
            ;;

        *)
            ;;
    esac
  fi
}

# Initialise more variables
# get scalix pakage filenames: main_files, app_files, other_files
# define config_files etc.
# only variable settings made here until -- Step 0 -- below !

scx_main="server postgres"
scx_apps="tomcat-connector tomcat_ mobile platform res sac sis swa"

if [ `ls -1 scalix-*.deb 2>/dev/null | wc -l` -gt 0 ] ; then
    for f in `ls -1 scalix-*.deb | cut -d_ -f1`; do
        scalix_pakages="$scalix_pakages $f"
    done

    for f in ${scx_main}; do
        main_files="${main_files} "`ls scalix-${f}*.deb`
        dropme="${dropme} | grep -v $f"
    done

    for f in ${scx_apps}; do
        app_files="${app_files} "`ls scalix-${f}*.deb`
        dropme="${dropme} | grep -v $f"
    done

    other_files=`eval "ls -1 scalix-*.deb ${dropme}"`

    pid=$$
    host=$(hostname -s)
    ldomain=$(hostname -d)
    fqdn=$(hostname -f)
    short=${mnode:0:1}${mnode: -1:1}
    net="$(echo $ip | cut -d. -f-3)".0/24

    base=/var/opt/scalix/${short}
    tomcatport=80

    config_files="\
       ${base}/caa/scalix.res/config/ubermanager.properties \
       ${base}/mobile/mobile.properties \
       ${base}/platform/platform.properties \
       ${base}/res/config/res.properties \
       ${base}/sis/sis.properties \
       ${base}/webmail/swa.properties"

else
    echo 'Sorry, no scalix-\*.deb packages found.'
    echo "Please change to the directory which contains the files and try again."
    exit 1
fi

# backup scalix config files
scx_backup_config ()
{
    for f in ${config_files}; do
       if [ -e $f ]; then
          mkdir -p `dirname /var/opt/scalix/scalix-config-backup-${pid}${f}`
          cp ${f} /var/opt/scalix/scalix-config-backup-${pid}${f}
          cp ${f} ${f}.bak
       fi
    done
}

# show differences to new config files
scx_diff_config ()
{
    for file in ${config_files}; do

      sed -e 's/#.*//g' \
          -e '/^$/ D' \
          ${file} | sort > ${file}.new

      sed -e 's/#.*//g' \
          -e '/^$/ D' \
          /var/opt/scalix/scalix-config-backup-${pid}${file} | sort > ${file}.old

      if ! diff -q ${file}.old ${file}.new; then
          echo "-------------------------------------------------"
          echo "Check changes in ${file}:"

          diff ${file}.old ${file}.new || true

          echo ">>> Restore old Configfile [y] ?"
          read a

          if [ -z "$a" -o "$a" == "y" -o "$a" == "Y" ]; then
            cp ${file} ${file}.new.update
            cp /var/opt/scalix/scalix-config-backup-${pid}${file} ${file}
            echo "restored ${file} !!! <<<"
          fi
          echo "-------------------------------------------------"
          echo ""
      fi

    done

    echo ">>> Remove temp. Backupfiles (/var/opt/scalix/scalix-config-backup-${pid}) [y] ?"
    read a

    if [ -z "$a" -o "$a" == "y" -o "$a" == "Y" ]; then
          rm -rf /var/opt/scalix/scalix-config-backup-${pid}
          echo "/var/opt/scalix/scalix-config-backup-${pid} deleted"
    fi
}

cat << EOT

>>>> Step 0: check for old Scalix installation

EOT
sleep 2

# Scalix already installed, remove ?
if [ -d ${base} ]; then
    echo "Scalix directory found: $base"
    echo "Remove Scalix Installation (not the datastore!) [n] ? "
    read a
    if [ "x$a" == "x" -o "x$a" == "xn" ]; then
      echo "leaving old Scalix installion (files) untouched"
    else
      scx_backup_config
      aptitude purge ${scalix_pakages}   # sun-java5-jre postgresql
      echo ""
      echo "delete scalix pakages (${base}, but save the Data-Store!) [y] ? "
      read a
      if [ "x$a" == "x" -o "x$a" == "xy" ]; then
          if [ -d /var/opt/scalix/s.bak ]; then
              mv /var/opt/scalix/s.bak /var/opt/scalix/s.bak.$$
          fi
          mv ${base}/s /var/opt/scalix/s.bak
          ls -l /var/opt/scalix/
          du -sk /var/opt/scalix/s.bak*
          echo ""
          echo "saved data-store, delete all scalix files ${base} now [y] ?"
          read a
          if [ "x$a" == "x" -o "x$a" == "xy" ]; then
              scalix_config_dirs="${base} /opt/scalix* /etc/opt/scalix* /etc/init.d/scalix*"
              rm -rf ${scalix_config_dirs}
          fi
      fi
    fi
fi

cat << EOT

>>>> Step 1a: install dependencies for Lenny

Please configure a UTF-8 locale or setup will fail later on.
(en_US.UTF-8)

EOT
sleep 2

# Remove sendmail startup links
# This disables outgoing mail
# /etc/init.d/sendmail stop
# update-rc.d -f sendmail remove

#aptitude update
#aptitude upgrade
aptitude install locales

if [ ! $(echo "$LANG" | grep UTF-8) ]; then
   echo "Please set e.g. en_US.UTF-8 locale and re-login and restart script"
   exit 0
fi

aptitude install apache2 gawk krb5-config krb5-doc krb5-user libkadm55 libkrb53 \
       libglib2.0-0 libxml2 sgml-base xml-core postgresql postgresql-client \
       libsasl2-modules libsasl2-2  libstdc++5 wget \
       sendmail mailx elinks w3m sun-java5-jre libssl0.9.8

# fix sendmail configfile
if [ -e /etc/mail/sendmail.mc ]; then
  grep MAILER /etc/mail/sendmail.mc > /tmp/sendmail.mc.mailer.tmp
  grep -v MAILER /etc/mail/sendmail.mc > /tmp/sendmail.mc.feature.tmp
  cat /tmp/sendmail.mc.feature.tmp >/etc/mail/sendmail.mc
  cat /tmp/sendmail.mc.mailer.tmp >> /etc/mail/sendmail.mc
  rm /tmp/sendmail.mc.*.tmp
fi

# some Lenny hacks for scalix binaries
[ -e /usr/lib/libssl.so.0.9.7 ] || ln -s /usr/lib/libssl.so.0.9.8 /usr/lib/libssl.so.0.9.7
[ -e /usr/lib/libcrypto.so.0.9.7 ] || ln -s /usr/lib/libcrypto.so.0.9.8 /usr/lib/libcrypto.so.0.9.7
[ -e /usr/lib/liblber.so.2 ] || ln -s /usr/lib/liblber-2.4.so.2 /usr/lib/liblber.so.2
[ -e /usr/lib/libldap_r.so.2 ] || ln -s /usr/lib/libldap_r-2.4.so.2 /usr/lib/libldap_r.so.2

cat << EOT

>>>> Step 1b: install Scalix-server

EOT
sleep 2
echo "continue installation [y] ? "
read a ; [ -z "$a" -o "x$a" == "xy" ] || exit 0

fix_scalix_debs iconv
fix_scalix_debs server
fix_scalix_debs postgres

export PATH=/opt/scalix/bin:$PATH

dpkg -i scalix-libical_*.deb scalix-chardet_*.deb scalix-iconv-extras_*.deb
dpkg -i scalix-server_*.deb


# Setup mailnode
ommakeom

sxconfig --set -t general.usrl_cn_rule='G S'
sxconfig --set -t general.usrl_authid_rule='l@'
sxconfig --set -t orniasys.name_part_1='"C" <S>' -t orniasys.domain_part_1="$ldomain"

omaddmn -m $mnode

omrc -n

omaddu -n sxadmin/$mnode --class limited -c admin -p "$admpwd" sxadmin
omconfenu -n "sxadmin/$mnode"
omlimit -u "sxadmin/$mnode" -o -i 0 -m 0

omaddu -n sxqueryadmin/$mnode --class limited -c admin -p $ldappwd sxqueryadmin@$fqdn

omaddpdl -l ScalixUserAdmins/$mnode
omaddpdl -l ScalixUserAttributesAdmins/$mnode
omaddpdl -l ScalixGroupAdmins/$mnode
omaddpdl -l ScalixAdmins/$mnode

cat >> ${base}/s/sys/general.cfg <<EOT
#
# The CDA service (used for "type down" in some clients) is more
# efficient if it can check the directory change log before attempting
# to update the access tables that it uses.   One slow machines, it may
# also be worth uncommenting the CDA_CHECKTIME tweak to reduce the check
# interval from five minutes to an hour.
#
CDA_USE_CHANGE_LOG=TRUE
# CDA_CHECKTIME=60
#
# These tweaks limit the number and rate of IMAP connections to the
# server. The IMAP_CONNECTION_LIMIT simply restricts the total number of
# connections to the server. Note that many IMAP clients have several
# connections for each IMAP session. The IMAP_CONNRATE_LIMIT restricts
# the rate at which clients can connect to the server, in this case, at
# most 10 connections per second. If clients try to connect faster
# than that, the IMAP server simply slows down the rate at which it will
# accept new connections.
#
IMAP_CONNECTION_LIMIT=500
IMAP_CONNRATE_LIMIT=10
#
# The IMAP_IDLE_TIMEOUT tweak is the maximum time an IMAP connection
# will wait for a command before terminating the connection. The default
# setting, and the minimum required setting, is 30 minutes. Some
# clients "refresh" their connection once every thirty minutes
# exactly -- but if they are a little bit late, the server drops their
# connection. Setting a timeout of 31 minutes avoids this problem.
#
IMAP_IDLE_TIMEOUT=31
#
# This tweak arranges for Local Delivery to automatically create a
# message store for users created without one.
# Users added with the bulk-add mechanism used by the
# wizard do not have a message store. So setting this tweak allows
# them to receive mail before they are initially signed on.
#
LD_CREATE_MESSAGE_STORE=TRUE
#
# These three tweaks allow users to sign on using an alias. Only
# system-defined aliases are permitted and it the alias name is ignored
# for the purposes of message creation and so on.
#
# Note that changing these settings normally requires restarting Scalix.
#
UAL_SIGNON_ALIAS=YES
UAL_SIGNON_ALIAS_CONFIG=SYS
UAL_USE_SIGNON_ALIAS=FALSE

EOT
chmod 444 ${base}/s/sys/general.cfg

omon -s all

cat << EOT

>>>> Step 2: install Scalix packages

EOT
sleep 2

dpkg -i --force-overwrite scalix-tomcat_*.deb scalix-tomcat-connector_*.deb
dpkg -i --force-overwrite scalix-postgres_*.deb

#set JAVA Memory usage
file=/etc/opt/scalix-tomcat/scalix-tomcat.conf
if [ -e $file ]; then
    sed -e "s;Xms256;Xms${java_mem};g" \
        -e "s;Xmx256;Xmx${java_mem};g" \
        $file > $file.neu
    mv $file.neu $file
fi

# Setup DB
/opt/scalix-postgres/bin/sxpsql-setpwd $dbpwd
#/opt/scalix-postgres/bin/sxpsql-whitelist 127.0.0.1 $ip
/opt/scalix-postgres/bin/sxpsql-whitelist 127.0.0.1 $net

dpkg -i --force-overwrite \
        scalix-mobile_*.deb scalix-platform_*.deb scalix-res_*.deb scalix-sac_*.deb \
        scalix-sis_*.deb scalix-swa_*.deb
cat << EOT

>>>> Step 3: configure Scalix

EOT
sleep 2

# Configure Scalix
for file in ${config_files}; do
  sed \
    -e "s;%LOCALDOMAIN%;$ldomain;g" \
    -e "s;%LOCALHOST%;$fqdn;g" \
    -e "s;%IMAPHOST%;$fqdn;g" \
    -e "s;%SMTPHOST%;$fqdn;g" \
    -e "s;%DBHOST%;$fqdn:5733;g" \
    -e "s;%DBPASSWD%;$dbpwd;g" \
    -e "s;%LDAPPORT%;389;g" \
    -e "s;http://%PLATFORMURL%:8080/api;http://$fqdn/api;g" \
    -e "s;%PLATFORMURL%;http://$fqdn/api;g" \
    -e "s;swa.platform.enabled=false;swa.platform.enabled=true;g" \
    -e "s;__SECURED_MODE__;false;g" \
    -e "s;ubermanager/__FQHN_HOST__@__KERBEROS_REALM__;;g" \
    -e "s;__KERBEROS_REALM__;;g" \
    -e "s;__FQHN_FOR_KDC_HOST__;;g" \
    -e "s;__FQHN_QUERY_SERVER_NAME__;$fqdn;g" \
    -e "s;__UBERMGR_USE_EXTERNAL_AUTH__;false;g" \
    -e "s;__UBERMGR_ALLOW_EXTERNAL_AUTH__;false;g" \
    -e "s;__UBERMGR_MAXLIST_SIZE__;100;g" \
    -e "s;__UBERMGR_MAIL_DOMAINS_LIST__;$ldomain;g" \
    -e "s;__UBERMGR_EXTERNAL_DOMAIN_AUTH_LIST__;;g" \
    -e "s;__CONFIGURED__;true;g" \
    -e "s;__FQHN_FOR_UBERMANAGER__;$fqdn;g" \
    -e "s;__TOMCAT_PORT__;$tomcatport;g" \
    -e "s;localhost;$fqdn;g" \
    -e "s;%SIS-LANGUAGE%;;g" \
    -e "s;%INDEX-WHITELIST%;$ip;g" \
    -e "s;%SEARCH-WHITELIST%;$ip;g" \
    -e "s;%INDEXADMIN-WHITELIST%;$ip;g" \
    $file > $file.neu
  mv $file.neu $file
done

# some (optional) GERMAN settings
for file in ${config_files}; do
  sed \
      -e "s;ubermanager.console.defaultCountry=US;ubermanager.console.defaultCountry=DE;g" \
      -e "s;ubermanager.console.defaultLanguage=AMERICAN;ubermanager.console.defaultLanguage=GERMAN;g" \
      -e "s;swa.user.locale=en_US;swa.user.locale=de_DE;g" \
      -e "s;swa.user.preferredDateTimeFormat=1;swa.user.preferredDateTimeFormat=2;g" \
      -e "s;swa.user.dateSeparatorChar=/;swa.user.dateSeparatorChar=.;g" \
      -e "s;swa.user.weekStart=0;swa.user.weekStart=1;g" \
      -e "s;swa.user.defaultCalendarView=0;swa.user.defaultCalendarView=2;g" \
      ${file} > ${file}.new
    mv $file.new $file
done

[ -e /var/opt/scalix/scalix-config-backup-${pid} ] && scx_diff_config

# Write Ldappassword to psdata
file=${base}/caa/scalix.res/config/psdata
echo "$ldappwd" > ${file}
chown root:root $file
chmod 400 $file

# check files and permissions
file=$base/s/Copyright/OM-LDAP
[ -e $file ] || touch $file

omcheck -s | sh

cat << EOT

>>>> Step 4: setup apache, restart Scalix(-tomcat)

EOT
sleep 2

# Setup Apache
[ -e /etc/apache2/conf.d/scalix-web-client.conf ] || \
    ln -s /opt/scalix/global/httpd/scalix-web-client.conf /etc/apache2/conf.d/scalix-web-client.conf

cat << EOT > /etc/apache2/conf.d/scalix-access.conf
<Location />
        Allow from all
</Location>
EOT

file=/etc/opt/scalix-tomcat/connector/ajp/instance-$mnode.conf
if [ ! -e $file ]; then
  echo 'Include /etc/opt/scalix-tomcat/connector/ajp/app-*.conf' > $file
fi

files="/etc/opt/scalix-tomcat/connector/ajp/*-$mnode.*conf \
       /etc/opt/scalix-tomcat/connector/jk/*-$mnode.*conf"
for file in $files; do
  if [ -e $file ]; then
    sed -e 's;<VirtualHost;#<VirtualHost;g' \
        -e 's;</VirtualHost;#</VirtualHost;g' \
        $file > $file.neu
    mv $file.neu $file
  fi
done

/etc/init.d/apache2 restart

# Restart Tomcat
/etc/init.d/scalix-tomcat restart

cat << EOT
#####################################################
# You should now be able to access scalix at:
# http://$fqdn/sac
# http://$fqdn/webmail
#####################################################

EOT

if [ -e /var/opt/scalix/s.bak ]; then
cat << EOT

# restore your old scalix data-store with:
# - stop scalix             > for f in /etc/rc1.d/K*scalix*; do \$f stop; done
# - restore the data-store  > mv /var/opt/scalix/s.bak $base/s
# - and start scalix again  > for f in /etc/rc2.d/S*scalix*; do \$f start; done
#
for f in /etc/rc1.d/K*scalix*; do \$f stop; done
mv $base/s $base/s.new
mv /var/opt/scalix/s.bak $base/s
for f in /etc/rc2.d/S*scalix*; do \$f start; done
#
# if SAC Login fails, try this
ommodu sxqueryadmin -p $ldappwd

EOT
fi

Jetzt sollte man sich in o.g. URL als sxadmin und dem vorher definierten Password einloggen können. Als sxadmin kann man in der Scalix Admin Console (SAC) neue User anlegen.

Zuerst sollte man dem Scalix Mailserver zusätzlich die richtige (externe) Mail-Domain beibringen. Das trägt man unter "Einstellungen - Administration - Lokale Domains" ein. Bei mir sind 2 Einträge vorhanden

  • neobiker.de
  • Zuhause.xx


Um Ressourcen zu sparen, kann man den Speicherbedarf des Tomcat etwas zügeln (das ist im install-skript bereits eingebaut):

/etc/opt/scalix-tomcat/scalix-tomcat.conf

# Configuration file for Scalix Tomcat

# The directory where Java is installed
# (determined from /usr/bin/java managed by update-alternatives
# by default, change to hardcoded path if needed):
JAVA_HOME="`/opt/scalix-tomcat/bin/determine-java-home`"

# Additional arguments to be passed to Java:
JAVA_OPTS="-server -Xms40m -Xmx40m"

# Maximum number of file descriptors
ULIMIT_NUM_FILES="1000"

Webmail per DMZ-Proxy und SSL-Zugriff

Gesicherten Zugriff auf den Webmail Client von Scalix realisierte ich über einen Apache-Server in meiner DMZ. Hierzu installiert man das scalix-tomcat-connector Paket in der DMZ. In der Firewall muss Port 8009 von der DMZ zum Scalix-Server freigeschaltet werden.

dpkg -i scalix-tomcat-connector_11.0.4.25_all.deb

Standardmässig verwende ich SSL, das erzwinge ich mit einer Rewriting Regel in der Standardkonfiguration /etc/apache2/sites-enabled/000-default

NameVirtualHost *:80
<VirtualHost *:80>
...
        <IfModule mod_rewrite.c>
          <IfModule mod_ssl.c>
            <Location /webmail>
              RewriteEngine on
              RewriteCond %{HTTPS} !^on$ [NC]
              RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI}  [L]
            </Location>
          </IfModule>
        </IfModule>
...

</VirtualHost>


/etc/apache2/sites-enabled/000-default-ssl

NameVirtualHost *:443
<VirtualHost *:443>
        ServerName www-dmz.neobiker.de
        ServerAdmin webmaster@neobiker.de
        DocumentRoot /var/www/

        SSLEngine on
        # meine eigenen Certifikate meiner Server-CA
        SSLCertificateFile /etc/ssl/certs/dmz1_wwwCert.pem
        SSLCertificateKeyFile /etc/ssl/private/dmz1_www-Key.pem
        #SSLCertificateFile /etc/apache2/ssl/apache.pem
        #SSLCertificateKeyFile /etc/apache2/ssl/apache.pem

        SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>

        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride AuthConfig
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                RedirectMatch ^/$ /apache2-default/
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined

        <IfModule mod_proxy_ajp.c>
                Include /etc/opt/scalix-tomcat/connector/ajp/app-scx.*.conf
        </IfModule>

</VirtualHost>

Die Scalix-Proxy Konfigurationen: /etc/opt/scalix-tomcat/connector/ajp/app-scx.*.conf

/etc/opt/scalix-tomcat/connector/ajp/app-scx.sac.conf

        ProxyPass /sac ajp://scx.neobiker.lan:8009/sac

/etc/opt/scalix-tomcat/connector/ajp/app-scx.webmail.conf

        ProxyPass /webmail ajp://scx.neobiker.lan:8009/webmail

Unter Etch wird das Apache Modul mod_jk nicht mehr benötigt, da es von mod_proxy_ajp abgelöst wurde. Da ich das ajp-Modul selber in der SSL-Konfiguration includiere (vgl. oben), kommentiere ich es hier aus (entweder/oder):


/etc/apache2/conf.d/scalix-tomcat-connector.conf

# ---------------------------------------------------------------------------
# Configure on-the-fly deflate compression of the pages:
# ---------------------------------------------------------------------------

<Location />
  AddOutputFilterByType DEFLATE text/xml text/html text/css
  AddOutputFilterByType DEFLATE application/x-javascript
</Location>

# ---------------------------------------------------------------------------
# mod_proxy_ajp connector configuration
# ---------------------------------------------------------------------------

#<IfModule mod_proxy_ajp.c>
#  Include /etc/opt/scalix-tomcat/connector/ajp/app*.conf
#</IfModule>

# ---------------------------------------------------------------------------
# mod_jk connector configuration (part common to all platforms)
# ---------------------------------------------------------------------------

# Setup JK connector needed to run Tomcat under Apache server:

<IfModule mod_jk.c>

# Set the jk log level [debug/error/info]
JkLogLevel          info
# Select the log format
JkLogStampFormat   "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions          +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"

Include /etc/opt/scalix-tomcat/connector/jk/app-*.conf
Include /etc/opt/scalix-tomcat/connector/jk/workers.conf

</IfModule>

# ---------------------------------------------------------------------------
# mod_jk connector configuration (part specific to Debian)
# ---------------------------------------------------------------------------

<IfModule mod_jk.c>
# Where to put jk logs
# Update this path to match your logs directory location
# (put mod_jk.log next to access_log)
JkLogFile     /var/log/apache2/mod_jk.log
</IfModule>

Quellen

[1] Scalix Wiki: Manuelle Installation unter Etch

[2] Linux Magazin Online: Mail Server