Web Hosting Talk







View Full Version : RAQ3, MOD_GZIP and Apache (saving bandwidth using compression)


Blight
03-27-2001, 12:10 AM
Ok, let me start off by saying that I have almost no linux/unix experience...

I own a RAQ3 and I came upon MOD_GZIP:
http://www.remotecommunications.com/apache/mod_gzip/

I'm aware of several people who've installed it and have gained massive bandwidth reduction due to the automatic compression of data upon request (even with dynamic content such as PHP).

My question is, "Is there a package for this under the RAQ3", I did a search, couldn't find one, but perhaps I don't know where to look and you do.

If there isn't a package, can someone post a stupid-proof guide on how to install (and uninstall if possible) this code for the RAQ3 ?

iplexx
03-27-2001, 06:20 AM
hope this help....

http://www.darkmere.gen.nz/2000/1105.html

Blight
03-27-2001, 06:49 AM
It doesn't help, this doesn't seem to be geared toward the RAQ3, and me being a linux novice, I can't make the translation ...

I really need some hand holding on this :)

iplexx
03-27-2001, 07:42 AM
step-by-step based upon http://www.darkmere.gen.nz/2000/1105.html

1.) ssh to your raq as admin

2.) su

3.) cd /usr/lib/apache

4.) wget http://www.remotecommunications.com/apache/mod_gzip/src/1.3.19.1a/mod_gzip.so

5.) chmod 755 mod_gzip.so

6.) vi /etc/httpd/conf/httpd.conf

7.) add loading (after the other LoadModule lines; ie. in Extra Modules section)
LoadModule gzip_module /usr/lib/apche/mod_gzip.so

8.) add mod_gzip options
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_minimum_file_size 300
mod_gzip_maximum_inmem_size 60000
mod_gzip_keep_workfiles No
mod_gzip_temp_dir "/tmp"
mod_gzip_item_include file \.htm$
mod_gzip_item_include file \.html$
mod_gzip_item_include mime text/.*
mod_gzip_item_include file \.php$

9.) add a log for mod_gzip if you like
LogFormat "%h %l %u %t \"%r\" %>s %b mod_gzip: %{mod_gzip_result}n In:%{mod_gzip_input_size}n Out:%{mod_gzip_output_size}n:%{mod_gzip_compression_ratio}npct." log_common_with_mod_gzip_info2
CustomLog /home/sites/home/logs/my_server_gzip_common.log log_common_with_mod_gzip

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" mod_gzip: %{mod_gzip_compression_ratio}npct." log_full_plus_gzip
CustomLog /home/sites/home/logs/my_server_gzip_full.log log_full_plus_gzip

10.) restart apache
/etc/rc.d/init.d/httpd restart

Notes:
- maybe backup your httpd.conf before if you're unsure what you do!
- step 8.gzip options are just samples, read
http://www.remotecommunications.com/apache/mod_gzip/src/1.3.19.1a/commands.txt
http://www.remotecommunications.com/apache/mod_gzip/src/1.3.19.1a/samples.txt
- this tutorial was testet with one of our RaQ4i, dunno if it works with other configurations
- to check if it works see the logs, install mgstats, use the mog_gzip internal html information pages

_____________
wbr,
Martin/Iplexx

[Edited by iplexx on 03-27-2001 at 06:52 AM]

Blight
03-27-2001, 09:43 AM
Just a verification ...

In #8, do I add these commands (altered to fit my site setup) directly after the LoadModule command? or where else should I put them?

Also, can I edit the httpd.conf file by first FTPing it (in text mode) locally to my machine, editing it, then FTPing it back (agian in text mode) ?

And what about SSI files, can I do something like this?:
mod_gzip_item_include file \.shtml$


[Edited by Blight on 03-27-2001 at 09:02 AM]

iplexx
03-27-2001, 10:58 AM
ad 1
just somewhere below; you can surround everything except
the LoadModule by
<IfModule mod_gzip.c>
...gzip stuff...
</IfModule>

ad 2
ftp should work; dunno if you can ftp in as root (you require root privileges to make the necessary changes); in worst case you have to upload it somewhere else and make a cp /somewhere/httpd.conf /etc/httpd/conf/

ad 3
yes

Blight
03-28-2001, 06:02 AM
Ok, done all this, called for the apache restart and got the following message:

Shutting down Web Service: httpd
Setting up Web Service: Syntax error on line 35 of /etc/httpd/conf/httpd.conf:
Cannot load /usr/lib/apache/mod_gzip.so into server: /usr/lib/apache/mod_gzip.so: undefined symbol: ap_regexec


Doh, what do I do now?

P.S.
The server isn't down, I simply restored the old httpd.conf file and restarted apache.


[Edited by Blight on 03-28-2001 at 08:27 AM]

iplexx
03-29-2001, 03:12 AM
It works for RaQ4, and I don't have RaQ3 avaible to test.
But it seems you're missing some library which provides the regexec function.. I'm no developer, maybe someone else knows what libs to install?

Blight
03-31-2001, 04:16 AM
I got the following reply from the author of mod_gzip:
---
Find out what version of Apache it really is or I can't
even begin to help you. Just look at the console when you
run Apache and see what the startup message says.

As far as I know... the ap_regexec API call has been in the
Apache Server for over 3 years.

Is it possible this RAQ3 stuff is using some ANCIENT version
of Apache? Like 1.3.1 or something?
---
Any idea what version of apache does the RAQ3 (with latest updates) use?

Phiberop
03-31-2001, 04:39 AM
Hello,

get to a command line on your RaQ and type the following:

httpd -v

This command will spit out the version of Apache you are running.

httpd -V will let you know the version as well as the modules compiles with Apache.

Regards,

Mike

Cael
03-31-2001, 08:37 AM
If I am not wrong, RaQ3 runs with Apache v1.3.9

Blight
04-01-2001, 01:57 AM
Trying to do "httpd -v" gives this line :(

Usage: /etc/rc.d/init.d/httpd {start|stop|restart|reload|status}

Phiberop
04-01-2001, 02:12 AM
Try it with a uppercase V once, Im on a RaQ4 and -v worked for me but there could be a difference.

PLE
04-01-2001, 06:04 PM
The site http://www.inmatrix.com is running Apache/1.3.6 (Unix) mod_perl/1.21 mod_ssl/2.2.8 OpenSSL/0.9.2b on Linux.

http://uptime.netcraft.com/up/graph/?host=www.inmatrix.com

NewonNet
07-25-2001, 01:12 AM
Originally posted by Donovan
If I am not wrong, RaQ3 runs with Apache v1.3.9

I have a RAQ 4 that has this version

Apache/1.3.12

I think the latest is Apache/1.3.20

huck
07-25-2001, 07:35 AM
I installed mod_gzip on my Raq 4 and it broke .htaccess. I had to add the following excludes to restore access:
mod_gzip_item_exclude file authorizationRequired.html
mod_gzip_item_exclude file fileNotFound.html
mod_gzip_item_exclude file internalServerError.html
mod_gzip_item_exclude file forbidden.html

Why, I don't know -- this just works.

scsi
07-25-2001, 03:46 PM
hi,
I've compiled mod_gzip following instructions. I'm on a raq4 and when restardted apache : [warn] Loaded DSO /usr/lib/apache/mod_gzip.so uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with -DEAPI).
how to fix this?
indeed what command use to test gzip working?
thanx

:cool: