Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
litespeed_wiki:config:enable_pagespeed [2018/04/25 20:45]
Lisa Clarke [How to Enable the PageSpeed Module on LSWS] Proofreading
litespeed_wiki:config:enable_pagespeed [2020/04/09 15:40] (current)
Jackson Zhang [Using a Control Panel in a Shared Hosting Environment]
Line 1: Line 1:
 ====== How to Enable the PageSpeed Module on LSWS ====== ====== How to Enable the PageSpeed Module on LSWS ======
 +**IMPORTANT!! Disabling PageSpeed module in full is now recommended. We have seen that the PageSpeed module can be a little buggy where it may cause stability issues and this won't be addressed since it hasn't been maintained for years. Also there is not enough performance benefits we can see to make up for it consuming a lot of server resources. It may possibly break some of the LiteSpeed cache solutions, such as LiteMage etc. as explained below.**
  
-Mod_pagespeed is a web server module developed by Google. It automatically applies chosen filters to pages and associated assets (stylesheets,​ JavaScript, and HTML files), as well as to images and website cache requirements. It does not require modifications to existing content or workflow, meaning that all internal optimizations and changes to files are made on the server side, presenting modified files directly to the user. +Mod_pagespeed is a web server module ​that was developed by Google. It automatically applies chosen filters to pages and associated assets (stylesheets,​ JavaScript, and HTML files), as well as to images and website cache requirements. It does not require modifications to existing content or workflow, meaning that all internal optimizations and changes to files are made on the server side, presenting modified files directly to the user. 
  
 Since version 5.2, LSWS provides PageSpeed support. It is possible to enable both PageSpeed and LSCache together in theory, but we don't recommend it. Since version 5.2, LSWS provides PageSpeed support. It is possible to enable both PageSpeed and LSCache together in theory, but we don't recommend it.
Line 24: Line 25:
  
 ===== Using a Control Panel in a Shared Hosting Environment ===== ===== Using a Control Panel in a Shared Hosting Environment =====
-For a control-panel server, PageSpeed must be enabled ​through Apache configuration. Enabling through LSWS Web Admin will only impact the virtual hosts that were created through the LSWS native configurationBy design, it will not affect any virtual hosts set up through ​Apache configuration.+For a control-panel server, PageSpeed must be enabled ​on LiteSpeed ​Admin console first since it is master switch to turn this feature on Then you will also need to write a directive ''​ModPageSpeed On''​ in Apache configuration. ​
  
 To enable PageSpeed, ''​loadModule''​ and ''​FileCachePath''​ are required at the server level. ''​ModPagespeedFileCachePath''​ should not be set at the virtual host level. Enabling independent PageSpeed file cache for each vhost is very costly. It takes a lot of resources and should be avoided in shared hosting environments. ''​ModPageSpeed On''​ at the server level will turn on PageSpeed server wide. This is not recommended for shared servers, as PageSpeed can be resource heavy and may negatively impact performance. ​ To enable PageSpeed, ''​loadModule''​ and ''​FileCachePath''​ are required at the server level. ''​ModPagespeedFileCachePath''​ should not be set at the virtual host level. Enabling independent PageSpeed file cache for each vhost is very costly. It takes a lot of resources and should be avoided in shared hosting environments. ''​ModPageSpeed On''​ at the server level will turn on PageSpeed server wide. This is not recommended for shared servers, as PageSpeed can be resource heavy and may negatively impact performance. ​
  
-**We recommend setting ''​ModPageSpeed unplugged|off''​ at the server level, and ''​ModPageSpeed on''​ for the vhosts which need it.**+**We recommend setting ''​ModPageSpeed unplugged|off''​ at the server level, and ''​ModPageSpeed on''​ for the vhosts ​or directories ​which need it.**
  
-''​ModPageSpeed unplugged''​ bypasses ''​mod_pagespeed''​ hooks.\\ ''​ModPageSpeed off''​ goes through ''​mod_pagespeed''​ hooks with PageSpeed turned off.+  * ''​ModPageSpeed unplugged''​ bypasses ''​mod_pagespeed''​ hooks. 
 +  * ''​ModPageSpeed off''​ goes through ''​mod_pagespeed''​ hooks with PageSpeed turned off.
  
-You can set ''​ModPagespeed off''​ in the Apache main configuration, then, you can turn it on via virutal ​host configuration or ''​.htaccess''​.+You can set ''​ModPagespeed off''​ in the Apache main configuration ​and you can use ''​ModPageSpeed On''​ to turn it on via virtual ​host configuration or ''​.htaccess'' ​file.
  
 ==== Enabling PageSpeed for LSWS Using cPanel ==== ==== Enabling PageSpeed for LSWS Using cPanel ====
Line 127: Line 129:
 If you use this method, you don't need to install any packages, and it will work on LSWS. If you use this method, you don't need to install any packages, and it will work on LSWS.
 === Set Server Level PageSpeed File === === Set Server Level PageSpeed File ===
-Create a file named ''​pagspeed.conf''​ in the following directory depending upon your system:+Create a file named ''​pagespeed.conf''​ in the following directory depending upon your system:
   * For CentOS, the ''/​etc/​httpd/​conf.d/''​ directory   * For CentOS, the ''/​etc/​httpd/​conf.d/''​ directory
   * For Debian, the ''/​etc/​apache2/​conf.d/''​ directory   * For Debian, the ''/​etc/​apache2/​conf.d/''​ directory
   * For Ubuntu, the ''/​etc/​apache2/​conf-enabled''​ directory   * For Ubuntu, the ''/​etc/​apache2/​conf-enabled''​ directory
  
-This ''​pagspeed.conf''​ file should contain the following:+This ''​pagespeed.conf''​ file should contain the following:
  
 <​code>​ <​code>​
Line 178: Line 180:
  
 ===== Enabling PageSpeed Module Without a Control Panel Environment ===== ===== Enabling PageSpeed Module Without a Control Panel Environment =====
-==== Set Server Level PageSpeed File Path ====+==== Activate PageSpeed at Server Level & Set PageSpeed File Path ====
   * Navigate to **WebAdmin Console > Configuration > Server > PageSpeed**   * Navigate to **WebAdmin Console > Configuration > Server > PageSpeed**
   * Set **Activate PageSpeed** to ''​Yes''​   * Set **Activate PageSpeed** to ''​Yes''​
-  * Set **Enable PageSpeed** to ''​Yes''​ +  * Set **Enable PageSpeed** to ''​Yes'' ​(optional since could also enable per virtual host)  
-  * Set **PageSpeed Settings** to ''​pagespeed FileCachePath /​tmp/​lshttpd/​pagespeed;''​+  * Set **PageSpeed Settings** to ''​pagespeed FileCachePath /​tmp/​lshttpd/​pagespeed;'' ​and add any [[ https://​www.modpagespeed.com/​doc/​config_filters| additional rule settings ]] on separate lines
 {{:​litespeed_wiki:​config:​pagespeed-server.png?​|}} {{:​litespeed_wiki:​config:​pagespeed-server.png?​|}}
-  ​For more rule settings, please see [[ https://​www.modpagespeed.com/​doc/​config_filters| ​Rewrite level]]+ 
 + 
 +==== Enable PageSpeed at Virtual Host Level ==== 
 +  ​Navigate to **WebAdmin Console > Configuration > Virtual Hosts > View/Edit > PageSpeed** 
 +  * Set **Enable PageSpeed** to ''​Yes''​  
 +  * Add [[ https://​www.modpagespeed.com/​doc/​config_filters| ​additional rule settings ​]] to **PageSpeed Settings** section 
  
 ===== Verify PageSpeed is Enabled ===== ===== Verify PageSpeed is Enabled =====
  • Admin
  • Last modified: 2018/04/25 20:45
  • by Lisa Clarke