Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

http://lordrich.com

« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS 

securing the /home directory

I'm still working on getting this one perfect.

chmod 701 /home/*
chmod 705 /home/*/public_html
chmod 604 /home/*/public_html/*.*

slashdot protection

Replace aaa.bbb.ccc.ddd with your own IP (so you always get to your site).
Replace www.yourdomain.com with your actual domain.

Just don’t mess with the user_agent and query_string lines. Those ensure that the Coral servers themselves can retrieve your page when they need to.

(Shamelessly stolen from http://ottodestruct.com/diggprotectionrules.txt)

RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^aaa.bbb.ccc.ddd$
RewriteCond %{HTTP_USER_AGENT} !^CoralWebPrx
RewriteCond %{QUERY_STRING} !(^|&)coral-no-serve$
RewriteCond %{HTTP_REFERER} ^http://(www\.)?digg\.com [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?slashdot\.org [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?slashdot\.com [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?fark\.com [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?somethingawful\.com [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?kuro5hin\.org [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?engadget\.com [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?boingboing\.net [OR]
RewriteCond %{HTTP_REFERER} ^http://(www\.)?del\.icio\.us
RewriteRule ^(.*)$ http://www.yourdomain.com.nyud.net:8080$1 [R,L]
« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS