Someone should remove my earlier post (20.06.06). It's obsolete.
For everybody some instructions for an installation without trouble: (This works for me - no guarantee that it works for you.)
1.) get all files from
http://smeserver.free.fr/files/index.php?dir=open-xchange/ox7/ (thx to vincent who did and is still doing a great job!) You'll probably need only one icon-set.
2.) Change in /etc/e-smith/templates/etc/httpd/conf/httpd.conf the template 86WebShareAlias in:
- snip
local %WebShare;
# tie %WebShare, 'esmith::config', '/home/e-smith/WebShare';
tie %WebShare, 'esmith::config', '/home/e-smith/db/WebShare';
my $webshare;
- snip
expand-template /etc/httpd/conf/httpd.conf
/etc/init.d/httpd-e-smith restart
see the bug list for this. Thx to Ray.
3.) install from a local directory with yum localinstall *.rpm
4.) in the case that files are missing, get them from
http://mirror.centos.org/centos/4/os/i386/CentOS/RPMS/4.1.) run again yum localinstall *.rpm
5.) don't forget signal-event post-upgrade/reboot!
6.) now proceed with this (thx to Jay!):
### Clean up postgres
service postgresql stop
cd /var/lib/pgsql
rm -rf *
service postgresql start
service postgresql stop
expand-template /var/lib/pgsql/data/postgresql.conf
expand-template /var/lib/pgsql/data/pg_hba.conf
service tomcat restart
service postgresql restart
service open-xchange restart
#### Kick LDAP
service ldap stop
rm /home/e-smith/db/ldap/*ldif
rm /var/lib/ldap/*
signal-event ldap-update
service ldap restart
7.) Modify the /usr/local/open-xchange/share/rebuild_db.sh: missing user "postgres". Here's the correct script:
#!/bin/bash
# create de postgresql database for OX
# by filali.v@free.fr
# Vincent FILALI-ANSARY
#
[ ! -d /home/e-smith/db/pgsql ] && mkdir /home/e-smith/db/pgsql
su postgres -c'pg_dump -Fc -b openexchange -v' >/home/e-smith/db/pgsql/openexchange.sql.back
su - -c'dropdb openexchange' postgres
su - -c'dropuser openexchange' postgres
su - -c'createdb -e --template=template0 -E UNICODE -e openexchange' postgres
su - -c'psql -a -e -d openexchange -e -f /usr/local/open-xchange/share/createuser.sql' postgres
#su - -c'createuser -A -d -P -E -e openexchange' postgres
#su - -c'createdb -O openexchange -E UNICODE -e openexchange' postgres
su - -c'psql -a -e -d openexchange -f /usr/local/open-xchange/share/init_database.sql' postgres
su - -c'psql -a -e -d openexchange -f /usr/local/open-xchange/share/admin_last.sql' postgres
if [ -x /usr/local/open-xchange/share/add_syncml_db.sh ]; then
. /usr/local/open-xchange/share/add_syncml_db.sh
fi
8.) Modify /usr/local/open-xchange/sbin/backup_ox: Here's the correct script:
#!/bin/bash
#
# by vincent Filali-ansary filali.v@free.fr
#
PATH=/usr/local/sbin:$PATH
export PATH
function OXbackup() {
DOM=`/sbin/e-smith/db configuration get DomainName`
service ldap restart 2>&1 >/dev/null
cp -f /home/e-smith/db/ldap/${DOM}.ldif /home/e-smith/db/ldap/${DOM}.ldif.bak
[ ! -d /home/e-smith/db/pgsql ] && mkdir /home/e-smith/db/pgsql
su postgres -c'pg_dump -Fc -b openexchange -v' > /home/e-smith/db/pgsql/ox_${DOM}.sql
[ ! -d /home/e-smith/open-xchange ] && mkdir /home/e-smith/open-xchange
/usr/bin/rsync -aur --delete /usr/local/open-xchange/var /home/e-smith/open-xchange
}
function OXbackupHa() {
DOM=`/sbin/e-smith/db configuration get DomainName`
service ldap restart 2>&1 >/dev/null
cp -f /home/e-smith/db/ldap/${DOM}.ldif /home/e-smith/db/ldap/${DOM}.ldif.bak
[ ! -d /home/e-smith/files/db/ldap ] && mkdir -p /home/e-smith/files/db/ldap
cp -f /home/e-smith/db/ldap/${DOM}.ldif /home/e-smith/files/db/ldap/${DOM}.ldif
cp -f /home/e-smith/db/ldap/${DOM}.ldif /home/e-smith/files/db/ldap/${DOM}.ldif.bak
[ ! -d /home/e-smith/db/pgsql ] && mkdir /home/e-smith/db/pgsql
su postgres -c'pg_dump -Fc -b openexchange -v' > /home/e-smith/db/pgsql/ox_${DOM}.sql
[ ! -d /home/e-smith/files/db/pgsql ] && mkdir -p /home/e-smith/files/db/pgsql
su postgres -c'pg_dump -Fc -b openexchange -v' > /home/e-smith/files/db/pgsql/ox_${DOM}.sql
[ ! -d /home/e-smith/open-xchange ] && mkdir /home/e-smith/open-xchange
/usr/bin/rsync -aur --delete /usr/local/open-xchange/var /home/e-smith/open-xchange
[ ! -d /home/e-smith/files/saves/open-xchange ] && mkdir -p /home/e-smith/files/saves/open-xchange
/usr/bin/rsync -aur --delete /usr/local/open-xchange/var /home/e-smith/files/saves/open-xchange
}
# check for heartbeat system
if [ -x /usr/local/sbin/getnode ]; then
MYNODE=`getnode`
HERIP=`getnode --mirror --ip`
HERNAME=`getnode --mirror`
# first thing verify if whe are the active node
ACTIV=`/sbin/e-smith/db heartbeat getprop nodes Active`
if [ $MYNODE == $ACTIV ]; then
OXbackupHa
fi
else
OXbackup
fi
8.) Modify /usr/local/open-xchange/sbin/restore_ox: Here's the correct script:
#!/bin/bash
PATH=/usr/local/sbin:$PATH
export PATH
function StopServices() {
#########################################################################
[ -x /etc/rc.d/init.d/oxserve-scandir ] && /etc/init.d/oxserve-scandir stop 2>&1 >/dev/null
[ -x /etc/rc.d/init.d/oxserve-index ] && /etc/init.d/oxserve-index stop 2>&1 >/dev/null
service open-xchange stop 2>&1 >/dev/null
service postgresql stop 2>&1 >/dev/null
service ldap stop 2>&1 >/dev/null
}
function StartServices() {
#########################################################################
service service postgresql start 2>&1 >/dev/null
service service ldap start 2>&1 >/dev/null
service open-xchange start 2>&1 >/dev/null
[ -x /etc/rc.d/init.d/oxserve-scandir ] && service oxserve-scandir start 2>&1 >/dev/null
[ -x /etc/rc.d/init.d/oxserve-index ] && service oxserve-index start 2>&1 >/dev/null
}
function RestoreOX() {
DOMAIN=`/sbin/e-smith/db configuration get DomainName`
if [ -z $DOMAIN ]; then
echo "error : the domain is unknow"
exit 1
fi
if [ ! -f /home/e-smith/db/pgsql/ox_$DOMAIN.sql ]; then
echo "error : "
echo "file /home/e-smith/db/pgsql/ox_$DOMAIN.sql doesn't exists, unable to restore"
exit 1
fi
if [ ! -f /home/e-smith/db/ldap/$DOMAIN.ldif.bak ]; then
echo "error : "
echo "file /home/e-smith/db/ldap/$DOMAIN.ldif.bak doesn't exists, unable to restore"
exit 1
fi
if [ ! -d /home/e-smith/open-xchange ]; then
echo "error : "
echo "files /home/e-smith/open-xchange/ doesn't exists, unable to restore"
exit 1
fi
StopServices
##########################################################################
# LDAP
rm -f /var/lib/ldap/*
slapadd -l /home/e-smith/db/ldap/$DOMAIN.ldif.bak
chown -R ldap:ldap /var/lib/ldap
service ldap start 2>&1 >/dev/null
###########################################################################
# Postgresql
/sbin/e-smith/expand-template /var/lib/pgsql/data/postgresql.conf
/sbin/e-smith/expand-template /var/lib/pgsql/data/pg_hba.conf
chown -R postgres:postgres /var/lib/pgsql
chmod 600 /var/lib/pgsql/data/postgresql.conf
chmod 600 /var/lib/pgsql/data/pg_hba.conf
service postgresql start 2>&1 >/dev/null
su postgres -c'pg_dump -Fc -b openexchange -v' > /home/e-smith/db/pgsql/openexchange.sql.bak
su - -c'dropdb openexchange' postgres
su - -c'dropuser openexchange' postgres
su - -c'createdb --template=template0 -E UNICODE -e openexchange' postgres
su - -c'psql -a -e -d openexchange -e -f /usr/local/open-xchange/share/createuser.sql' postgres
rm -f /tmp/temp_ox.sh
cat <<-EOF >/tmp/temp_ox.sh
#!/bin/bash
su postgres -c'pg_restore -d openexchange -v /home/e-smith/db/pgsql/ox_${DOMAIN}.sql'
EOF
chmod 755 /tmp/temp_ox.sh
exec /tmp/temp_ox.sh
rm -f /tmp/temp_ox.sh
# check for an upgrade
if [ -x /usr/local/open-xchange/share/upgrades/check4upgrade.sh ]; then
/usr/local/open-xchange/share/upgrades/check4upgrade.sh
fi
###############################################################################
# FILES
/usr/bin/rsync -aur --delete /home/e-smith/open-xchange/var /usr/local/open-xchange
StartServices
}
##############################################################################################################################################
function RestoreOXHA() {
DOMAIN=`/sbin/e-smith/db configuration get DomainName`
if [ -z $DOMAIN ]; then
echo "error : the domain is unknow"
exit 1
fi
if [ ! -f /home/e-smith/files/db/pgsql/ox_$DOMAIN.sql ]; then
echo "error : "
echo "file /home/e-smith/files/db/pgsql/ox_$DOMAIN.sql doesn't exists, unable to restore"
exit 1
fi
if [ ! -f /home/e-smith/files/db/ldap/$DOMAIN.ldif.bak ]; then
echo "error : "
echo "file /home/e-smith/files/db/ldap/$DOMAIN.ldif.bak doesn't exists, unable to restore"
exit 1
fi
if [ ! -d /home/e-smith/files/saves/open-xchange ]; then
echo "error : "
echo "files /home/e-smith/files/saves/open-xchange/ doesn't exists, unable to restore"
exit 1
fi
StopServices
##########################################################################
# LDAP
rm -f /var/lib/ldap/*
slapadd -l /home/e-smith/files/db/ldap/$DOMAIN.ldif.bak
chown -R ldap:ldap /var/lib/ldap
service ldap start 2>&1 >/dev/null
###########################################################################
# Postgresql
/sbin/e-smith/expand-template /var/lib/pgsql/data/postgresql.conf
/sbin/e-smith/expand-template /var/lib/pgsql/data/pg_hba.conf
chown -R postgres:postgres /var/lib/pgsql
chmod 600 /var/lib/pgsql/data/postgresql.conf
chmod 600 /var/lib/pgsql/data/pg_hba.conf
service postgresql start 2>&1 >/dev/null
su postgres -c'pg_dump -Fc -b openexchange -v' > /home/e-smith/files/db/pgsql/openexchange.sql.bak
su - -c'dropdb openexchange' postgres
su - -c'dropuser openexchange' postgres
su - -c'createdb --template=template0 -E UNICODE -e openexchange' postgres
su - -c'psql -a -e -d openexchange -e -f /usr/local/open-xchange/share/createuser.sql' postgres
rm -f /tmp/temp_ox.sh
cat <<-EOF >/tmp/temp_ox.sh
#!/bin/bash
su postgres -c'pg_restore -d openexchange -v /home/e-smith/db/pgsql/ox_${DOMAIN}.sql'
EOF
chmod 755 /tmp/temp_ox.sh
exec /tmp/temp_ox.sh
rm -f /tmp/temp_ox.sh
# check for an upgrade
if [ -x /usr/local/open-xchange/share/upgrades/check4upgrade.sh ]; then
/usr/local/open-xchange/share/upgrades/check4upgrade.sh
fi
###############################################################################
# FILES
/usr/bin/rsync -aur --delete /home/e-smith/files/saves/open-xchange/var /usr/local/open-xchange
StartServices
}
###################################################################################################################
# check for heartbeat system
if [ -x /usr/local/sbin/getnode ]; then
MYNODE=`getnode`
HERIP=`getnode --mirror --ip`
HERNAME=`getnode --mirror`
# first thing verify if whe are the active node
ACTIV=`/sbin/e-smith/db heartbeat getprop nodes Active`
if [ $MYNODE == $ACTIV ]; then
RestoreOXHA
fi
else
RestoreOX
fi
9.) Modify /usr/local/open-xchange/sbin/deluser_ox: Here's the correct script:
#!/bin/bash
#
# (c) 2004-2100
# Author: cutmasta AT netline-is D0T de
#
#
# This Script dels OX User from the LDAP!
# TODO : DELETE personal adressbook completely if he has entries in that!
#
#
# GLOBAL CONFIGFILE
prefix=/usr/local/open-xchange
exec_prefix=${prefix}
GLOBAL_CONF="${prefix}/etc/admintools.conf"
if [ -f $GLOBAL_CONF ]
then
. $GLOBAL_CONF
else
echo "Config File $GLOBAL_CONF not found."
exit 0
fi
ac_prev=
for ac_option
do
if test -n "$ac_prev"; then
eval "$ac_prev=\$ac_option"
ac_prev=
continue
fi
case "$ac_option" in
-*=*) ac_optarg=`echo "$ac_option" | $SED_BIN 's/[-_a-zA-Z0-9]*=//'` ;;
*) ac_optarg= ;;
esac
case "$ac_option" in
--username)
ac_prev=username ;;
--username=*)
USERNAME=$ac_optarg ;;
-help | --help | -? | --?)
cat <<EOF
Usage: $0 [Options]
Options:
--username=NAME The Username - eg. john
EOF
exit 0
;;
*)
echo "Unknown command $ac_option"
echo "Try $0 --help"
exit 1
;;
esac
done
ERROR=
if [ "$USERNAME" = "" ]
then
ERROR="y"
echo "Specify an Username!"
fi
if [ "$ERROR" = "y" ]
then
echo "Please provide an Username!"
echo "Try $0 --help"
exit 0 ;
fi
#LDAP_DELETE_ADR=`$LDAPDELETE_BIN $LDAPCONN "ou=addr,uid=$USERNAME,$USER_BASEDN" 2>&1 | $GREP_BIN Delete | $AWK_BIN -F'(' {'print $2'} | $AWK_BIN -F')' {'print $1'}`
## DELETE RECURSIVE ALL USER STUFF FROM LDAP
LDAP_DELETE=`$LDAPDELETE_BIN $LDAPCONN -r "uid=$USERNAME,$USER_BASEDN" 2>&1 | $GREP_BIN Delete | $AWK_BIN -F'(' {'print $2'} | $AWK_BIN -F')' {'print $1'}`
# delete the user from the adressadmins
echo "dn: $GLOBAL_ADDRESSBOOK_ADMINSDN " > $TMPDIF
echo "changetype: modify" >> $TMPDIF
echo "delete: member" >> $TMPDIF
echo "member: uid=$USERNAME,$USER_BASEDN" >> $TMPDIF
LDAP_DELETE_ADDRESSADMIN=`$LDAPMODIFY_BIN $LDAPCONN -f $TMPDIF 2>&1 | $GREP_BIN ldap_modify | $AWK_BIN -F'(' {'print $2'} | $AWK_BIN -F')' {'print $1'}`
rm $TMPDIF
OX_OBJECTS_DELETE=`/usr/local/java/bin/java -Dopenexchange.propfile=/usr/local/open-xchange/etc/groupware/system.properties -classpath /usr/local/open-xchange/lib/intranet.jar:/usr/local/open-xchange/lib/comfiretools.jar:/usr/local/open-xchange/lib/nas.jar:/usr/local/share/java/pg74.216.jdbc3.jar com.openexchange.groupware.deleteUserGroups deleteUser $USERNAME`
esc=`echo -en "\033"`
warn="${esc}[1;31m"
done="${esc}[1;32m"
info="${esc}[1;33m"
case "$LDAP_DELETE" in
"")
echo "${done}LDAP Success!"
if [ "$SQL_DB_TYPE" = "pgsql" ]
then
SQL_INSERT=`$SQL_BIN -h $DEFAULT_SQL_HOST -U $DEFAULT_SQL_USER -d $DEFAULT_SQL_DB -X -c "DELETE FROM $RIGHTS_TABLE WHERE login LIKE '$USERNAME'" | $AWK_BIN {'print $1'}`
if [ $? -eq 0 ]; then
SQL_INSERT="DELETE"
fi
else
SQL_INSERT=`$MYSQL_BIN -h $DEFAULT_SQL_HOST -u $DEFAULT_SQL_USER --password=$DEFAULT_SQL_PASS $DEFAULT_SQL_DB -e "DELETE FROM $RIGHTS_TABLE WHERE login LIKE '$USERNAME'" `
fi
if [ "$SQL_INSERT" = "DELETE" ]
then
echo "${done}SQL Success"
else
echo "${warn}SQL Error"
exit 0
fi
;;
32)
echo "${info}No such User"
;;
34)
echo "${warn}invalid DN"
;;
*)
echo "${warn}Undefined ERROR - LDAP CODE $LDAP_INSERT"
echo "${warn}See LDAP Log for Details!"
esac
echo -en "${esc}[m\017"
echo -n ""
10.) run initall_ox. Watch the output on the screen. There should no errors occur.
11.) run scan_users.sh. Watch the output on the screen. There should no errors occur.
12.) remember to change (re-confirm) the user-passwords in the server-manager. If you don't do this, the login is username=password. In this case you'll not be able to access webmail!
13.) Give the backup/restore command a chance. Login ox. Play around - create some dates, whatever. Logoff. Run manually backup_ox. Login again. Delete whatever you created before. Logoff. Run manually restore_ox.
14.) After restore_ox you have to do:
- service postgresql restart
- service ldap restart
- service open-xchange restart
15.) Login ox. Look if everything is restored.
16.) Check if you can use the deluser_ox. You might need this for removing machine accounts from ox.
I'm not working with the oxtender. Therefore I cannot give any help with this tool.
Work with ox. Be careful with up-dates. I strongly recommend a backup before updating. Check carefully WHAT exactly the update overwrites! You'll not be able to use restore_ox for a different database/scheme!
Someone should remove my earlier post (20.06.06). It's obsolete.