Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Installing mod_gzip on Linux

Discussion in 'General Discussion' started by billau, Jul 31, 2004.

  1. billau

    billau Well-Known Member

    Joined:
    Dec 24, 2003
    Messages:
    65
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    Brisbane, Australia
    . Login as root user to your server
    2. Create /home/modgziptmp directory

    #mkdir /home/modgziptmp
    #chmod 5777 /home/modgziptmp

    3. Grab mod_gzip 1.3.26a.1a source files and place them in /usr/local/src

    #cd /usr/local/src
    #wget http://telia.dl.sourceforge.net/sourceforge/mod-gzip/mod_gzip-1.3.26.1a.tgz

    4. Extract files and change to directory

    #tar xfz mod_gzip-1.3.26.1a.tgz
    #cd mod_gzip-1.3.26.1a

    5. Compile/install mod_gzip by typing 2 commands (note path/to/apxs maybe different on your server)

    #make APXS=/usr/local/apache/bin/apxs
    #make install APXS=/usr/local/apache/bin/apxs

    6. Add the mod_gzip configuration settings after mod_gzip.c in httpd.conf

    mod_gzip_on Yes
    mod_gzip_can_negotiate Yes
    mod_gzip_static_suffix .gz
    AddEncoding gzip .gz
    mod_gzip_update_static No
    mod_gzip_command_version '/mod_gzip_status'
    mod_gzip_temp_dir /home/modgziptmp
    mod_gzip_keep_workfiles No
    mod_gzip_minimum_file_size 500
    mod_gzip_maximum_file_size 500000
    mod_gzip_maximum_inmem_size 60000
    mod_gzip_min_http 1000
    mod_gzip_handle_methods GET POST
    mod_gzip_item_exclude reqheader "User-agent: Mozilla/4.0[678]"
    mod_gzip_item_include file .html$
    mod_gzip_item_include file .shtml$
    mod_gzip_item_include file .htm$
    mod_gzip_item_include file .shtm$
    mod_gzip_item_include file .php$
    mod_gzip_item_include file .phtml$
    mod_gzip_item_exclude file .js$
    mod_gzip_item_exclude file .css$
    mod_gzip_item_include file .pl$
    mod_gzip_item_include handler ^cgi-script$
    mod_gzip_item_include mime ^text/html$
    mod_gzip_item_include mime ^text/plain$
    mod_gzip_item_include mime ^httpd/unix-directory$
    mod_gzip_item_exclude mime ^image/
    mod_gzip_dechunk Yes
    mod_gzip_add_header_count Yes
    mod_gzip_send_vary Yes

    7. Restart apache

    #/etc/rc.d/init.d/httpd stop
    #/etc/rc.d/init.d/httpd start

    8. Check to see if mod_gzip is installed by going to http://leknor.com/code/gziped.php and enter the server url[/url]
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. thechronic

    thechronic Member

    Joined:
    Oct 25, 2003
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    151
    Or simply recompile apache in WHM and check the mod_gzip checkbox :)

    Has worked perfectly for me.
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,460
    Likes Received:
    21
    Trophy Points:
    463
    Location:
    Go on, have a guess
    I wish you'd post the implications of your little (sometimes pointless) howto posts.

    A warning for those who think - oh, I'll install that. Mod_gzip helps you reduce data transfer from your server. If you don't have a data transfer quota problem, don't install mod_gzip, especially if you have any performance issues as it will only add to the load of your server.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. K_aneda

    K_aneda Well-Known Member

    Joined:
    Feb 29, 2004
    Messages:
    56
    Likes Received:
    0
    Trophy Points:
    156
    Location:
    Sydney, Australia
    Any figures as to what kind of a performance hit you take from gzip'd sites?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. thechronic

    thechronic Member

    Joined:
    Oct 25, 2003
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    151
    It also speeds up loading of large pages tremendously, for large HTML documents I typically get 85-92% smaller file sizes, which gives a huge difference in downloading time for modem users, and a noticeable difference for broadband users - the pages seem to appear instantly instead of taking half a second.

    It does have some downsides, the load on the server goes up a bit so it's not recommended for overloaded servers.
    It is also known to be incompatible with mod_ssl so if you rely on SSL it's not recommended.
     
  6. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    191
    Yep. Found that out the hard way just last week...
     
  7. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,574
    Likes Received:
    3
    Trophy Points:
    343
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Never had an issue mod_ssl and mod_gzip both have worked fine on multiple installations. Both have worked well without doing anything extra.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. chrisbuk

    chrisbuk Well-Known Member
    PartnerNOC

    Joined:
    Dec 7, 2003
    Messages:
    394
    Likes Received:
    0
    Trophy Points:
    166
    Location:
    Liverpool, United Kingdom
    cPanel Access Level:
    DataCenter Provider
    Hi

    I know this is a really old thread but i found it while researching installing Mod_GZIP

    i followed the instruction but I have a issue when i go to step make install APXS=/usr/local/apache/bin/apxs

    this happens when i paste the command

    root@vm1 [/usr/local/src/mod_gzip-1.3.26.1a]# make install APXS=/usr/local/apache/bin/apxs
    /usr/local/apache/bin/apxs -A -i mod_gzip.so
    apxs:Error: Sorry, cannot determine bootstrap symbol name.
    apxs:Error: Please specify one with option `-n'.
    make: *** [install] Error 1

    using apache 2.2 with PHP 5.2.14
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. prashant_ohol

    prashant_ohol Active Member

    Joined:
    Nov 22, 2004
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    156
    mod_deflate has replaced Apache 1.3's mod_gzip in Apache2. so use mod_deflate

    Prashant
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice