Admins eHow SysAdmin Tips & Tricks

September 5, 2012

How to verify mod_deflate, gzip working ?

Filed under: Apache — Tags: , , , — admin @ 12:42 pm

Lets say you have enabled compression in your web server by mod_deflate, gzip and now want to verify if the content is really compressed, here is how to do it :

1.Easy way :
Go to this link : http://www.gidnetwork.com/tools/gzip-test.php
Enter your website URL inside “Web Page URL” and click on “Check”

2.Technical way :
Make sure curl is installed on your server. then run following command (change yoursite.com to your own domain) :

curl -I -H 'Accept-Encoding: gzip,deflate' http://yoursite.com

what you should look for in output is this line :

Content-Encoding: gzip

if it is not there, the content is not compressed.
here is the output for AdminseHow :

root@x~# curl -I -H 'Accept-Encoding: gzip,deflate' http://www.adminsehow.com

HTTP/1.1 406 Not Acceptable
Server: ApacheBooster/1.3
Date: Wed, 05 Sep 2012 12:39:22 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 8740
Connection: keep-alive
X-Pingback: http://www.adminsehow.com/xmlrpc.php
Vary: Accept-Encoding,Cookie,User-Agent
X-Powered-By: W3 Total Cache/0.9.2.4
Content-Encoding: gzip
Last-Modified: Wed, 05 Sep 2012 12:39:22 GMT
X-Cacheable: YES
Accept-Ranges: bytes
X-Varnish: 1984902025
Via: 1.1 varnish
age: 0
X-Cache: MISS

The content is compressed. YAY 😀
PS : I know the response is “HTTP/1.1 406 Not Acceptable”, it is because of mod_security installed on server which prevents such simple automated requests to be served. but it doesn’t matter for our test.

September 3, 2012

Install SNMP on Debian

Filed under: Debian — Tags: , , , — admin @ 10:15 am

The following easy steps will install snmp daemon on your Debian server :

apt-get install snmpd snmp

now snmpd simple configuration ( change SECRET_NAME to a complex string ) :

echo rocommunity SECRET_NAME > /etc/snmp/snmpd.conf

restart snmpd :

/etc/init.d/snmpd restart

last step to check snmpd is working ( change SECRET_NAME to the string you have chose before ) :

snmpwalk -v 1 -c SECRET_NAME -O e 127.0.0.1

you should get an output like below :

iso.3.6.1.2.1.1.1.0 = STRING: "Linux debian 2.6.32-5-686 #1 SMP Sun May 6 04:01:19 UTC 2012 i686"
iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.8072.3.2.10
iso.3.6.1.2.1.1.3.0 = Timeticks: (7026) 0:01:10.26
iso.3.6.1.2.1.1.4.0 = STRING: "root"
iso.3.6.1.2.1.1.5.0 = STRING: "debian"
iso.3.6.1.2.1.1.6.0 = STRING: "Unknown"
iso.3.6.1.2.1.1.8.0 = Timeticks: (0) 0:00:00.00
iso.3.6.1.2.1.1.9.1.2.1 = OID: iso.3.6.1.6.3.10.3.1.1
iso.3.6.1.2.1.1.9.1.2.2 = OID: iso.3.6.1.6.3.11.3.1.1
iso.3.6.1.2.1.1.9.1.2.3 = OID: iso.3.6.1.6.3.15.2.1.1
iso.3.6.1.2.1.1.9.1.2.4 = OID: iso.3.6.1.6.3.1
iso.3.6.1.2.1.1.9.1.2.5 = OID: iso.3.6.1.2.1.49
iso.3.6.1.2.1.1.9.1.2.6 = OID: iso.3.6.1.2.1.4
iso.3.6.1.2.1.1.9.1.2.7 = OID: iso.3.6.1.2.1.50
iso.3.6.1.2.1.1.9.1.2.8 = OID: iso.3.6.1.6.3.16.2.2.1
iso.3.6.1.2.1.1.9.1.3.1 = STRING: "The SNMP Management Architecture MIB."
iso.3.6.1.2.1.1.9.1.3.2 = STRING: "The MIB for Message Processing and Dispatching."
iso.3.6.1.2.1.1.9.1.3.3 = STRING: "The management information definitions for the SNMP User-based Security Model."
iso.3.6.1.2.1.1.9.1.3.4 = STRING: "The MIB module for SNMPv2 entities"
iso.3.6.1.2.1.1.9.1.3.5 = STRING: "The MIB module for managing TCP implementations"
iso.3.6.1.2.1.1.9.1.3.6 = STRING: "The MIB module for managing IP and ICMP implementations"
iso.3.6.1.2.1.1.9.1.3.7 = STRING: "The MIB module for managing UDP implementations"
iso.3.6.1.2.1.1.9.1.3.8 = STRING: "View-based Access Control Model for SNMP."

Powered by WordPress