How to resolve error referring to the text "ap_cache_cacheable_hdrs_out" when starting Apache HTTP Server

I came across a need to enable the following links for the Apache HTTP Server, in order to enable response caching. Go to /etc/apache2 folder and give the following commands.

 

ln -s ../mods-available/file_cache.load file_cache.load

ln -s ../mods-available/mem_cache.conf mem_cache.conf

ln -s ../mods-available/mem_cache.load mem_cache.load

 

Once the above links were created, I tried to restart the server and it threw the following error

 

* Starting web server apache2

apache2: Syntax error on line 204 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/mods-enabled/mem_cache.load: Cannot load /usr/lib/apache2/modules/mod_mem_cache.so into server: /usr/lib/apache2/modules/mod_mem_cache.so: undefined symbol: ap_cache_cacheable_hdrs_out [fail]

 

To resolve this all I had to do was, add the following line to the apach2.conf file before # Include module configuration: section

LoadModule cache_module /usr/lib/apache2/modules/mod_cache.so

Or

ln -s ../mods-available/cache.load .

Via: Evanthika Amarasiri’s Blog: How to resolve error referring to the text “ap_cache_cacheable_hdrs_out” when starting Apache HTTP Server