Icinga Web, Set correct write permissions for directory “/usr/local/icinga-web/app/cache”

If you have followed the Icinga install procedure through as per the installation documentation, and are having difficulty getting Icinga Web to install, you may eventually get an Agavi error saying that the cache directory is not writable (if you find the PHP errors)

AgaviCacheException

Failed to write cache file "/usr/local/icinga-web/app/cache/config/config_handlers.xml_production__d98552ff67d2d50d8def4e3ddb970ba8e8e151fc.php" 
generated from configuration file "/usr/local/icinga-web/app/config/config_handlers.xml".

Please make sure you have set correct write permissions for directory "/usr/local/icinga-web/app/cache".

For some bizarre reason this still occurs if you change the ownership and permissions of the directory.

The workaround I found involves changing the cache path to somewhere else on the filesystem outside of the Icinga application directory.

vi /usr/local/icinga-web/app/config.php

Then change the cache directory to be somewhere outside of the application directory (make sure the directory exists and has the correct writeable permissions for Apache)

//AgaviConfig::set('core.cache_dir', '/usr/local/icinga-web/app/cache');
AgaviConfig::set('core.cache_dir', '/var/icinga-web');

Add comment