Setup Open-Xchange on 1und1 Root Server (SUSE Linux Professional 9.0)
1st of all:
Thanks to ALL the people out there who mailed me and helped with their infos about this HOWTO. It helped much to improve this Document!
If u have suggestions to this HOWTO or found a bug in this Document.Contact me at :
themes_AT_cutmasta_DOT_org
Open-Xchange ("www.open-xchange.org") - GPL Groupware solution from Netline.
I
U need a RootServer , with Apache2 and Courier IMAP or Cyrus IMAP working properly.
It u dont have a running IMAP Server, install Courier IMAP or Cyrus IMAP.
This Doc covers the install for OX with courier and postfix!
1. Get neccessary Software
1.1 Make a working dir:
- mkdir build_the_ox
So every pack u download , move it in that dir for better use.
1.1.1 Get open-Xchange Server
Download from http://mirror.open-xchange.org/ox/EN/community/download.htm
- open-xchange-x.x.x.tar.bz2
1.1.2
Install the rpm "sudo2 via yast.
Needed by the init.d script of OX.
1.2 Perl
As confixx is installed on your rooty most of the perl modules are already installed!
But one is missing, so install the following perl rpm(s) via yast:
- perl-ldap
- perl-Cyrus-IMAP (optional, if u use cyrus imap and want to write some scripts for addign users)
- perl-Cyrus-SIEVE-managesieve (optional, if u use cyrus imap and want to write some scripts for sieve filters)
1.3 Postgresql Database
Install(not start) the following rpm(s) via yast:
- postgresql
- postgresql-server
1.4 OpenLDAP Server
Install(not start) the following rpm(s) via yast:
- openldap2
1.5 Java
Download and install Java from SUN Website (http://java.sun.com/j2se/1.4.2/download.html) :
- j2sdk-1_4_2_05-linux-i586.rpm.bin
After downloading do:
chmod +x j2sdk-1_4_2_05-linux-i586.rpm.bin
./j2sdk-1_4_2_05-linux-i586.rpm.bin
This will extract the rpm from the package!
Install the rpm with:
rpm -i j2sdk-1_4_2_05-linux-i586.rpm
After installing, Java is now located in:
/usr/java/j2sdk1.4.2_05
Make a symlink for easier later use:
ln -s /usr/java/j2sdk1.4.2_05/ /usr/lib/java
Edit your .bashrc or .profile :
JAVA_HOME=/usr/lib/java
export PATH=$PATH:$JAVA_HOME/bin
Get the needed Jars :
PostgreSQL JDBC connector:
http://jdbc.postgresql.org/download.html and download pg74.215.jdbc3.jar
cp pg74.215.jdbc3.jar /usr/lib/java/lib/jdbc.jar
mail.jar:
http://java.sun.com/products/javamail/downloads/index.html and download javamail-1_3_1-upd.zip.
unzip javamail-1_3_1-upd.zip
cp mail.jar /usr/lib/java/lib/mail.jar
activation.jar:
http://java.sun.com/products/javabeans/glasgow/jaf.html and download jaf-1_0_2-upd.zip.
unzip jaf-1_0_2-upd.zip
cp activation.jar /usr/lib/java/lib/activation.jar
jdom.jar:
http://www.jdom.org/dist/binary/ and download jdom-b10.tar.gz
tar xvzf jdom-b10.tar.gz
compile jdom
copy the extracted jdom.jar to /usr/lib/java/lib/
jsdk.jar:
http://java.sun.com/products/servlet/archive.html,
download Java Servlet Development Kit 2.0 for Solaris.
- jsdk20-solaris2-sparc.tar.Z
tar xvzf jsdk20-solaris2-sparc.tar.Z
cp JSDK2.0/lib/jsdk.jar /usr/lib/java/lib/jsdk.jar
Install ant rpm via yast :
- apache-ant
Yast will say that it has dependcies on jdk or so, click ignore!
Install jikes rpm via yast :
- jikes
Yast will say that it has dependcies , click ignore!
1.6 make
If not already installed, install make via yast rpm:
- make
1.7 Tomcat Server
Donwload and install Tomcat from http://jakarta.apache.org/site/binindex.cgi :
- jakarta-tomcat-5.0.28.tar.gz
1.8 mod_jk2 for Apache2
Download and mod_jk2 from http://ftp.plusline.de/ftp.apache.org/jakarta/tomcat-connectors/jk2/binaries/linux/ :
- Suse-9.0-i386.tar.gz
2. Installing the Software
1.0 Install Tomcat Server
- cd build_the_ox
- tar xvzf jakarta-tomcat-5.0.28.tar.gz
- cd jakarta-tomcat-5.0.28
- export JAVA_HOME=/usr/lib/java (if not logged in since changing .bashrc)
- sh bin/catalina.sh start
- wait some seconds to let the beast start!
Go to http://yourrootserverurl:8080
and check if its running.If not
read tomcat Docs. But it should work!
Create dirs in your tomcat installation directory :
mkdir -p webapps/servlet/WEB-INF/lib
mkdir -p webapps/servlet/WEB-INF/classes
Create file webapps/servlet/WEB-INF/web.xml :
Servlet OpenXchange
Servlet OpenXchange 0.7.0
intranetintranetOX GroupwareOXwebmailwebmailOX WebmailOXintranet/intranetwebmail/webmail
1.1 Install mod_jk2
- cd build_the_ox
- tar xvzf Suse-9.0-i386.tar.gz
- cd Suse-9.0-i386
- cp etc/apache2/conf.d/jk2.conf /etc/apache2/conf.d/
- cp etc/apache2/workers2.properties /etc/apache2/
- cp usr/lib/httpd/modules/* /usr/lib/apache2/
Change /etc/apache2/workers2.properties as following :
# Map the Tomcat examples webapp to the Web server uri space
[uri:yourservername.com/servlet/*]
group=lb
1.2 Install Database
- rcpostgresql start
- su postgres
- createuser openexchange
- exit
- vi /var/lib/pgsql/data/pg_hba.conf
Add following entries:
host all all 127.0.0.1 255.255.255.255 trust
local all all trust
- edit /etc/sysconfig/postgresql and set :
POSTGRES_OPTIONS="-i"
When you dont do that, postgres wont accept tcp/ip connections!!
- rcpostgresql restart
Create Database for OX:
- createdb -E UNICODE -U openexchange openexchange
1.3 Install OX
Unpack the tarball.
- tar xvjf open-xchange-x.x.x.tar.bz2
- cd open-xchange-x.x.x
Configure the OX:
./configure --prefix=/opt/openexchange \
--with-mailjar=/usr/lib/java/lib/mail.jar \
--with-activationjar=/usr/lib/java/lib/activation.jar \
--with-jdomjar=/usr/lib/java/lib/jdom.jar \
--with-jsdkjar=/usr/lib/java/lib/jsdk.jar \
--with-jdbcjar=/usr/lib/java/lib/jdbc.jar \
Build the OX:
make ; make install
Now OX is built to /opt/openexchange (PREFIX)
- cd PREFIX
- cp share/servlets/*.class /root/build_the_ox/jakarta-tomcat-5.0.28/webapps/servlet/WEB-INF/classes/
- cp lib/* /root/build_the_ox/jakarta-tomcat-5.0.28/webapps/servlet/WEB-INF/lib/
- cp share/perl/* /srv/www/cgi-bin/
- cp share/openxchange.schema /etc/openldap/schema/
- vi etc/admintools.conf
Now move the images,css,javascript to your Webroot
so that you can access it.
- mkdir -p /srv/www/htdocs/cfintranet/webmail/
- cp -r share/groupware/data/css share/groupware/data/images share/groupware/data/javascript /srv/www/htdocs/cfintranet/
- cp -r share/webmail/data/css share/webmail/data/images share/webmail/data/javascript /srv/www/htdocs/cfintranet/webmail
Edit some parameter:
ORGA="YOUR ORGANISATION"
# LDAP Admin
BINDDN="uid=admin,dc=YOURDOMAIN,dc=DE"
# LDAP Admin Passwd
BINDPW="secret"
- cd etc/webmail/
- ln -s /etc/openldap/ldap.conf
- cd ../groupware
- ln -s /etc/openldap/ldap.conf
- cd ../../
- vi /etc/openldap/ldap.conf
Edit like this:
BASE dc=YOURDOMAIN,dc=DE
HOST 127.0.0.1
- vi share/init_ldap.ldif
Edit and replace dc=example,dc=org with
dc=YOURDOMAIN,dc=DE.
And also the first Object like this:
dn: dc=cutmasta,dc=org
objectClass: dcObject
objectClass: organization
o: Cutmasta Inc.
dc: cutmasta
Dump in the SQL File.
- psql -U openexchange < share/init_database.sql
1.4 Install Openldap
- vi /etc/openldap/slapd.conf
Add the schemas needed by OX:
include /etc/openldap/schema/cosine.schema
include /etc/openldap/schema/nis.schema
include /etc/openldap/schema/inetorgperson.schema
include /etc/openldap/schema/openxchange.schema
Create dir /var/lib/ldap/ox and do a chown on it.
- chown -R ldap:ldap ox
Add a new Database for OX.
I used to include the Database defintion at the end of
file /etc/openldap/slapd.conf,you can also add it in your
existing slapd.conf. I do that for better overview of ldap config :
Include /etc/openldap/slapd_ox.conf
Add following lines in /etc/openldap/slapd_ox.conf :
# Define global ACLs to disable default read access.
access to *
by peername="ip=127\.0\.0\.1" read
by users read
by * none
database ldbm
suffix "dc=YOURDOMAIN,dc=DE"
rootdn "uid=admin,dc=YOURDOMAIN,dc=DE"
rootpw secret
directory /var/lib/ldap/ox
index objectClass eq
index uid,mailEnabled,cn,sn,givenname,lnetMailAccess,alias,loginDestination eq,sub
# allow rootDSE queries
access to dn=""
by * read
# To let PAM authenticate
access to attr=userpassword
by self write
by peername="ip=127\.0\.0\.1" read
by anonymous auth
by * none
access to attr=shadowLastChange
by self write
by * read
Now comment the unused Database entries from slapd.conf like:
#database ldbm
#suffix "dc=my-domain,dc=com"
#rootdn "cn=Manager,dc=my-domain,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoid. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
#rootpw secret
# The database directory MUST exist prior to running slapd AND
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
#directory /var/lib/ldap
# Indices to maintain
#index objectClass eq
Now start the OpenLDAP Server:
- rcldap start
If you get an error concerning "manager" not found.
Go to the schema the erros says and remove the "manager"
attrib (the "MAY" ones) from the objectclasses.
The best is to grep for "manager" through the schemas!
- rcldap restart
Now ldap should be up and running.
Now we want to make sure that only localhost can access LDAP.
Edit /etc/init.d/ldap and change :
SLAPD_URLS="ldap://127.0.0.1
- rcldap restart
Now only localhost can access the Data from LDAP. Not the best solution, but
it works!If u are paranoid , install iptables!!
- cd /opt/openexchange/share/
Insert the initial LDAP (init_ldap.ldif) Ldif
found in /opt/openexchange/share :
- slapadd -l init_ldap.ldif
This command should result no errors!
- rcldap restart
Now test the ldap and search for the entries already inserted:
- ldapsearch -x -b dc=YOURDOMAIN,dc=DE
Should return a bunch of Data!
1.5 Insert first User
Now u have to insert the exact same pop users as in confixx are.
Normally called something like "web0p16" or so.
Go to /opt/openexchange/sbin/ and add a User:
./adduser_ox --username=web0p16 \
--passwd=secret \
--name=foo \
--sname=bar \
--maildomain=YOURDOMAIN.DE \
--ox_timezone=Europe/Berlin
1.6 Restart all Services!
Now its time to pray :)
Restart ldap,apache,tomcat like:
- rcapache2 restart
- rcldap restart
- cd build_the_ox/jakarta-tomcat-5.0.28/bin/
- sh catalina.sh stop
- sh catalina.sh start
When all services are running its time to start the OX Daemons.
- /opt/openxchange/etc/init.d/sessiond start
- /opt/openxchange/etc/init.d/webmail start
- /opt/openxchange/etc/init.d/groupware start
Copy the script to your systems /etc/init.d/ dir to start
them on server startup.
Now point your browser to http://yourservername.com/cgi-bin/login.pl
The Loginmask should be displayed!
If there are errors, see in /srv/www/cgi-bin/login.pm
and check i u have installed all needed perl modules!
If no errors occured.
U should be inside the OX Groupware now!
If you want only to use the webmailer, just edit the login.pm like the following diff:
114c114
< print $cgi->start_table({-style=> 'border:1px #a2b3c6; border-style:solid;', -cellspacing => 0, -cellpadding => 0, -bgcolor => '#e5ecf5'});
---
> print $cgi->start_table({-style=> 'border:1px #a2b3c6; border-style:solid;',-cellspacing => 0, -cellpadding => 0, -bgcolor => '#e5ecf5'});
160a161
> print " ";
164c165
<
---
>
170,174d170
< print $cgi->start_Tr();
< print $cgi->start_td({align => "right"});
< print $cgi->font("http://www.openexchange.com");
< print $cgi->end_td();
< print $cgi->end_Tr();
193c189
<
---
> my $desti = $cgi->param('destination');
274c270
< $data{LANG} = 'EN';
---
> $data{LANG} = 'DE';
298d293
<
300,303c295,306
< print $cgi->header(-charset => 'utf-8', -Refresh => '0; URL=/servlet/intranet?SITE=beforeAuth&sessionID='.$ID);
< print $cgi->start_html(-title => '$appname', -bgcolor => '#ffffff', -align => 'center');
< print 'Redirecting to Groupware ... ';
< print "SessionID: $ID ";
---
>
>
> if ($desti eq 'webmail') {
> print $cgi->header(-charset => 'utf-8', -Refresh => '0; URL=/servlet/webmail?SITE=mauth&sessionID='.$ID);
> }
>
> if ($desti eq 'groupware') {
> print $cgi->header(-charset => 'utf-8', -Refresh => '0; URL=/servlet/intranet?SITE=beforeAuth&sessionID='.$ID);
> }
>
> print $cgi->start_html(-title => 'Forwarding...', -bgcolor => '#ffffff', -align => 'center');
> print "Forwarding to $desti ... ";
A nice theme for OX groupware can be found on : http://ox.cutmasta.org
If u have suggestions to this HOWTO or found a bug in this Document.Contact me at :
themes_AT_cutmasta_DOT_org