diff --git a/Apache/SOGo-debian.conf b/Apache/SOGo-debian.conf
deleted file mode 100644
index 7921d91bd..000000000
--- a/Apache/SOGo-debian.conf
+++ /dev/null
@@ -1,67 +0,0 @@
-Alias /SOGo.woa/WebServerResources/ \
- /usr/lib/GNUstep/SOGo/WebServerResources/
-Alias /SOGo/WebServerResources/ \
- /usr/lib/GNUstep/SOGo/WebServerResources/
-AliasMatch /SOGo/so/ControlPanel/Products/(.*)/Resources/(.*) \
- /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2
-
-
- AllowOverride None
- Order deny,allow
- Allow from all
-
-
-
- SetHandler default-handler
-
-
-## Uncomment the following to enable proxy-side authentication, you will then
-## need to set the "SOGoTrustProxyAuthentication" SOGo user default to YES and
-## adjust the "x-webobjects-remote-user" proxy header in the "Proxy" section
-## below.
-#
-# AuthType XXX
-# Require valid-user
-# SetEnv proxy-nokeepalive 1
-# Allow from all
-#
-
-ProxyRequests Off
-SetEnv proxy-nokeepalive 1
-ProxyPreserveHost On
-
-# When using CAS, you should uncomment this and install cas-proxy-validate.py
-# in /usr/lib/cgi-bin to reduce server overloading
-#
-# ProxyPass /SOGo/casProxy http://localhost/cgi-bin/cas-proxy-validate.py
-#
-# Order deny,allow
-# Allow from your-cas-host-addr
-#
-
-ProxyPass /SOGo http://127.0.0.1:20000/SOGo retry=0
-
-
-## adjust the following to your configuration
- RequestHeader set "x-webobjects-server-port" "443"
- RequestHeader set "x-webobjects-server-name" "yourhostname"
- RequestHeader set "x-webobjects-server-url" "https://yourhostname"
-
-## When using proxy-side autentication, you need to uncomment and
-## adjust the following line:
-# RequestHeader set "x-webobjects-remote-user" "%{REMOTE_USER}e"
-
- RequestHeader set "x-webobjects-server-protocol" "HTTP/1.0"
- RequestHeader set "x-webobjects-remote-host" %{REMOTE_HOST}e env=REMOTE_HOST
-
- AddDefaultCharset UTF-8
-
- Order allow,deny
- Allow from all
-
-
-## We use mod_rewrite to pass remote address to the SOGo proxy.
-# The remote address will appear in SOGo's log files and in the X-Forward
-# header of emails.
-RewriteEngine On
-RewriteRule ^/SOGo/(.*)$ /SOGo/$1 [env=REMOTE_HOST:%{REMOTE_ADDR},PT]
\ No newline at end of file
diff --git a/Apache/SOGo.conf b/Apache/SOGo.conf
index 2a11e5940..7921d91bd 100644
--- a/Apache/SOGo.conf
+++ b/Apache/SOGo.conf
@@ -1,9 +1,15 @@
Alias /SOGo.woa/WebServerResources/ \
- /usr/GNUstep/System/Library/SOGo/WebServerResources/
+ /usr/lib/GNUstep/SOGo/WebServerResources/
Alias /SOGo/WebServerResources/ \
- /usr/GNUstep/System/Library/SOGo/WebServerResources/
+ /usr/lib/GNUstep/SOGo/WebServerResources/
AliasMatch /SOGo/so/ControlPanel/Products/(.*)/Resources/(.*) \
- /usr/GNUstep/System/Library/SOGo/$1.SOGo/Resources/$2
+ /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2
+
+
+ AllowOverride None
+ Order deny,allow
+ Allow from all
+
SetHandler default-handler
diff --git a/Scripts/sogo-init.d-redhat b/Scripts/sogo-init.d-redhat
index 925de539f..1a55bf201 100755
--- a/Scripts/sogo-init.d-redhat
+++ b/Scripts/sogo-init.d-redhat
@@ -30,7 +30,7 @@
PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=sogo
-DAEMON=/usr/GNUstep/System/Tools/Admin/sogod
+DAEMON=/usr/sbin/sogod
DESC="SOGo"
USER=$NAME
diff --git a/Scripts/sogod-wrapper b/Scripts/sogod-wrapper
deleted file mode 100755
index a0da33bf9..000000000
--- a/Scripts/sogod-wrapper
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/bash
-
-# SOGo daemon wrapper
-#
-# Copyright (C) 2007-2009 Inverse inc.
-#
-# Authors: Wolfgang Sourdeau
-# Francis Lachapelle
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This file is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
-PIDFILE=/var/run/sogo/sogo.pid
-LOGFILE=/var/log/sogo/sogo.log
-
-if [ -f /etc/GNUstep/GNUstep.conf ]; then
- . /etc/GNUstep/GNUstep.conf
-else
- echo "Can't find GNUstep.conf"
- exit 1
-fi
-
-if [ -x $HOME/$GNUSTEP_USER_DIR_ADMIN_TOOLS/sogod ]; then
- sogod="$HOME/$GNUSTEP_USER_DIR_ADMIN_TOOLS/sogod"
-elif [ -x $GNUSTEP_LOCAL_ADMIN_TOOLS/sogod ]; then
- sogod="$GNUSTEP_LOCAL_ADMIN_TOOLS/sogod"
-elif [ -x $GNUSTEP_SYSTEM_ADMIN_TOOLS/sogod ]; then
- sogod="$GNUSTEP_SYSTEM_ADMIN_TOOLS/sogod"
-else
- echo "Can't find sogod"
- exit 1
-fi
-echo $sogod
-
-if [ -f $GNUSTEP_MAKEFILES/GNUstep.sh ]; then
- . $GNUSTEP_MAKEFILES/GNUstep.sh
-else
- echo "Can't find GNUstep.sh"
- exit 1
-fi
-
-# echo "SOGOD: $sogod -WOPort $listen" 2>&1
-
-exec $sogod -WOLogFile $LOGFILE -WOPidFile $PIDFILE
diff --git a/debian/rules b/debian/rules
index 4e4fcb71d..7552135cf 100755
--- a/debian/rules
+++ b/debian/rules
@@ -43,7 +43,7 @@ install-arch: build-arch
mkdir -p debian/tmp/usr/share/lintian/overrides
cp debian/sogo.overrides debian/tmp/usr/share/lintian/overrides/sogo
mkdir -p debian/tmp/etc/apache2/conf.d
- cp Apache/SOGo-debian.conf debian/tmp/etc/apache2/conf.d/SOGo.conf
+ cp Apache/SOGo.conf debian/tmp/etc/apache2/conf.d/SOGo.conf
# Build architecture dependant packages using the common target.
binary-arch: build-arch install-arch
diff --git a/sogo.spec b/sogo.spec
index c47528d6b..55b56122d 100644
--- a/sogo.spec
+++ b/sogo.spec
@@ -164,14 +164,12 @@ mkdir -p ${RPM_BUILD_ROOT}/usr/sbin
mkdir -p ${RPM_BUILD_ROOT}/var/run/sogo
mkdir -p ${RPM_BUILD_ROOT}/var/log/sogo
mkdir -p ${RPM_BUILD_ROOT}/var/spool/sogo
-cp Apache/SOGo.conf ${RPM_BUILD_ROOT}/etc/httpd/conf.d/
+cat Apache/SOGo.conf | sed -e "s@/lib/@/%{_lib}/@g' > ${RPM_BUILD_ROOT}/etc/httpd/conf.d/SOGo.conf
cp Scripts/tmpwatch ${RPM_BUILD_ROOT}/etc/cron.daily/sogo-tmpwatch
chmod 755 ${RPM_BUILD_ROOT}/etc/cron.daily/sogo-tmpwatch
cp Scripts/logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/sogo
cp Scripts/sogo-init.d-redhat ${RPM_BUILD_ROOT}/etc/init.d/sogod
chmod 755 ${RPM_BUILD_ROOT}/etc/init.d/sogod
-cp Scripts/sogod-wrapper ${RPM_BUILD_ROOT}/usr/sbin/sogod-wrapper
-chmod 755 ${RPM_BUILD_ROOT}/usr/sbin/sogod-wrapper
cp Scripts/sogo-default ${RPM_BUILD_ROOT}/etc/sysconfig/sogo
rm -rf ${RPM_BUILD_ROOT}%{_bindir}/test_quick_extract
@@ -194,7 +192,6 @@ rm -fr ${RPM_BUILD_ROOT}
/etc/init.d/sogod
/etc/cron.daily/sogo-tmpwatch
/etc/logrotate.d/sogo
-/usr/sbin/sogod-wrapper
/var/run/sogo
/var/log/sogo
/var/spool/sogo