Makefile for Scalix-Installation on Debian and Ubuntu

From Scalix Wiki
Jump to: navigation, search


The installation described and performed by the makefile is out of date on the Scalix 11 side. This still uses packages from the Community Preview, which are no longer current. Please download Scalix 11 Beta software instead from and follow the manual install instructions. The Makefile is community-maintained and needs to be updated before it can again be used to install Scalix 11. (Florian)

What is this?

This is a Makefile to install Scalix 10 CE Raw on a clean Base-Installation of Ubuntu. I testet it on different Systems, but it's 'very alpha'. So it's better to make a Backup (It's always nice to have a Backup, isn't it? ;).

For Scalix 11 preview there's another Makefile. But as the Download-Location and Packagenames changed in 11 beta, neither this Makefile nor the Makefile.11pre will work on that Version. I will fix this as soon as possible. If you already did, please let me know.


Activate univers and universe-security in /etc/apt/sources.list and run apt-get update. Without this, you can run into Dependency-Problems with the Package krb5-user


To use this Makefile, we need the Packages make, sed and wget. Sed and wget should be included in the Base-Installation.

apt-get install make wget sed

You can download this Makefile from Chmod to 0400, because it contains the Cleartext-Password for the Admin-Users

[ -d /opt/scalix_install ] || ( mkdir /opt/scalix_install && cd /opt/scalix_install/ && \
wget && \
chown root:root Makefile && chmod 0400 Makefile)


Get the Java JDK 5.0 Update 6 from and save the jdk-1_5_0_06-linux-i586.bin in /opt/scalix_install/pkg

Be sure to make jdk-1_5xxx executable.

chmod +x jdk-1_5_0_06-linux-i586.bin

Info: The Makefile deletes existing alternatives of java and javc!

Edit the Makefile

You have to set some Variables to fit it to your needs.

The Admin-Password

ADMIN_PASSWD := verysecret

Domain- and Hostname of your Host. Check it by typing hostname -f

DOMAINNAME := localdomain
HOSTNAME := scalix

Mailnode and Standard-Maildomain

MAILNODE := testfirma

Optional Settings

See Wiki for Details

CN_RULE := 'S, G'

Java and Tomcat-Versions

JAVAPKG_DIR := pkg/jdk-1_5_0_06-linux-i586.bin
JAVAPKG_DOTDIR := jdk1.5.0_06
TOMCAT_VER := jakarta-tomcat-5.0.28


To install, type

make with_java

If you allready have java installed (I just need this for reinstalling Scalix), type

make without_java

To remove the installation

make very_clean

this does not remove Java


Try http://localhost:8080/sac and login with User: sxadmin and your Password

Try http://localhost:8080/webmail and do the same


Sometimes the files or are empty after running the Makefile.



## Makefile for Scalix Community Edition Raw 10 on Ubuntu - v0.3
## (c) 2006 - Ralf Nickel, -
## based on
## only tested on a Base-Installation on Ubuntu Dapper Drake beta, Hoary and Breezy

## Changes
## 07/27/06 - checking existing Directories in 'prepare'
##          - Changed libapache2-mod-jk2 to libapache2-mod-jk in 'dubidu_depends' - Djdicbob
##          - /opt/scalix_install replaced everywhere by $(INST_PREFIX)
##          - forcing creation of Symlinks - Reinier
##          - forcing removal of Files and Symlinks - Reinier

## Directory of this Makefile
INST_PREFIX := /opt/scalix_install
# Where is the Scalix-Installation
SCALIX_PREFIX := /opt/scalix

JAVAPKG_DIR := pkg/jdk-1_5_0_06-linux-i586.bin
JAVAPKG_DOTDIR := jdk1.5.0_06

# Tomcat-Package
TOMCAT_VER := jakarta-tomcat-5.0.28
TOMCAT_PKG := pkg/$(TOMCAT_VER).tar.gz
TOMCAT_LINK := /opt/scalix-tomcat

# Admins
ADMIN_USER := sxadmin
# LDAP-Admin
QUERYADMIN_USER := sxqueryadmin
# I simply use same Password for both Admins. 
ADMIN_PASSWD := geheim

# Domain- and Hostname for this Host
# check with 'hostname -f'
DOMAINNAME := localdomain
HOSTNAME := scalix

# CE Raw - just one Mailnode
MAILNODE := testfirma
# Default Maildomain

# see for details
CN_RULE := 'S, G'

	@echo -e "Download Java JDK1.5 from \n\nsave it to $(INST_PREFIX)/pkg and run \n# make with_java or \n# make without_java"

with_java: dubidu_depends java_sdk prepare scalix-tomcat scalix_inst scalix_setup add_sxgroups \
	add_tweaks start_allom tomscal_conf conf_ubermanager \ restart_tomcat config_apache2
without_java: dubidu_depends prepare scalix-tomcat scalix_inst scalix_setup add_sxgroups \
	add_tweaks start_allom tomscal_conf conf_ubermanager \ restart_tomcat config_apache2

	/etc/init.d/scalix stop
	/etc/init.d/scalix-tomcat stop
	apt-get --yes remove --purge scalix-res* scalix-sac* scalix-server* scalix-swa*
	rm -drf /etc/opt/scalix
	rm -drf /var/opt/scalix
	rm -drf $(TOMCAT_LINK)
	rm -drf $(SCALIX_PREFIX)
	rm -f /etc/init.d/scalix-tomcat
	rm -f /etc/apache2/conf.d/scalix-web-client.conf
	update-rc.d scalix-tomcat remove

## Packages for Ubuntu

	apt-get install apache2 libapache2-mod-jk gawk krb5-config krb5-doc krb5-user libkadm55 libkrb53 libglib2.0-0 \
	libstdc++2.10-glibc2.2 libxml2 sgml-base xml-core libsasl2-modules libsasl2-gssapi-mit sendmail elinks

## Get Packages
	cd $(INST_PREFIX)/pkg && \
	wget \ \ \ \ \
## Get Tomcat Startscript
	[ -d $(INST_PREFIX)/init.d ] || ( mkdir $(INST_PREFIX)/init.d && \
	cd $(INST_PREFIX)/init.d/ && \
	wget )
## Get Tweaks
	[ -d $(INST_PREFIX)/tweaks ] || ( mkdir $(INST_PREFIX)/tweaks && \
	cd $(INST_PREFIX)/tweaks/ && \
	wget )

## install JDK in /usr/local/lib/java and set alternatives
# !! existing alternatives will be deleted !!!
	cd /usr/local/lib && $(INST_PREFIX)/$(JAVAPKG_DIR) && ln -sf $(JAVAPKG_DOTDIR) java
	update-alternatives --remove-all java
	update-alternatives --remove-all javac
	update-alternatives --install /usr/bin/java java /usr/local/lib/java/bin/java 120
	update-alternatives --install /usr/bin/javac javac /usr/local/lib/java/bin/javac 120

## install Tomcat in /opt and symlink to $(TOMCAT_LINK)
## you have to set your RAM-Settings
	cd /opt && tar xpzf $(INST_PREFIX)/$(TOMCAT_PKG) && ln -sf $(TOMCAT_VER) scalix-tomcat
	rm -f $(TOMCAT_LINK)/common/endorsed/xml-apis.jar
	cp $(TOMCAT_LINK)/bin/ $(TOMCAT_LINK)/bin/setclasspath.bak
	@echo -e "PATH=$(PATH):$(SCALIX_PREFIX)/bin \nJAVA_HOME=/usr/local/lib/java \nJAVA_OPTS='-server -Xms128m -Xmx128m' \nexport JAVA_HOME JAVA_OPTS\n" > $(TOMCAT_LINK)/bin/
	cat $(TOMCAT_LINK)/bin/setclasspath.bak >> $(TOMCAT_LINK)/bin/
	cp init.d/scalix-tomcat /etc/init.d/
	chown root:root /etc/init.d/scalix-tomcat
	chmod 755 /etc/init.d/scalix-tomcat
	update-rc.d scalix-tomcat defaults 22

## Install Scalix
	dpkg -i pkg/*.deb

## Chapter 5.2 to 5.11 of Wiki
	$(SCALIX_PREFIX)/bin/sxconfig --set -t general.usrl_cn_rule=$(CN_RULE)
	$(SCALIX_PREFIX)/bin/sxconfig --set -t general.usrl_authid_rule=$(AUTHID_RULE)
	$(SCALIX_PREFIX)/bin/sxconfig --set -t orniasys.name_part_1='"C" <G.S>' -t orniasys.domain_part_1='$(MAILDOMAIN)'
	$(SCALIX_PREFIX)/bin/omaddmn -m $(MAILNODE)
	$(SCALIX_PREFIX)/bin/omrc -n
	$(SCALIX_PREFIX)/bin/omaddu -n "$(ADMIN_USER)/$(MAILNODE)" --class limited -c admin -p $(ADMIN_PASSWD) $(ADMIN_USER)
	$(SCALIX_PREFIX)/bin/omlimit -u "$(ADMIN_USER)/$(MAILNODE)" -o -i 0 -m 0

	$(SCALIX_PREFIX)/bin/omaddpdl -l ScalixUserAdmins/$(MAILNODE)
	$(SCALIX_PREFIX)/bin/omaddpdl -l ScalixGroupAdmins/$(MAILNODE)
	$(SCALIX_PREFIX)/bin/omaddpdl -l ScalixUserAttributesAdmins/$(MAILNODE)
	$(SCALIX_PREFIX)/bin/omaddpdl -l ScalixAdmins/$(MAILNODE)

	cat tweaks/general.cfg >> /var/opt/scalix/sys/general.cfg

	$(SCALIX_PREFIX)/bin/omon -s all

	cp $(SCALIX_PREFIX)/web/scalix-res.xml    $(TOMCAT_LINK)/conf/Catalina/localhost
	cp $(SCALIX_PREFIX)/web/scalix-admin.xml  $(TOMCAT_LINK)/conf/Catalina/localhost
	cp $(SCALIX_PREFIX)/web/scalix-caa.xml    $(TOMCAT_LINK)/conf/Catalina/localhost
	cp $(SCALIX_PREFIX)/web/scalix-swa.xml    $(TOMCAT_LINK)/conf/Catalina/localhost
	cp $(SCALIX_PREFIX)/web/scalix-webcal.xml $(TOMCAT_LINK)/conf/Catalina/localhost

## configure Scalix
## Set Domain and Host
	cat /etc/opt/scalix/webmail/ \
	    | sed -e 's/%LOCALHOST%/$(HOSTNAME).$(DOMAINNAME)/g' \
	    | sed -e 's/%LOCALDOMAIN%/$(DOMAINNAME)/g' \
	    > /etc/opt/scalix/webmail/

	cat /etc/opt/scalix/caa/scalix.res/config/ \
	    | sed -e 's/__SECURED_MODE__/false/g' \
	    | sed -e 's/__FQHN_FOR_KDC_HOST__//g' \
	    | sed -e 's="ubermanager/__FQHN_HOST__@__KERBEROS_REALM__"==g' \
	    | sed -e 's/__KERBEROS_REALM__//g' \
	    | sed -e 's/__FQHN_QUERY_SERVER_NAME__/$(HOSTNAME).$(DOMAINNAME)/g' \
	    | sed -e 's/__UBERMGR_USE_EXTERNAL_AUTH__/false/g' \
	    | sed -e 's/__UBERMGR_ALLOW_EXTERNAL_AUTH__/false/g' \
	    | sed -e 's/__UBERMGR_MAXLIST_SIZE__/100/g' \
	    | sed -e 's/__UBERMGR_MAIL_DOMAINS_LIST__/$(MAILDOMAIN)/g' \
	    | sed -e 's/__UBERMGR_EXTERNAL_DOMAIN_AUTH_LIST__//g' \
	    | sed -e 's/__CONFIGURED__/true/g' \
	    > /etc/opt/scalix/caa/scalix.res/config/
	    echo $(ADMIN_PASSWD) > /etc/opt/scalix/caa/scalix.res/config/psdata
	    chmod 400 /etc/opt/scalix/caa/scalix.res/config/psdata
	    chown root:root /etc/opt/scalix/caa/scalix.res/config/psdata
	cat /etc/opt/scalix/res/config/ \
	    | sed -e 's/__SECURED_MODE__/false/g' \
	    | sed -e 's/__FQHN_FOR_UBERMANAGER__/$(HOSTNAME).$(DOMAINNAME)/g' \
	    | sed -e 's/__TOMCAT_PORT__/$(TOMCAT_PORT)/g' \
	    | sed -e 's/__KERBEROS_REALM__//g' \
	    | sed -e 's/__FQHN_FOR_KDC_HOST__//g' \
	    | sed -e 's/__CONFIGURED__/true/g' \
	    > /etc/opt/scalix/res/config/

	/etc/init.d/scalix-tomcat restart

## Configure Apache2
	ln -sf $(SCALIX_PREFIX)/global/httpd/scalix-web-client.conf /etc/apache2/conf.d
	/etc/init.d/apache2 restart