From 9bd903e945164d0cab5a15e2c9266e07060ed7b0 Mon Sep 17 00:00:00 2001 From: Jean Raby Date: Thu, 24 May 2012 15:38:24 +0000 Subject: [PATCH 1/2] * Apache/SOGo.conf: Use mod_expires to allow long term caching of static content. (1 year) Note that from now on, a resource's URL _must_ change to let the client reload it. This is now done automatically for 'rsrc' in the wox templates, but must be done manually for files referenced from css and js. Monotone-Parent: 217d9d9c614ee3505938f345452c5569bb650a58 Monotone-Revision: 7fa995267c41300aff7187361273b7fe03da3809 Monotone-Author: jraby@inverse.ca Monotone-Date: 2012-05-24T15:38:24 --- Apache/SOGo.conf | 9 ++++++++- ChangeLog | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Apache/SOGo.conf b/Apache/SOGo.conf index 7921d91bd..1762ebac3 100644 --- a/Apache/SOGo.conf +++ b/Apache/SOGo.conf @@ -9,6 +9,13 @@ AliasMatch /SOGo/so/ControlPanel/Products/(.*)/Resources/(.*) \ AllowOverride None Order deny,allow Allow from all + + # Explicitly allow caching of static content to avoid browser specific behavior. + # A resource's URL MUST change in order to have the client load the new version. + + ExpiresActive On + ExpiresDefault "access plus 1 year" + @@ -64,4 +71,4 @@ ProxyPass /SOGo http://127.0.0.1:20000/SOGo retry=0 # 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 +RewriteRule ^/SOGo/(.*)$ /SOGo/$1 [env=REMOTE_HOST:%{REMOTE_ADDR},PT] diff --git a/ChangeLog b/ChangeLog index eef787de6..0ff1eb63b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2012-05-24 Jean Raby + + * Apache/SOGo.conf: + Use mod_expires to allow long term caching of static content. (1 year) + Note that from now on, a resource's URL _must_ change to let the client + reload it. This is now done automatically for 'rsrc' in the wox templates, + but must be done manually for files referenced from css and js. + 2012-05-23 Wolfgang Sourdeau * UI/WebServerResources/generic.js From 6aed6c5ed0cb645cc6e1b3c0f6d9cf0c0daf26a3 Mon Sep 17 00:00:00 2001 From: Jean Raby Date: Thu, 24 May 2012 18:09:47 +0000 Subject: [PATCH 2/2] * debian*/rules: Restart sogod after pkg upgrade (dh_installinit -R) * Scripts/sogo-init.d-*: add support for conditional restart. Patch from Romain Le Disez * sogo.spec: Restart sogod during post installation if it was already running Monotone-Parent: 7fa995267c41300aff7187361273b7fe03da3809 Monotone-Revision: a7e3713b79d3ec5043152d79550eec23b2ff854f Monotone-Author: jraby@inverse.ca Monotone-Date: 2012-05-24T18:09:47 --- ChangeLog | 5 +++++ Scripts/sogo-init.d-redhat | 7 ++++++- Scripts/sogo-init.d-sles | 7 ++++++- debian-multiarch/rules | 2 +- debian/rules | 2 +- sogo.spec | 4 ++++ 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ff1eb63b..ffc062ee7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2012-05-24 Jean Raby + * debian*/rules: Restart sogod after pkg upgrade (dh_installinit -R) + * Scripts/sogo-init.d-*: add support for conditional restart. + Patch from Romain Le Disez + * sogo.spec: Restart sogod during post installation if it was already running + * Apache/SOGo.conf: Use mod_expires to allow long term caching of static content. (1 year) Note that from now on, a resource's URL _must_ change to let the client diff --git a/Scripts/sogo-init.d-redhat b/Scripts/sogo-init.d-redhat index db5b4cfba..76fea17f5 100755 --- a/Scripts/sogo-init.d-redhat +++ b/Scripts/sogo-init.d-redhat @@ -146,12 +146,17 @@ case "$1" in restart) restart ;; + condrestart|try-restart) + if status -p "$PIDFILE" $DAEMON >&/dev/null; then + restart + fi + ;; status) status -p "$PIDFILE" $DAEMON ;; *) N=/etc/init.d/$NAME - echo "Usage: $N {start|stop|restart|status}" >&2 + echo "Usage: $N {start|stop|restart|condrestart|status}" >&2 exit 1 ;; esac diff --git a/Scripts/sogo-init.d-sles b/Scripts/sogo-init.d-sles index ad44c0685..d4f3afbc1 100755 --- a/Scripts/sogo-init.d-sles +++ b/Scripts/sogo-init.d-sles @@ -96,6 +96,11 @@ case "$1" in startproc -u $USER $DAEMON $DAEMON_OPTS || true echo "$NAME." ;; + condrestart|try-restart) + if checkproc -p "$PIDFILE" $DAEMON >&/dev/null; then + restart + fi + ;; status) checkproc -p $PIDFILE $DAEMON result="$?" @@ -115,7 +120,7 @@ case "$1" in fi ;; *) - echo "Usage: $NAME {start|stop|restart|status}" >&2 + echo "Usage: $NAME {start|stop|restart|condrestart|status}" >&2 exit 1 ;; esac diff --git a/debian-multiarch/rules b/debian-multiarch/rules index 1580a1ce5..d66269b96 100755 --- a/debian-multiarch/rules +++ b/debian-multiarch/rules @@ -85,7 +85,7 @@ install-arch: build-arch binary-arch: build-arch install-arch dh_testdir dh_testroot - dh_installinit -r + dh_installinit -R dh_installlogrotate dh_installcron dh_installchangelogs ChangeLog diff --git a/debian/rules b/debian/rules index 023869853..cfa64de7b 100755 --- a/debian/rules +++ b/debian/rules @@ -84,7 +84,7 @@ install-arch: build-arch binary-arch: build-arch install-arch dh_testdir dh_testroot - dh_installinit -r + dh_installinit -R dh_installlogrotate dh_installcron dh_installchangelogs ChangeLog diff --git a/sogo.spec b/sogo.spec index 8be88354e..bab4cf4ea 100644 --- a/sogo.spec +++ b/sogo.spec @@ -292,6 +292,7 @@ if ! id sogo >& /dev/null; then /usr/sbin/adduser sogo > /dev/null 2>&1; fi # update timestamp on imgs,css,js to let apache know the files changed find %{_libdir}/GNUstep/SOGo/WebServerResources -exec touch {} \; /sbin/chkconfig --add sogod +/etc/init.d/sogod condrestart >&/dev/null %preun if [ "$1" == "0" ] @@ -311,6 +312,9 @@ fi # ********************************* changelog ************************* %changelog +* Fri May 24 2012 Jean Raby +- %post: restart sogo if it was running before rpm install + * Fri Mar 16 2012 Jean Raby - %post: update timestamp on imgs,css,js to let apache know the files changed