Archives for: March 2010

03/30/10

Permalink 05:25:34 am, by admin Email , 57 words   English (US)
Categories: Linux, Networking

Block IP Address With IPTables

Need to block am IP address from your server? Here's an IPTables command:

/sbin/iptables -I INPUT -s w.x.y.z -j DROP

where w.x.y.z is the IP address to be blocked.

Here's a way to block and address with just the route command:

/sbin/route add -host w.x.y.z reject

03/23/10

Permalink 05:06:36 am, by admin Email , 42 words   English (US)
Categories: Apache

Disable ETags

Create a file at /etc/httpd/conf.d/no-etags.conf with the following:

Header unset ETag
FileETag None

Then of course restart Apache.

Here's a discussion on why you may want to turn ETags off:

http://www.askapache.com/htaccess/apache-speed-etags.html

03/19/10

Permalink 05:02:31 am, by admin Email , 111 words   English (US)
Categories: Apache

Canonical Rewrite Rules

Here's a good rule set for forcing use of a preferred url:

RewriteCond %{HTTP_HOST} !^desired\.domain\.name(:.*)?$  [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http://desired.domain.name/$1 [L,R=301] 

This version of the canonical rewrite expands on the original found here:

http://httpd.apache.org/docs/2.2/rewrite/rewrite_guide.html#canonicalhost

by adding:

  1. redirects domains with suffixes (not just prefixes) back to the canonical host; and
  2. allows Host request headers to contain port specifiers (which is allowed by RFC2616 section 14.24)

as suggested here:

http://colby.id.au/node/99

and by using a 301 redirect as recommended by Google here:

http://www.google.com/support/webmasters/bin/answer.py?answer=44231&hl=en

March 2010
Sun Mon Tue Wed Thu Fri Sat
 << < Current> >>
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

Reliable Penguin offers Linux Server Migrations, Systems Administration & Programming. Visit our main website at:

http://www.reliablepenguin.com

Search

Bookmark and Share

XML Feeds

powered by b2evolution free blog software