In Magento CE, I'd like to install an add-on to Extendware Page Cache called Lightening Cache. It requires editing the Apache configuration inside the virtual host definition for the site, by adding: RewriteEngine On RewriteMap ewpchash prg:/home/.../shell/extendware/ewpagecache/apache/md5.php RewriteCond %{REQUEST_METHOD} !POST RewriteCond %{REQUEST_URI} !\.(js|css|png|jpg|jpeg|ico|gif)$ [NC] RewriteCond %{DOCUMENT_ROOT}%{SCRIPT_FILENAME} !-f RewriteCond ${ewpchash:%{HTTPS};~;%{HTTP_HOST};~;%{REQUEST_URI};~;%{QUERY_STRING};~;%{HTTP:Cookie};~;%{SCRIPT_FILENAME};~;%{REMOTE_ADDR};~;%{HTTP_USER_AGENT}} -f RewriteRule ^(.*)$ ${ewpchash:%{HTTPS};~;%{HTTP_HOST};~;%{REQUEST_URI};~;%{QUERY_STRING};~;%{HTTP:Cookie};~;%{SCRIPT_FILENAME};~;%{REMOTE_ADDR};~;%{HTTP_USER_AGENT}} [NC,L] <FilesMatch "\.(html)$"> Header unset Cache-Control Header unset Expires Header append Expires "Thu, 19 Nov 1981 08:52:00 GMT" Header append Cache-Control "must-revalidate" </FilesMatch> Code (markup): I have added this to the bottom of /etc/apache2/sites-enabled/site.conf When I run the command "apachectl graceful', I receive the error: Site is running Apache 2.4 Have I done something wrong?
That's what I thought too, but the application instructions are quite explicit: To use the Advanced mode you must ensure to have purchased the lightening cache addon. If you do not have this, then the simple mode will be used. You must be using apache in order to use the advanced mode and you must be able to modify the apache configuration.. To use the advanced mode you need to add the following rewrite rule in your apache configuration inside the virtual host definition for your site. Important: This is to be added to the virtual host section of the apache config and not your htaccess file. You or your host must be able / willing to modify the file. RewriteEngine On RewriteMap ewpchash prg:[Magento root path]/shell/extendware/ewpagecache/apache/md5.php RewriteCond %{REQUEST_METHOD} !POST RewriteCond %{REQUEST_URI} !\.(js|css|png|jpg|jpeg|ico|gif)$ [NC] RewriteCond %{DOCUMENT_ROOT}%{SCRIPT_FILENAME} !-f RewriteCond ${ewpchash:%{HTTPS};~;%{HTTP_HOST};~;%{REQUEST_URI};~;%{QUERY_STRING};~;%{HTTP:Cookie};~;%{SCRIPT_FILENAME};~;%{REMOTE_ADDR};~;%{HTTP_USER_AGENT}} -f RewriteRule ^(.*)$ ${ewpchash:%{HTTPS};~;%{HTTP_HOST};~;%{REQUEST_URI};~;%{QUERY_STRING};~;%{HTTP:Cookie};~;%{SCRIPT_FILENAME};~;%{REMOTE_ADDR};~;%{HTTP_USER_AGENT}} [NC,L] <FilesMatch "\.(html)$"> Header unset Cache-Control Header unset Expires Header append Expires "Thu, 19 Nov 1981 08:52:00 GMT" Header append Cache-Control "must-revalidate" </FilesMatch> Code (markup): Important: you need to replace the text [Magento root path] with the root file path where Magento is installed. The file at [Magento root path]/shell/extendware/ewpagecache/apache/md5.php must be executable (cmhod +x) and the first line of the file #!/usr/bin/php must correctly point to a php interpreter. This has been tested with apache 2.4. Not guaranteed to work on 2.2