What are the configuration file locations for mod_pagespeed on a cPanel server?
Before attempting to configure mod_pagespeed, you should familiarize yourself with the official documentation so that you are aware of what configurations go in which file, and what is available to you:
Please keep in mind that the process of editing and debugging the mod_pagespeed configuration on your server is a task that is best suited for a systems administrator with the skills, training, and expertise required to do so for you. Although this process is not related to cPanel or the basic configuration of cPanel, we would like to offer this general information about mod_pagespeed information as a courtesy.
Serverwide Configuration File
The main mod_pagespeed configuration file is located in the following directory:
The exact filename may change occasionally. At the time of writing this resource, the filename is currently:
Configuration via the .htaccess file
You may place most mod_pagespeed configurations within a .htaccess file in the document root of your domain, or some directory under the document root. There are some limitations. Please review the official documentation for details:
mod_pagespeed Docs - Location Specific Configuration
Configuration via a Virtualhost include
You may also include configurations to override the server-wide configuration on a per-domain basis by adding your desired changes via a virtualhost include. For best performance, it is most ideal to use virtualhost includes instead of a .htaccess file whenever possible.
Before adding configurations via a virtualhost you should review the official mod_pagespeed documentation that applies to this type of configuration:
mod_pagespeed Docs - Using PageSpeed with Virtualhosts
The following resource explains how you can add configuration directives to an individual domain's virtualhost configuration:
How to use Apache includes to add configuration changes to a specific domain's virtualhost
The following resource explains how you can add your desired configuration to every virtualhost configuration on the server:
How to use Apache includes to add configuration directives to all virtualhosts serverwide