LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-12-2017, 08:50 PM   #1
summersab
LQ Newbie
 
Registered: Feb 2015
Posts: 23

Rep: Reputation: Disabled
Enabling apache compression - http works, https doesn't


Okay, this is my second solid evening trying to get this to work. I can get mod_deflate compression to work over http but not over https. Via the WhatIsMyIP.org tool, this works:
http://www.whatsmyip.org/http-compre...tsYXBwLmNvbS8=

This does not:
http://www.whatsmyip.org/http-compre...RrbGFwcC5jb20v

Clearly, my htaccess is configured with the correct deflate statements because compression DOES work. So, the issue isn't there. The only other place I can think to look is in my apache configs (from /etc/apache2/sites-available/wordpress.conf):
Code:
ServerName localhost

<VirtualHost *:80>
    UseCanonicalName Off
    ServerAdmin  webmaster@localhost
    DocumentRoot /var/www/wordpress
RewriteEngine on
RewriteCond %{SERVER_NAME} =sayitwithbeef.com [OR]
RewriteCond %{SERVER_NAME} =www.sayitwithbeef.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

<VirtualHost *:443>
    ServerName www.sayitwithbeef.com
    ServerAlias sayitwithbeef.com
    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/sayitwithbeef.com/cert.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/sayitwithbeef.com/privkey.pem
    SSLCertificateChainFile /etc/letsencrypt/live/sayitwithbeef.com/chain.pem
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/wordpress
</VirtualHost>

<Directory /var/www/wordpress>
    Options +FollowSymLinks
    Options -Indexes
    AllowOverride All
    order allow,deny
    allow from all
</Directory>
What is wrong, here? I don't see anything wrong. I know there's the CRIME exploit - is that what's going on? I'm trying to enable compression for SEO purpose. There has to be some workaround, right?

Thanks for your help!
 
Old 07-13-2017, 05:34 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

It works too, according to the link you've posted above:
Quote:
https://siwbdev.tklapp.com/ is Compressed

Uncompressed Page Size: 34.5 KB
Compressed Page Size: 8.6 KB
Savings: 75.1%
 
Old 07-13-2017, 06:10 PM   #3
summersab
LQ Newbie
 
Registered: Feb 2015
Posts: 23

Original Poster
Rep: Reputation: Disabled
I actually just figured it out last night. The directive that I wasn't able to find mentioned in any other post is found in /etc/apache2/conf-enabled/security.conf:
Code:
# Disable HTTP compression when using SSL to protect against BREACH
<Location />
  SetEnvIfExpr "%{HTTPS} == 'on'" no-gzip
</Location>
I'm not sure if editing ssl.conf and wordpress.conf to change the directives in there is required as well (I didn't go back and un-edit the directives I added to those files after I got things working after this change). So, you may need to make changes in those files as well as htaccess.

Is it dangerous to disable this? Sure, in some ways - I'd never do this on a host that handles compliance-related data. However, for general-purpose websites using SSL, it's likely no real danger to any user. So, this is what you need to do to get compression working on Apache 2.4 with SSL enabled.
 
  


Reply

Tags
apache, htaccess, wordpress



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can't access https but http works fine through route-map ->squid proxy erion Linux - Newbie 7 12-19-2012 11:57 AM
An alias works for http and https (i donīt want it) albinworld Linux - Server 1 01-20-2009 02:41 PM
Apache and HTTP Compression keita_mog Linux - Software 2 01-19-2009 09:45 AM
Firefox - HTTPS works, but HTTP doesn't, any ideas? (Newbie question) RichardDarling Linux - Networking 2 11-03-2005 08:23 AM
https works, but not http squeaks_27 Linux - Networking 1 05-31-2005 08:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration