Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2018-08-20, 22:33:29

Author Topic: Enabling Apache Deflate and PageSpeed module the right way  (Read 2988 times)

0 Members and 1 Guest are viewing this topic.

Offline rsakhale

  • Valuable Member
  • *
  • Posts: 91
  • Karma: +0/-0
  • Gender: Male
  • Rohan Sakhale
    • View Profile
    • Rohan Rajan Sangita Sakhale
After reading a lot post here, I am still confused and not able to identify if gzip is actually working or not.

Steps I followed
  • Installed pagespeed using `yum install mod-pagespeed-stable`
  • Have enabled the same in Switch Program "Use Pagespeed (if Possible)"

After testing with gtmetrix.com - https://gtmetrix.com/reports/pharmaindigital.com/rgkCfgHm

I still see gzip is not installed, could you please help understand what we are missing.


Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,382
  • Karma: +115/-9
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Enabling Apache Deflate and PageSpeed module the right way
« Reply #1 on: 2017-05-04, 12:11:00 »
Inform here 'sh /script/sysinfo' in every asking. It's because different condition between version (6.5 vs 7.0) and update (in 7.0).
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline rsakhale

  • Valuable Member
  • *
  • Posts: 91
  • Karma: +0/-0
  • Gender: Male
  • Rohan Sakhale
    • View Profile
    • Rohan Rajan Sangita Sakhale
Re: Enabling Apache Deflate and PageSpeed module the right way
« Reply #2 on: 2017-05-04, 12:19:39 »
Using Kloxo-MR 7.0.0.c-2017050104

Code: [Select]
A. Control Panel:
   - Kloxo-MR: 7.0.0.c-2017050104
   - Web: hiawatha-10.6.0-f.1.mr.el6.x86_64
   - PHP: php56s-5.6.30-2.ius.centos6 (fpm mode)
B. Plateform:
   - OS: CentOS release 6.9 (Final) x86_64
   - Hostname: pharmaindigital.com
C. Services:
   1. MySQL: MariaDB-server-10.0.30-1.el6.x86_64
   2. PHP:
      - Installed:
        - Branch: php70w-cli-7.0.18-1.w6.x86_64
        - Multiple:
          * php56m-5.6.30-2.ius.centos6
          * php70m-7.0.18-1.ius.centos6
          * php71m-7.1.4-1.ius.centos6
      - Used: php70m-fpm
      - Multiple: enable
   3. Web Used: apache
     - Hiawatha: hiawatha-10.6.0-f.1.mr.el6.x86_64
     - Lighttpd: lighttpd-1.4.45-1.el6.x86_64
     - Nginx: nginx-1.13.0-1.el6.ngx.x86_64
     - Apache: httpd24u-2.4.25-3.ius.centos6.x86_64
       - PHP Type: php-fpm_worker
       - Secondary PHP: off
   4. WebCache: none
     - ATS: --uninstalled--
     - Squid: --uninstalled--
     - Varnish: --uninstalled--
   5. Dns: bind
     - Bind: bind-9.9.9-1.mr.el6.x86_64
     - DJBDns: djbdns-1.05-17.4.mr.el6.x86_64
     - NSD: nsd-4.1.14-1.el6.x86_64
     - PowerDNS: pdns-4.0.3-1.el6.MIND.x86_64
     - Yadifa: yadifa-2.2.3-1.mr.el6.x86_64
   6. Mail: qmail-toaster-1.03-1.3.56.mr.el6.x86_64
      - pop3/imap4: courier-imap-toaster-4.1.2-1.3.20.mr.el6.x86_64
      - smtp: qmail-toaster-1.03-1.3.56.mr.el6.x86_64
      - spam: bogofilter-1.2.4-1.el6.x86_64
   7. FTP: pure-ftpd
      - pure-ftpd: pure-ftpd-1.0.37-1.mr.el6.x86_64
   8. Stats: awstats
      - awstats: kloxomr-stats-awstats-7.6-1.mr.noarch
D. Memory:
             total       used       free     shared    buffers     cached
Mem:          3831       1520       2311         18        106        424
-/+ buffers/cache:        989       2842
Swap:         3967         46       3921
E. Disk Space:
Filesystem           Size  Used Avail Use% Mounted on
/dev/mapper/vg-root   54G  5.3G   46G  11% /


*** Process Time: 00:00:00:51.51505 (dd:hh:mm:ss:xxxxxx) ***

* Note: run 'sh /script/sysinfo -y' if you want run 'fix-service-list' also
        (importance after Kloxo-MR update)

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,382
  • Karma: +115/-9
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Enabling Apache Deflate and PageSpeed module the right way
« Reply #3 on: 2017-05-04, 12:23:26 »
Go to 'admin > switch programs' and then set 'enable pagespeed'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline rsakhale

  • Valuable Member
  • *
  • Posts: 91
  • Karma: +0/-0
  • Gender: Male
  • Rohan Sakhale
    • View Profile
    • Rohan Rajan Sangita Sakhale
Re: Enabling Apache Deflate and PageSpeed module the right way
« Reply #4 on: 2017-05-04, 12:42:33 »
Have already done that, pagespeed is enabled and it is seen in output, but gzip is still not enabled.

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,382
  • Karma: +115/-9
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Enabling Apache Deflate and PageSpeed module the right way
« Reply #5 on: 2017-05-04, 13:13:13 »
Make sure copy '/opt/configs/apache/etc/conf.d/pagespeed.conf' to '/etc/httpf/conf.d/pagespeed.conf'. And then run 'sh /script/restart-web'.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline rsakhale

  • Valuable Member
  • *
  • Posts: 91
  • Karma: +0/-0
  • Gender: Male
  • Rohan Sakhale
    • View Profile
    • Rohan Rajan Sangita Sakhale
Re: Enabling Apache Deflate and PageSpeed module the right way
« Reply #6 on: 2017-05-04, 13:25:43 »
Done, copied the config's file as your said above and performed restart  and also fix-all

After testing with gt-metrix - https://gtmetrix.com/reports/pharmaindigital.com/xnQXP4Ju

It still says gzip not enabled

Offline fossxplorer

  • Master
  • **
  • Posts: 640
  • Karma: +1/-0
    • View Profile
Re: Enabling Apache Deflate and PageSpeed module the right way
« Reply #7 on: 2017-05-04, 13:42:56 »
Reason is this line:
[root@mail ]# cat -n /opt/configs/apache/tpl/defaults.conf.tpl| grep deflate
    61         exec("sed -i 's/^LoadModule deflate_module/#LoadModule deflate_module/' {$trgtcmdpath}/00-base.conf");

@mustafa, i think he should create  /opt/configs/apache/tpl/custom.defaults.conf.tpl where that line is commented out, then remove the uncomment it from:
[root@mail ]# cat -n /etc/httpd/conf.modules.d/00-base.conf| grep deflate
    30   #LoadModule deflate_module modules/mod_deflate.so

Finally run  sh /scripts//restart-web  ;)


@mustafa, i think i make sense to disable deflate_module when Apache is behind a proxy(Nginx or Hiawatha proxy) since at least Nginx proxy does it:
[root@mail linuxwonders]# grep -ri 'gzip on' /opt/configs/nginx/conf/*
/opt/configs/nginx/conf/globals/gzip.conf:   gzip on;  ;)
 
« Last Edit: 2017-05-04, 13:48:51 by fossxplorer »
Kloxo-MR!

Offline fossxplorer

  • Master
  • **
  • Posts: 640
  • Karma: +1/-0
    • View Profile
Re: Enabling Apache Deflate and PageSpeed module the right way
« Reply #8 on: 2017-05-04, 13:50:23 »
@rsakhale, why are you not using any reverse proxy (Nginx or Hiawatha reverse proxy) in front of Apache?
You would get better performance from such setup, at least with Nginx proxy due to better caching.

If you do that, your gzip problems will be solved too!  ;)
Kloxo-MR!

Offline rsakhale

  • Valuable Member
  • *
  • Posts: 91
  • Karma: +0/-0
  • Gender: Male
  • Rohan Sakhale
    • View Profile
    • Rohan Rajan Sangita Sakhale
Re: Enabling Apache Deflate and PageSpeed module the right way
« Reply #9 on: 2017-05-04, 14:06:19 »
@fossxplorer I tried commenting the line in 00-base.conf still no success

Could you please help me by telling the steps in Kloxo-MR to configure reverse proxy as Nginx/Hiawatha

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,382
  • Karma: +115/-9
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Enabling Apache Deflate and PageSpeed module the right way
« Reply #10 on: 2017-05-04, 14:12:07 »
I think something wrong with gtmetrix. Information from header look like OK:
Code: [Select]
Date: Thu, 04 May 2017 06:47:38 GMT
Server: Apache/2.4.25 (CentOS)
X-Content-Type-Options: nosniff
x-xss-protection: 1;mode=block
x-frame-options: SAMEORIGIN
Access-Control-Allow-Origin: *
X-Supported-By: Kloxo-MR 7.0
Strict-Transport-Security: max-age=2592000; preload
Upgrade: h2
Connection: Upgrade, close
Accept-Ranges: bytes
X-Mod-Pagespeed: 1.11.33.4-0
Cache-Control: max-age=0, no-cache, must-revalidate
Vary: Accept-Encoding,Cookie
Content-Encoding: gzip
Content-Length: 18396
Content-Type: text/html; charset=UTF-8
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline fossxplorer

  • Master
  • **
  • Posts: 640
  • Karma: +1/-0
    • View Profile
Re: Enabling Apache Deflate and PageSpeed module the right way
« Reply #11 on: 2017-05-04, 14:13:08 »
You need to UNCOMMENT it so that line should look like:
LoadModule deflate_module modules/mod_deflate.so
And you must restart httpd, e.g with restart-web. Did you do that?

Setting up reverse proxy in Kloxo-MR is simple:
Go to "Switch Program" as admin and choose e.g nginxproxy under Web and then click Update.
That should be it. If you do this, then don't worry about deflate with Apache. Nginx reverse proxy does gzip by default in Kloxo-MR!




@fossxplorer I tried commenting the line in 00-base.conf still no success

Could you please help me by telling the steps in Kloxo-MR to configure reverse proxy as Nginx/Hiawatha
Kloxo-MR!

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,382
  • Karma: +115/-9
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Enabling Apache Deflate and PageSpeed module the right way
« Reply #12 on: 2017-05-04, 14:14:27 »
BTW, try change value to '-1' for 'Static Files Expire (in days; -1 to disabled; 0 to reset)' in 'web features' for certain domain.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,382
  • Karma: +115/-9
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Enabling Apache Deflate and PageSpeed module the right way
« Reply #13 on: 2017-05-04, 14:16:58 »
No. If you enable pagespeed, deflat also enable (see /etc/httpd/conf.d/pagespeed.conf'.

By default, deflat set as disabled.
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline fossxplorer

  • Master
  • **
  • Posts: 640
  • Karma: +1/-0
    • View Profile
Re: Enabling Apache Deflate and PageSpeed module the right way
« Reply #14 on: 2017-05-04, 14:19:30 »
Yes, @mustafa is right. You already have gzip enabled (because of pagespeed as mustafa writes):
root]$ curl -H "Accept-Encoding: gzip" -I https://pharmaindigital.com/
HTTP/1.1 200 OK
Date: Thu, 04 May 2017 06:53:53 GMT
Server: Apache/2.4.25 (CentOS)
X-Content-Type-Options: nosniff
X-XSS-Protection: 1;mode=block
X-Frame-Options: SAMEORIGIN
Access-Control-Allow-Origin: *
X-Supported-By: Kloxo-MR 7.0
Strict-Transport-Security: max-age=2592000; preload
Upgrade: h2
Connection: Upgrade, close
Accept-Ranges: bytes
X-Mod-Pagespeed: 1.11.33.4-0
Cache-Control: max-age=0, no-cache, must-revalidate
Vary: Accept-Encoding,Cookie
Content-Encoding: gzip
Content-Length: 18340
Content-Type: text/html; charset=UTF-8

Kloxo-MR!

 


MRatWork Affiliates:    BIGRAF(R) Inc.    House of LMAR    EFARgrafix
Click Here

Page created in 0.037 seconds with 18 queries.

web stats analysis