Koozali.org: home of the SME Server

Getting images to work with wvhtml for Horde 3.0 on SME 6.01

Offline holck

  • ****
  • 317
  • +1/-0
Getting images to work with wvhtml for Horde 3.0 on SME 6.01
« on: September 17, 2006, 12:17:50 AM »
I know it is recommended to upgrade to SME 7 instead of installing Horde 3.0 on SME 6.01, but nevertheless... the solution below can maybe be used for SME 7 also?

In order to view Word etc. documents directly inside Horde, I installed wvhtml from here, which worked nicely except that images from the word-documents didn't show. The reason, I found out, is that wvhtml writes embedded images in the /tmp directory, whereas the web server tries to find them in the /home/httpd/html/horde/imp/ directory.

I have made a few patches to make the images show, as explained below.

Copy the file 85HordeAccess from
Code: [Select]
/etc/e-smith/templates/etc/httpd/conf/httpd.conf/
to
Code: [Select]

/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/

Add the following lines to the new copy of 85HordeAccess, after the line
Code: [Select]
# Horde specific configuration files:
Code: [Select]
<Directory /tmp>
  <FilesMatch "msword.*">
     Order Allow,Deny
     Allow from all
  </FilesMatch>
</Directory>

Create the directory
Code: [Select]
/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts
Copy the file 30WebMailAliases from
Code: [Select]
/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/
to
Code: [Select]
/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/
after this line
Code: [Select]

        $OUT .= "    Alias       /webmail $impdir\n";

In the new copy of 30WebMailAliases, add the following two lines
Code: [Select]
       $OUT .= "    RewriteEngine on\n";
        $OUT .= "    RewriteRule ^/horde/imp/msword(.+) /tmp/msword\$1 [L]\n";

Expand the new template:
Code: [Select]
/sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf    
Restart httpd:
Code: [Select]
/etc/e-smith/events/actions/restart-httpd-full
Empty the php-eaccelerator cache:
Code: [Select]
rm -f /var/cache/php-eaccelerator/*
That is it, I hope it works. The solution opens a small security hole: if outsiders can guess the names of msword* files in the /tmp directory, they can read these files.
......