Page 1 of 2 12 LastLast
Results 1 to 20 of 34

Thread: HOWTO: Install mod_gzip

  1. #1
    Join Date
    May 2003
    Location
    /home/admin
    Posts
    298

    HOWTO: Install mod_gzip

    **UPDATE March 30, 2005 **
    I noticed a number of posts in this thread regarding imaging caching issues. I have updated the mod_gzip configuration below to resolve this issue. If you find you are experiancing image caching issues, I suggest you use this new configuration.

    Code:
    cd /root
    wget http://aleron.dl.sourceforge.net/sou...-1.3.26.1a.tgz
    
    tar zfx mod_gzip-1.3.26.1a.tgz
    cd mod_gzip-1.3.26.1a
    You must now open Makefile in your favorite editor and change the first line to:

    APXS?=/usr/sbin/apxs

    Save it, and continue:

    Code:
    make build
    make install
    Next, open /etc/httpd/conf/httpd.conf in your favorite editor. The installer has already modified the httpd.conf file for you, but you'll need to make some minor changes. When you reach the LoadModule section of httpd.conf, find the mod_gzip line (commented out) and delete it. After all the LoadModules, paste:
    Code:
    LoadModule gzip_module        /usr/lib/apache/mod_gzip.so
    #LoadModule frontpage_module   /usr/lib/apache/mod_frontpage.so
    LoadModule perl_module        /usr/lib/apache/libperl.so
    
    <IfModule mod_gzip.c>
    mod_gzip_on Yes
    mod_gzip_minimum_file_size 300
    mod_gzip_maximum_file_size 0
    mod_gzip_maximum_inmem_size 100000
    mod_gzip_item_include file \.htm$
    mod_gzip_item_include file \.html$
    mod_gzip_item_include file \.shtml$
    mod_gzip_item_include file \.shtm$
    mod_gzip_item_include file \.jsp$
    mod_gzip_item_include file \.php$
    mod_gzip_item_include file \.pl$
    mod_gzip_item_include file \.cgi$
    mod_gzip_item_include mime text/.*
    mod_gzip_item_include mime ^application/x-httpd-php
    mod_gzip_item_include mime httpd/unix-directory
    mod_gzip_item_include handler ^perl-script$
    mod_gzip_item_include handler ^server-status$
    mod_gzip_item_include handler ^server-info$
    mod_gzip_item_exclude file .css$
    mod_gzip_item_exclude file .js$
    #mod_gzip_item_exclude mime ^image/.*
    mod_gzip_dechunk yes
    mod_gzip_temp_dir /tmp
    mod_gzip_keep_workfiles No
    mod_gzip_can_negotiate yes
    mod_gzip_send_vary Off
    mod_gzip_item_exclude mime ^image/.$
    mod_gzip_item_exclude mime ^image/
    mod_gzip_item_exclude rspheader Content-Type:image/*
    </IfModule>
    Scroll down a bit future and find the AddModule section of httpd.conf. At the end, remove the mod_gzip line (commented out), and below all the AddModules, paste this:
    Code:
    AddModule mod_gzip.c
    Save httpd.conf and exit the editor. Finally, restart Apache (/etc/rc.d/init.d/httpd restart).

    You can check if your installation was successful by entering a URL at http://www.port80software.com/tools/compresscheck and seeing if it returns mod_gzip in the header.

    Enjoy .
    Last edited by loopforever; 03-30-2005 at 10:25 AM.
    Matt Savona
    serveIO
    Creator of the DirectAdmin Enhanced Theme

  2. #2
    Join Date
    Jun 2003
    Location
    on the net!
    Posts
    89

    search and destroy IE :)

    I installed mod_gzip to my DA server using these instructions.
    But there is something wrong after installation.
    Everthing seems ok . Mod_Gzip is working but my IE6 + SP1 on my winxp pro is NOT caching images.

    So I make some tests using this configuration Both Opera7 netscape and Mozilla caches images as expected. But IE6 + SP1 stops image caching after this configuration applied.

    IE6 as usually downloads and puts a single big file in to temporary folder. But request images evertime from the server. As from the statistics of a sample site my users %90 uses IE 5+6 so there is no use of this configuration. Mod_gzip installed I use much more bandwidth than I try to save..

    So I edited this config a little bit there is a problem with image mime stuff. I read form original config file of mod_gzip it says that you don`t have to include or exclude a full type but only add an mime type.

    Code:
    LoadModule gzip_module        /usr/lib/apache/mod_gzip.so
    
    <IfModule mod_gzip.c>
    mod_gzip_on Yes
    mod_gzip_minimum_file_size 300
    mod_gzip_maximum_file_size 0
    mod_gzip_maximum_inmem_size 100000
    mod_gzip_item_include file \.htm$
    mod_gzip_item_include file \.html$
    mod_gzip_item_include file \.shtml$
    mod_gzip_item_include file \.shtm$
    mod_gzip_item_include file \.jsp$
    mod_gzip_item_include file \.php$
    mod_gzip_item_include file \.pl$
    mod_gzip_item_include file \.cgi$
    mod_gzip_item_include mime text/.*
    mod_gzip_item_include mime ^application/x-httpd-php
    mod_gzip_item_include mime httpd/unix-directory
    mod_gzip_item_include handler ^perl-script$
    mod_gzip_item_include handler ^server-status$
    mod_gzip_item_include handler ^server-info$
    mod_gzip_item_exclude file .css$
    mod_gzip_item_exclude file .js$
    
    mod_gzip_item_exclude file .jpg$
    mod_gzip_item_exclude file .gif$
    
    mod_gzip_item_exclude mime ^image/.*
    
    mod_gzip_dechunk yes
    mod_gzip_temp_dir /tmp
    mod_gzip_keep_workfiles No
    mod_gzip_can_negotiate yes
    </IfModule>
    does the trick for IE6+SP1 but I have got more than 60 left without caching in server image mime types..

    Anyway this is something with mimetypes. But I did not have a all OK fix. So for now I stopped using mod_gzip.

    I really want to know if someone dealt with this problem before..
    If yes what is the correct config file for mod_gzip in apache 1.3.28 default DA installation..
    Last edited by sHuKKo; 09-14-2003 at 03:10 AM.

  3. #3
    Join Date
    Sep 2003
    Posts
    37
    Is there an answer for this yet? I'm concerned about trying to compress images...

    Thanks,
    John

  4. #4
    Join Date
    May 2003
    Location
    /home/admin
    Posts
    298
    I was just playing around with this, and I found the image caching fix with Firebird (haven't tested with IE yet).

    When Firebird:

    1) Reaches it's cache size limit or
    2) Has already cached a page, but not the images...

    It will refuse to cache the images. So, all you need to do is clear the cache in Firebird, reload the page, and it works .
    Matt Savona
    serveIO
    Creator of the DirectAdmin Enhanced Theme

  5. #5
    Join Date
    Jan 2004
    Posts
    150
    Hi,
    can inform the directadmin creators if it is stable to use modgzip?
    I have bad expirience of cpanel with modgzip, so it is needed to be sure that modgzip can working fine with directadmin apache.
    I use freebsd 4.9
    Thanks a lot.
    Regards,
    Christos

  6. #6
    Hello,

    I couldn't say if modgzip was stable or not, but I don't see why it wouldn't be. DA has no dependancy on any particular build of apache.

    John

  7. #7
    Join Date
    May 2003
    Location
    /home/admin
    Posts
    298
    I've used it on a DA machine for about 8 months without any problems.
    Matt Savona
    serveIO
    Creator of the DirectAdmin Enhanced Theme

  8. #8
    Join Date
    Jan 2004
    Posts
    217

    mod_gzip with mod_ssl ??

    I heard that there were problems with running mod_gzip and mod_ssl . Is anyone doing this. If so, have you had any problems?

    I found THIS but the date on it is almost 2 years ago. Is this still an issue?

    cheers,
    brandt

  9. #9
    Join Date
    Sep 2003
    Posts
    130
    Hi,

    I am running RH 9.0 with apache mod_gzip + mod_ssl without any problems.

  10. #10
    Join Date
    Jan 2004
    Posts
    97
    I am not....

  11. #11
    Join Date
    Mar 2004
    Posts
    16
    Ok,

    I followed this How-to and it worked for webpages. My problem I'm having now is people can NOT download files via. a hyperlink. If they type in the address WITHOUT http:// it will work. ie. domain.com/file.exe will work... but http://domain.com/file.exe will NOT work. Any reason why this would be???

  12. #12
    Join Date
    Oct 2003
    Posts
    392
    is mod_gzip installed by default for the most recent DA? reason is because i found all my site already have gzip enabled.

    i doubt this is necessary in the feature. am i right about it?
    Last edited by neorder; 05-04-2004 at 05:00 AM.

  13. #13
    Join Date
    Oct 2003
    Posts
    392
    okay, my question, how do i tell if mod_gzip is installed?

    thanks a lot!

  14. #14
    Join Date
    Oct 2003
    Posts
    392
    i'm confused.

    since we are going to install Mod_gzip, why

    1. we need to
    find the mod_gzip line (commented out) and delete it.
    are you referring this line in httpd?


    #LoadModule gzip_module /usr/lib/apache/mod_gzip.so
    2. where to add
    AddModule mod_gzip.c
    ?

    i've had this in my httpd

    it's at the end of
    # Reconstruction of the complete module list from all available modules
    </IfDefine>
    #AddModule mod_gzip.c
    after i comments out this line, i can't restart my httpd, what's wrong with my setting?

  15. #15
    Join Date
    Oct 2003
    Posts
    392
    okay, i commenced out both lines

    LoadModule gzip_module /usr/lib/apache/mod_gzip.so
    AddModule mod_gzip.c

    now httpd restarted, how can i check the performance? i've used these two:

    http://www.desilva.biz/gzip-test.php
    http://leknor.com/code/gziped.php

    But before i install Mod_gzip, i found most of my pages are gzipped already, there is no imporvement after install Mod_gzip.

    my question, do i recommand my users who run forums such as vbulletin or IPB to switch off their gzip?

  16. #16
    Join Date
    Jun 2003
    Posts
    32
    Has anyone had problems installing it according to this guide with the most recent DA ?

    I've had a Cpanel servera long time, and I got DA with this new machine. I followed this guide, the one on i4net , the ones on Cpanel's forums, the ones on EV1 -- I couldn't seem to get it working with DA.

    I got the following error.

    -------------
    Syntax error on line 1562 of /etc/httpd/conf/httpd.conf:
    Invalid command 'SSLEngine', perhaps mis-spelled or defined by a module not included in the server configuration
    -------------

    When we took out all modgzip tags - things are fine.

    So I would like to know if someone got something familiar to this recently. I need modgzip more than anything else. I don't ever use SSL, and I don't plan to host sites that need it either. So if someone can even tell me how tot totally remove that module, I wouldn't mind. Though I suspect my problem might be else where. We've not edited the httpd at all other than the changes that were specified in the guide in here.

  17. #17
    Join Date
    Jun 2003
    Posts
    32
    my question, do i recommand my users who run forums such as vbulletin or IPB to switch off their gzip?
    Forum programs usually come with GZip activated. Don't tell them to turn it off, as in most cases the gzip is set to compress at CPU leve 1 - the minimal one. The Mod_Gzip has hard coded value of 6 - which saves you a few comre KB, but it uses a lot of CPU power comparatively to not make it worth it to be set that high. In the future versions they are going to let people select the compression level.

    ModGzip is vastly helpful, when you've got lots of static pages. You will get around 70% in compression. IT will save you a lot of bandwidth. However, if you install it, you might be restriting your income, as your users can serve more pages, and use less bandwidth.

  18. #18
    Join Date
    Jul 2003
    Posts
    474
    is it possible to set the mod_gzip level to 1 instead of 6?

    is this howto still uptodate?

  19. #19
    Join Date
    Jun 2003
    Posts
    32
    I used this guide about 1 month ago - no problems.

  20. #20
    Join Date
    Aug 2004
    Location
    uk
    Posts
    1,582
    I might try this if someone knows a way to make it use compression level 1.

Page 1 of 2 12 LastLast

Similar Threads

  1. Howto install p3p
    By calimero1505 in forum General Technical Discussion & Troubleshooting
    Replies: 1
    Last Post: 04-14-2008, 08:48 AM
  2. how to install mod_security AND mod_gzip!?
    By lkbryant in forum Apache (WWW)
    Replies: 0
    Last Post: 02-16-2006, 12:59 AM
  3. will install mod_gzip cause any problem with DA?
    By jt2377 in forum DirectAdmin General Discussion
    Replies: 1
    Last Post: 02-06-2006, 08:28 AM
  4. Install Mod_Gzip with Apache
    By bigboy in forum How-To Guides
    Replies: 2
    Last Post: 01-27-2006, 08:15 PM
  5. when i install mod_gzip happened this problem.
    By jameshp in forum Installation / System Requirements
    Replies: 3
    Last Post: 11-06-2005, 01:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •