Share » Blogs » Gaetano Giunta » The tiniest Apache setup for...

The tiniest Apache setup for installing eZ Publish

Monday 04 July 2011 2:17:27 pm

  • Currently 5 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

By : Gaetano Giunta

Apache is a highly modular software - and that's a great feature, that contrbuted a lot to its wild success! Some linux distributions however have a default installation of Apache with many, many modules enabled. maybe too much. We know that any unused module chews up valuable ram, is a possible target of attack for crackers and slows down the startup of the webserver by a few milliseconds.

So, what is the absolute minimum list of Apache modules that are needed to successfully run eZ Publish? Read on to find out...

With a little experimenting, here is the list I came up with:

 List of needed modules:

  •  mod_php: required
  •  mod_mime: required for the AddType directive used to map php scripts to mod_php engine
  •  mod_authz_host ("order allow/deny" directive to block access to the complete filesystem of the server)

in vhost mode:

  •  mod_rewrite

in non-vhost mode:

  •  mod_dir

Note: mod_dir can not be disabled with the standard eZ Publish .htaccess file that contains a DirectoryIndex directive. That directive is unnecessary when rewrite rules are active and it can be safely removed.

Now, that's a small list, isn't it? On my windows 7 laptop, Apache uses about 5 MB of ram when started up in this minimal setup.

List of recommended modules:

  • mod_log_config (custom log files / formats)
  • mod_expires: recommended to add expiry headers on static resources (lighter load on the server, faster page load time for end users)
  • mod_deflate: recommended to compress css, js etc... + mod_setenvif + mod_headers to make it work properly (faster page load time for end users on slow connections)
  • mod_ssl:  recommended for security (needs to be properly configured to be of use, both in httpd.conf and eZP site.ini)
  • mod_info recommended for monitoring Apache status (in conjunction with external tools such as munin, mrtg or nagios)

All other modules:

enable on an as-needed basis