The content of this page is mainly derived from the security-section in the Horde documentation. It is aimed at system administrators who want to add some extra security to their Horde installations (or for those who are a bit paranoid ;) )
Also see the file docs/SECURITY, available online too.
| Table of Contents
 | 
The configuration examples here have been tested by me on a Fedora Core 3 system running Apache 2.2.3 with mod_ssl and Horde 3.1.3.
My Apache is serving most files out of /var/www/html. Thus my Horde installation lives in /var/www/html/horde. Please keep this in mind if you are applying any of these configurations on your system.
chown -R apache.apache /var/www/html/horde
chmod -R go-rwx /var/www/html/horde/config
chmod -R go-rwx /var/www/html/horde/*/config
chmod -R a-w   /var/www/html/horde/
chmod u+w /var/www/html/horde/config/conf.php*
chmod u+w /var/www/html/horde/*/config/conf.php*
<Directory "/var/www/html/horde/">
  Options none
  # Only needed if you have got safe_mode globally on
  php_admin_flag  safe_mode        off
  # /usr/share/pear is needed for PEAR. /var/www/html/horde is needed for Horde itself
  # You might want to add /usr/bin for applications like Chora that are calling external binaries
  # TODO: Set an appropriate include_path, too. Might even increase speed a bit.
  php_admin_value open_basedir     "/var/www/html/horde:/usr/share/pear" 
  # always a good idea :)
  php_admin_flag  expose_php       off
  # If you do this (recomended by the PHP documentation, btw)...
  php_admin_flag  display_errors   off
  # ... you need to set this also - otherwise you'll have no idea what's wrong if something doesn't work.
  # Don't forget to specify a logfile in your php.ini or elsewhere!
  php_admin_flag  log_errors       on
  php_admin_flag  register_globals off
</Directory>
# Deny access to files that are not served directly by the webserver
<DirectoryMatch "^/var/www/html/horde/(.*/)?(config|lib|locale|po|scripts|templates)/(.*)?">
  order deny,allow
  deny  from all
</DirectoryMatch>
# Deny access to the test.php files except from localhost
<LocationMatch "^/horde/(.*/)?test.php">
  order deny,allow
  deny  from all
  allow from localhost
</LocationMatch>
httpd -V | grep HTTPD_ROOT
httpd -V | grep SERVER_CONFIG_FILEAlso note that I used escaped slashes in the RegEx for the <DirectoryMatch> instruction. Apache seems to cope with unescaped metacharacters. But since I'm using perl-RegEx most of the time, I'm used to escape those.
The <DirectoryMatch>-instruction is restricting access to the folders config, lib, locale, po, scripts and templates in Horde and all its applications.
<LocationMatch> prevents Horde's test.php scripts being accessed from the outside. The Horde documentation is suggesting to restrict all hosts. This example allows access from your local host so you can run the tests via lynx or a SSH tunnel.
skip-networking
skip-innodb
skip-bdb
bind-address=127.0.0.1
port=3306Also make sure that your password for Horde's database is safe (even if you disabled networking support).
Hint: phpMyAdmin 2.7+ lets you generate randomized passwords consisting of all printable characters with sufficient length.
pear upgrade-all
pear list-upgrades
pear upgrade package-name