• Resolved eatandbemerry

    (@eatandbemerry)


    hiya. i contacted my host, they said [dreamhost, using shared hosting] that mod_deflate is installed and enabled on my apache server. and to go back to you and tell you that; they have no idea why gzip isn’t working with hummingbird. ideas?? i really need this plugin to work, pleeeease help. soon, please! ?? thanks in advance for your assistance.

    and yes….i have re-checked/re-scanned with hummingbird many times. ?? it is not working with gzip. here’s the message i’m getting, which i’m sure you’ve seen a few times in the past yourself, lol…but i should prolly post it here regardless. ??

    – Your server may not have the “deflate” module enabled (mod_deflate for Apache, ngx_http_gzip_module for NGINX).
    – Contact your host. If deflate is enabled, ask why all .htaccess or nginx.conf compression rules are not being applied.

    any suggestions?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Hi @eatandbemerry,

    Could you please post a link to your website so I can check?

    Best regards,
    Anton

    Thread Starter eatandbemerry

    (@eatandbemerry)

    well…here’s the thing. it’s not public yet; i’d rather not take off the “under construction” status and have my ‘dummy photos’ and whatnot get indexed by google.

    i’d much rather give you direct access through a username and password i’d set up only for you, so you could look at it that way. and also…i tried to do what was suggested in the “manual” option…….and messed up my site so badly i had to do a restore, lol.

    but since then i also installed ‘pagespeed ninja’ and it also said compression (gzip) was not able to be enabled — so i know it’s not a fluke. and every other gzip program i’ve installed has not produced any results; like they were never installed there in the first place. which makes sense now that gzip isn’t being “activated” or “enabled”….glad to see hummingbird has confirmed that for me. pagespeed ninja too, but not as specifically as hummingbird! ??

    do you have a private email address or something that i can use to give you temporary access (login, password) to my site?

    Hi @eatandbemerry,

    I would recommend you check if you .htaccess rules are being applied. The easiest method would be this one:

    The simple solution to verify and check if the .htacess configuration file is even touched and parsed is forcing an error. More precisely a 500 Internal Server Error.

    In order to do that you simple add something to the first line of the .htaccess file that doesn’t make any sense. This could be a single letter or number, a word, basically anything that is not a directive.

    If you get the 500 Internal Server Error you know that the file has been read because that line triggered the error.

    If you don’t get an error your server setup is wrong because your .htaccess has not even been touched.

    If you get an error, you can contact me via this form:
    https://premium.wpmudev.org/contact/#i-have-a-different-question

    Please use this subject, so the email is assigned to me:
    Subject: “Attn: Anton”

    Best regards,
    Anton

    Thread Starter eatandbemerry

    (@eatandbemerry)

    ohhhh the good [?] news: i know the .htaccess file is being read, because when i edited it ‘wrongly’ before — if that’s the way to put it — the site was messed up. so it’s definitely being touched. ?? that’s precisely why i had to do the restore! ??

    so, what do you suggest i do next?

    Thread Starter eatandbemerry

    (@eatandbemerry)

    hey btw, this is what the text in my htaccess file says now (because it was restored)….no mention of hummingbird in there because i’ve not reinstalled it ((yet))….

    where would i put the code that you would need me to put there? what would be the code that i should have in the *entire* file? that may have been what i did wrong before — why the ‘new version’ i made of the htaccess file, when i put the code in there that the ‘manual’ method in the screen to configure gzip compression in hummingbird told me to put in there. it may not have been the code itself, but where i put it in the file that crashed the site.

    so, would you be so kind as to edit the following info that is in my pre-hummingbird installation htaccess file (below) and post it here? i’ll go and reinstall hummingbird after that. then it can install and hopefully immediately grab this code when it does. and i won’t have crashed the site ((again)) because i put the code in the wrong place in my htaccess file. well, at least that’s my hope! haha…

    here’s what the htaccess file looks like for me, before i install hummingbird…again, please bear in mind that this is the file and how it appears due to a rollback to its original state after i had to restore the site to its pre-hummingbird state:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    # Wordfence WAF
    <Files ".user.ini">
    <IfModule mod_authz_core.c>
    	Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
    	Order deny,allow
    	Deny from all
    </IfModule>
    </Files>
    
    # END Wordfence WAF

    [Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]

    • This reply was modified 6 years, 11 months ago by bdbrown.
    Thread Starter eatandbemerry

    (@eatandbemerry)

    and P.S. if it wasn’t apparent before, i have no idea what i’m doing. ?? please do post what the *entire* htaccess file code should have in it, because fwiw i think i messed it up by putting the recommended [recommended by the hummingbird plugin, that is..in the gzip configuration screen] ‘manual method’ code in the wrong area of the htaccess file. or, i edited the file wrong. or….no idea. ??

    but please, pleeease…..just paste the whole htaccess file code here — it’d be appreciated!! thank you in advance for help with this!

    Thread Starter eatandbemerry

    (@eatandbemerry)

    OH CHECK IT OUT!!! i installed a plugin that gives me an overview of what’s on my site…neato. it’s called ‘server status’ and all the info appears in the admin dashboard. really love this. ??

    they are:

    OS Type: Linux skymaster 3.2.61-grsec-modsign #1 SMP Tue Aug 12 09:58:26 UTC 2014 x86_64 (64 bit)
    Server Software: Apache
    CPU Cores: 8 Cores
    Load Average: 7.81, 7.58, 7.49
    Disk Space: 4.00 GB (17%) used of 23.14 GB total
    Database Size: 22.39 MB
    MySQL Version: 5.6.34-log
    Database Charset (Collate): utf8 (n/a)
    PHP Version: 7.0.24
    PHP Extensions: Core, date, libxml, pcre, sqlite3, filter, mbstring, SPL, PDO, Reflection, pdo_sqlite, hash, session, cgi-fcgi, bcmath, bz2, calendar, ctype, curl, dom, standard, ftp, gd, gettext, exif, iconv, imap, json, mcrypt, mysqlnd, openssl, pcntl, pdo_mysql, posix, pspell, mysqli, SimpleXML, soap, sockets, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib, imagick, Zend OPcache
    Max Upload, Post Size (Input Vars): 100M, 105M (3000)
    Memory Usage: 48M (12%) of 400M (actual limit)
    WP Memory Limit: 400M (defined limit)
    WP Admin Memory Limit: 256M (defined limit)
    WP Debug: Disabled (no logging, display)
    Opcache Size (Max Files, Revalidate): 4M (3907, 2 secs)
    Page Cache (Plugin): Disabled
    Object Cache: Disabled

    i installed a plugin that gives me an overview of what’s on my site…

    I advice against installing plugins that will give you information that you can get more easily by logging into your account or run phpinfo() for example. Every plugin you install in WordPress is a liability, one more thing to update, make sure it doesn’t conflict with something else, etc.

    Now, more to your point… Post your full .htaccess with the gzip code (and consider opening a thread for DreamHost-specific issues also on https://discussion.dreamhost.com)

    Thread Starter eatandbemerry

    (@eatandbemerry)

    thanks!

    my full .htaccess file is already posted above, tho.

    Thread Starter eatandbemerry

    (@eatandbemerry)

    ohhhh….i love the internet. i found on another forum that someone added this code to their .htaccess file when using gzip at their shared dreamhost account….

    #Gzip
    <ifmodule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript
    </ifmodule>
    #End Gzip

    so! that meant that my .htaccess file wound up looking like this (below).

    and, for the noobs out there (like i was recently), i went into FTP and used the text editor there to live edit it on the site in FTP itself.

    BUT first downloaded a copy of it (what it was like before i edited it) to my computer, into a folder i named, ‘htaccess file before edits for gzip’…

    then, i duplicated that copy, pasted it into another folder i named, ‘htaccess file after edits for gzip’ then opened it up in aptana, edited it there…then copied that text, went back to the live/open file that was being used on the hosting server — it was open in FTP — and i was using the ‘text editor’ function…so, as i had the ‘text editor’ open, of the .htaccess file…i then pasted this code over the .htaccess file i had open, then saved it:

    
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    #Gzip
    <ifmodule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript
    </ifmodule>
    #End Gzip
    
    # Wordfence WAF
    <Files ".user.ini">
    <IfModule mod_authz_core.c>
    	Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
    	Order deny,allow
    	Deny from all
    </IfModule>
    </Files>
    
    # END Wordfence WAF
    

    and….ta-daaaa, it worked! well, the enabling of gzip on my site, that is. i have yet to re-install hummingbird (or any other caching program that unsuccessfully tried to use gzip in the past — w3 total cache, super cache, fastest cache, and the like)….i thought they were just crappy programs, until hummingbird told me gzip wasn’t enabled! then i used pagespeed ninja, and then google’s pagespeed insights…and they too told me gzip wasn’t enabled. so i know it wasn’t a hummingbird issue.

    i’ve since run pagespeed ninja and google pagespeed insights, and they both tell me ‘compression enabled’…YAAY! ??

    now, i just have to ((cross my fingers!)) reinstall hummingbird. wish me luck!

    Thread Starter eatandbemerry

    (@eatandbemerry)

    i am happy to report…that’s what did it, lol. that’s all i had to do!! fwiw i also got another ‘warning’ when i ran google pagespeed insights — abt caching. that i needed to ‘leverage browser caching’…so i found other code too, and added it!

    SO…if someone has that come up [the caching issue] along with the gzip not working part when you run google pagespeed insights, well here’s your solution! just use this code for your .htaccess file [you can eliminate the ‘wordfence’ part, i obvs have wordfence to have that there, it’s a security plugin if you don’t know, btw]…and you’ll be all set! ??

    here’s the final .htaccess code i wound up using!

    i hope this answer helps someone else down the road in the future. i’m still tweaking my site(s)…and hopefully i’ll get a speed score in the 90s soon for the one i’m working on right now. with all these tweaks i’ve raised it to 88; hoping for 98 soon! ?? wish me luck on that too, ok? ??

    
    
    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType text/html "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType text/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 1 month"
    </IfModule>
    ## EXPIRES CACHING ##
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    #Gzip
    <ifmodule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript
    </ifmodule>
    #End Gzip
    
    # Wordfence WAF
    <Files ".user.ini">
    <IfModule mod_authz_core.c>
    	Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
    	Order deny,allow
    	Deny from all
    </IfModule>
    </Files>
    
    # END Wordfence WAF
    

    Hi @eatandbemerry,

    It’s good that you made it work. Hummingbird adds similar gzip code, but just with more file types that can be gzipped. The only difference is that Hummingbird has one extra check:

    <IfModule mod_filter.c>
    ...
    </IfModule>

    So you can try the test with putting some random text inside this If statement and see if you get the 500 error. Maybe you don’t have mod_filter activated on the server. That’s the only difference between Hummingbird code and the one that you have working.

    Caching code is different, HB tries to check files with FilesMatch instead of just specifying ExpiresByType for each file type.

    Best regards,
    Anton

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    FYI, the order of ‘things’ in an htaccess should be this

    1) security (including WordFence type code)
    2) hotlink blocking
    3) compression
    4) Redirects
    5) WordPress

    Always put the WP code at the very bottom ??

    So I’d make yours like this:

    
    # Wordfence WAF
    <Files ".user.ini">
    <IfModule mod_authz_core.c>
    	Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
    	Order deny,allow
    	Deny from all
    </IfModule>
    </Files>
    
    # END Wordfence WAF
    
    #Gzip
    <ifmodule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript
    </ifmodule>
    #End Gzip
    
    ## EXPIRES CACHING ##
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType text/html "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType text/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 1 month"
    </IfModule>
    ## EXPIRES CACHING ##
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    

    FWIW, DreamHost servers DO gzip, but sometimes I’ve seen apps including YSlow not pick up on that unless it’s explicitly defined in the htaccess. Oh internet. :SIGH: You didn’t do anything wrong. It’s just a weird place.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘gzip is installed and enabled, apache server, shared hosting [dreamhost], php 7’ is closed to new replies.