<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6587524289582183832</id><updated>2011-10-12T01:24:32.664+05:30</updated><category term='linux command line'/><category term='apache'/><category term='Netstat'/><category term='Usage'/><category term='centos'/><category term='qmailctl'/><category term='redundency'/><category term='ipzone'/><category term='VLAN'/><category term='countrywise blocking'/><category term='security'/><category term='qmail tips'/><category term='Grub'/><category term='openssh'/><category term='apachetop'/><category term='Disk'/><category term='CLF'/><category term='rhel'/><category term='CISCO2900XL'/><category term='Shell'/><category term='linux shell'/><category term='realtime monitoring'/><category term='failover'/><category term='multiple logfiles'/><category term='ServerFarm'/><category term='AWK'/><category term='Ruby'/><category term='multitail'/><category term='twitter'/><category term='search'/><category term='server'/><category term='Apache Logs'/><category term='Gem'/><category term='network'/><category term='mod_log_config'/><category term='yum update'/><category term='Disable USB'/><category term='qmail'/><category term='Prevention'/><category term='iptables'/><category term='notification'/><category term='DDOS'/><category term='Monitoring'/><category term='google'/><category term='Capistrano'/><category term='mod_status'/><title type='text'>My Experiences With Linux</title><subtitle type='html'>Open Your Eyes To A New World</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>42</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-8865193406028314909</id><published>2011-10-07T14:10:00.000+05:30</published><updated>2011-10-07T14:12:00.740+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='linux command line'/><title type='text'>Monitor your changed files in real-time in Linux</title><content type='html'>&lt;p style="font-family: arial;"&gt;Everybody knows &lt;i&gt;top&lt;/i&gt; or &lt;i&gt;htop&lt;/i&gt;. Ever wished there was something similar but to monitor your files instead of CPU usage and processes? Well, there is.&lt;br /&gt;Run this:&lt;/p&gt; &lt;p&gt;&lt;b&gt;watch -d -n 2 ‘df; ls -FlAt;’&lt;/b&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;and you’ll get to spy on which files are getting written on your  system. Every time a file gets modified it will get highlighted for a  second or so. The above command is useful when you grant someone SSH  access to your box and wish to know exactly what they’re modifying.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-8865193406028314909?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/8865193406028314909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=8865193406028314909' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/8865193406028314909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/8865193406028314909'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2011/10/monitor-your-changed-files-in-real-time.html' title='Monitor your changed files in real-time in Linux'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-791426129985490</id><published>2010-01-19T12:45:00.003+05:30</published><updated>2010-01-19T12:55:52.278+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Apache Logs'/><category scheme='http://www.blogger.com/atom/ns#' term='mod_log_config'/><category scheme='http://www.blogger.com/atom/ns#' term='CLF'/><title type='text'>Knowing Apache Logs</title><content type='html'>&lt;div style="text-align: justify;"&gt;LOG is the main friend of an Apache Administrator. We can see error_log , access_logs under LOG directory in Apache web server. It contain many things. Here I am briefly explaining what all the fields mean in a single line of Apache Log. CLF or Common Log Format is the core of logging in Apache. A module called mod_log_config is responsible for all these logging activities.&lt;br /&gt;&lt;br /&gt;The CLF log file contains a separate line for each request. A line is composed of several tokens separated by spaces:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="color: rgb(255, 102, 102);"&gt;host&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt; ident&lt;/span&gt;  &lt;span style="color: rgb(204, 0, 0);"&gt;authuser&lt;/span&gt;  &lt;span style="color: rgb(153, 0, 0);"&gt;date&lt;/span&gt;  &lt;span style="color: rgb(102, 0, 0);"&gt;request&lt;/span&gt;  &lt;span style="color: rgb(255, 153, 102);"&gt;status&lt;/span&gt;  &lt;span style="color: rgb(255, 153, 0);"&gt;bytes&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-weight: bold;"&gt;host&lt;/span&gt; : The fully qualified domain name of the client, or its IP address&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ident&lt;/span&gt; : If the IdentityCheck directive is enabled and the client machine runs&lt;br /&gt;identd, then this is the identity information reported by the client&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;authuser &lt;/span&gt; :If the requested URL required a successful Basic HTTP authentication,&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;then the user name is the value of this token.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;date&lt;/span&gt;  : The date and time of the request. The date field can be [day/month/year:hour:minute:second zone]&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;request&lt;/span&gt;  : The request line from the client, enclosed in double quotes (“).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;status&lt;/span&gt;  : The three-digit HTTP status code returned to the client.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;bytes&lt;/span&gt;&lt;/span&gt; : The number of bytes in the object returned to the client, excluding all&lt;br /&gt;HTTP headers.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-791426129985490?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/791426129985490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=791426129985490' title='14 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/791426129985490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/791426129985490'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2010/01/knowing-apache-logs.html' title='Knowing Apache Logs'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-989864066631087921</id><published>2010-01-03T15:38:00.006+05:30</published><updated>2010-01-03T15:45:55.247+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='multiple logfiles'/><category scheme='http://www.blogger.com/atom/ns#' term='multitail'/><title type='text'>Multitail - For viewing multiple logs simultaneoulsy</title><content type='html'>&lt;span&gt;&lt;br /&gt;Tail is a command in unix like systems for viewing log files. We can view only one log at a time , for viewing multiple log files we can use multitail.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1.Installation&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;yum install multitail (For Redhat , Centos )&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;apt-get install multitail (Ubuntu ,Debian )&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2.Usage&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;multitail -f /var/log/httpd/error_log /var/log/httpd/access_log&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3.Also you can run a command and watch its output&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;multitail -f /var/log/iptable.log "ping server.com"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4.You can see 3 files in 2 columns&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;code style="color: rgb(0, 153, 0);"&gt;multitail -s 2 /var/log/qmail_pop.log /var/log/qmail_send.log  /var/log/spamassassin.log &lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;Enjoy !!!&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-989864066631087921?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/989864066631087921/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=989864066631087921' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/989864066631087921'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/989864066631087921'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2010/01/multitail-for-viewing-multiple-logs.html' title='Multitail - For viewing multiple logs simultaneoulsy'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-7648658802932693610</id><published>2010-01-03T15:14:00.003+05:30</published><updated>2010-01-03T15:29:07.718+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='server'/><category scheme='http://www.blogger.com/atom/ns#' term='openssh'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>OpenSSH Security Tips</title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/OpenSSH"&gt;OpenSSH&lt;/a&gt; is tool used for connecting and managing remote linux machines. And this should be secured. I am here by telling some security tips to make the SSH server perfect.&lt;br /&gt;&lt;br /&gt;1.&lt;span style="font-weight: bold;"&gt;The following iptable rule will drop incoming connections which make more than 5 connection  attempts upon port 22 within 60 seconds&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent  --set&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent  --update --seconds 60 --hitcount 5 -j DROP&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2.Disable Empty Passwords&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Open the file /etc/sshd/sshd_config and&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;PermitEmptyPasswords no&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3.TCPWrappers&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;open --&gt; vi /etc/hosts.deny&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;sshd:ALL&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;then&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;open --&gt; vi /etc/hosts.allo&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);"&gt;sshd:192.168.1.32 192.168.1.21 (Change to your desired IP)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4.Change the SSH Port&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Idea behind this , suppose we change the port 22 to something other say Oracle 1521 , the attackers thinks that this is an Oracle server and will try oracle hacking tools :)&lt;br /&gt;&lt;br /&gt;&lt;pre class="ini"&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;Port 300&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5.Force Logout for Idle Sessions&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;ClientAliveInterval 300&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;ClientAliveCountMax 0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;And to be continued .......&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-7648658802932693610?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/7648658802932693610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=7648658802932693610' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/7648658802932693610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/7648658802932693610'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2010/01/openssh-security-tips.html' title='OpenSSH Security Tips'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-7064366411012142040</id><published>2009-08-17T17:36:00.003+05:30</published><updated>2009-08-17T17:39:03.774+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='search'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><category scheme='http://www.blogger.com/atom/ns#' term='linux command line'/><title type='text'>Search Google from Linux commandline</title><content type='html'>Nothing to say about google. You can search google for a result even from your linux command line.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 51, 204);"&gt;curl -A Mozilla http://www.google.com/search?q=&lt;/span&gt;&lt;i style="font-weight: bold; color: rgb(204, 51, 204);"&gt;Linux&lt;/i&gt;&lt;span style="font-weight: bold; color: rgb(204, 51, 204);"&gt; |html2text -width 80&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You need to install CURL and HTML2TEXT in your box.&lt;br /&gt;&lt;br /&gt;apt-get install curl html2text (Debian / Ubuntu)&lt;br /&gt;yum install curl html2text (Fedora / Centos / RHEL)&lt;br /&gt;&lt;br /&gt;Enjoy ....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-7064366411012142040?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/7064366411012142040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=7064366411012142040' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/7064366411012142040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/7064366411012142040'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2009/08/search-google-from-linux-commandline.html' title='Search Google from Linux commandline'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-1498074767140729424</id><published>2009-08-17T16:09:00.003+05:30</published><updated>2009-08-17T16:12:26.337+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux shell'/><category scheme='http://www.blogger.com/atom/ns#' term='twitter'/><title type='text'>Update Twitter from a Linux Shell</title><content type='html'>&lt;div style="text-align: justify;"&gt;Everybody knows now about TWITTER. It is a free social networking and micro-blogging service that enables its users to send and read messages known as tweets. Tweets are text-based posts of up to 140 characters displayed on the author's profile page and delivered to the author's subscribers who are known as followers. Senders can restrict delivery to those in their circle of friends or, by default, allow open access. Users can send and receive tweets via the Twitter website, Short Message Service (SMS) or external applications. While the service costs nothing to use, accessing it through SMS may incur phone service provider fees.&lt;br /&gt;There is a lot of APIs available to update twitter now like TwitterFox (Firefox Addon) TweetDeck. But now how can I update twitter from my Linux terminal ? Here follows the answer. This is simple using CURL.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 51, 204);"&gt;curl -u user:password -d status=”Your status message” http://twitter.com/statuses/update.xml&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Wher &lt;span style="color: rgb(204, 51, 204);"&gt;user&lt;/span&gt; is your twitter username and &lt;span style="color: rgb(204, 51, 204);"&gt;password&lt;/span&gt; is your twitter password .&lt;br /&gt;&lt;br /&gt;If curl is not installed  do the following&lt;br /&gt;&lt;br /&gt;apt-get install curl (Debian / Ubuntu)&lt;br /&gt;yum install curl (Fedora / RHEL / Centos)&lt;br /&gt;&lt;br /&gt;So keep in touch with twitter if you are in Datacentre .....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-1498074767140729424?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/1498074767140729424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=1498074767140729424' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/1498074767140729424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/1498074767140729424'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2009/08/update-twitter-from-linux-shell.html' title='Update Twitter from a Linux Shell'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-7054630046068369247</id><published>2009-06-18T14:36:00.003+05:30</published><updated>2009-06-18T14:43:59.038+05:30</updated><title type='text'>Apache Error - No space left on device: Couldn't create accept lock or Cannot create SSLMutex</title><content type='html'>&lt;div&gt;Some times you people may face this following error in your Apache Server. The error is as follows while trying to restart.after a configuration changes or something like that&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#CC0000;"&gt;[emerg] (28)No space left on device: Couldn't create accept lock&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#CC0000;"&gt;OR&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#CC0000;"&gt;[crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock Configuration Failed&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#CC0000;"&gt;OR &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#CC0000;"&gt;[Wed Dec 07 00:00:09 2005] [error] (28)No space left on device: Cannot create SSLMutex&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is happened due to someking of memory leaking. Normally people do the following to fix this.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;1.Checking the harddisk space usage&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;2.To explicetely different Lockfiles using the LockFile-directive&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;3.non-default AcceptMutex (flock) which then solved the acceptlock-issue and ended in the rewrite_log_lock-issue.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;4.Reboot&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The fourth option will only work,because this is due to the following reason&lt;/div&gt;&lt;div&gt;There were myriads of semaphore-arrays left, owned by my apache-user. Removing this semaphores immediately solved the problem&lt;/div&gt;&lt;div&gt;Do the following as ROOT&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#006600;"&gt;[root@apache.org] ipcs -s | grep apache | perl -e 'while (&lt;stdin&gt;) { @a=split(/\s+/); print `ipcrm sem $a[1]`}'  -- (If You Love Perl)&lt;/stdin&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#006600;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#006600;"&gt;[root@apache.org] ipcs -s | grep apache | awk ' { print $2 } ' | xargs ipcrm sem (If you Love Sh)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#006600;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#333333;"&gt;Have a great Day with Apache !!!&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-7054630046068369247?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/7054630046068369247/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=7054630046068369247' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/7054630046068369247'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/7054630046068369247'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2009/06/apache-error-no-space-left-on-device.html' title='Apache Error - No space left on device: Couldn&apos;t create accept lock or Cannot create SSLMutex'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-1040298077360775759</id><published>2009-05-23T13:31:00.005+05:30</published><updated>2009-05-23T13:36:37.418+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='realtime monitoring'/><category scheme='http://www.blogger.com/atom/ns#' term='apachetop'/><category scheme='http://www.blogger.com/atom/ns#' term='apache'/><title type='text'>Apache Real Time monitoring APACHETOP</title><content type='html'>Apache top is another tool for apache real time monitoring. This is just like the TOP command in *nix based systems. Here this can show a lot of informations from the Apache Web Server.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;[root@apache.org]mkdir -p /opt/src&lt;/span&gt;  &lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;[root@apache.org]cd /opt/src&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;[root@apache.org]wget http://www.webta.org/apachetop/apachetop-0.12.6.tar.gz&lt;/span&gt;  &lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;[root@apache.org]tar -zxf apachetop-0.12.6.tar.gz&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="color: rgb(204, 0, 0);"&gt;[root@apache.org]cd apachetop-0.12.6&lt;/span&gt;  &lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;[root@apache.org]./configure --with-logfile=/var/log/httpd/access_log&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;[root@apache.org]make&lt;/span&gt;  &lt;span style="color: rgb(204, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;[root@apache.org]make install&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;OK,Lets trigger it....&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);"&gt;[root@apache.org] apachetop&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Following Screenshot says it all. This was taken from my local test machine.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_3Lgl7ZQyPyk/ShetrUZNCoI/AAAAAAAAAIg/R_scC5mJ8eY/s1600-h/apachetop_general.jpg"&gt;&lt;img style="cursor: pointer; width: 200px; height: 66px;" src="http://4.bp.blogspot.com/_3Lgl7ZQyPyk/ShetrUZNCoI/AAAAAAAAAIg/R_scC5mJ8eY/s200/apachetop_general.jpg" alt="" id="BLOGGER_PHOTO_ID_5338926842991413890" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Try &lt;span style="color: rgb(0, 153, 0);"&gt;apachetop --help&lt;/span&gt; for more available switches&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-1040298077360775759?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/1040298077360775759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=1040298077360775759' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/1040298077360775759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/1040298077360775759'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2009/05/apache-real-time-monitoring-apachetop.html' title='Apache Real Time monitoring APACHETOP'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/ShetrUZNCoI/AAAAAAAAAIg/R_scC5mJ8eY/s72-c/apachetop_general.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-4949281546767917265</id><published>2009-05-23T13:07:00.005+05:30</published><updated>2009-05-23T13:39:08.973+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='mod_status'/><category scheme='http://www.blogger.com/atom/ns#' term='realtime monitoring'/><category scheme='http://www.blogger.com/atom/ns#' term='apache'/><title type='text'>Apache RealTime Monitoring MOD_STATUS</title><content type='html'>&lt;div style="text-align: justify;"&gt;There is number of tools available to monitor apache in realtime. Like Nagios,Cacti etc. But those tools are little difficult to configure for the first time (Experts Please excuse :-) ). Here I would like to introduce couple of simple tools which help the Webserver admin to monitor his Apache webserver in real time through Web and Console.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Mod_Status&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Status Module is a builtin module for apache for a default installation. First checkout whether this module is compiled with your Apache.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;[root@apache.org] cat /etc/httpd/conf/httpd.conf | grep status_module&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;LoadModule status_module modules/mod_status.so&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Make sure this line was not comment out. OK,Lets take the backup of your current configuration file&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;[root@apache.org]cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf_backup&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;[root@apache.org]vim /etc/httpd/conf/httpd.conf&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Goto Last Line and Paste the following&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;location&gt;&lt;/location&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;location&gt;&lt;/location&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;location&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;    SetHandler server-status&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;    Order Deny,Allow&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;    Allow from all&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;\Location &gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;    &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Search for the Line "&lt;span style="color: rgb(51, 0, 153);"&gt;ExtendedStatus&lt;/span&gt;". Normally this line is commented out. Uncomment it.&lt;br /&gt;&lt;br /&gt;Save and Exit&lt;br /&gt;&lt;br /&gt;Take your browser. &lt;span style="color: rgb(153, 51, 0);"&gt;http://your.domain.com/server-status&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Take a look at the values,Its Realtime values from the Apache. To view this page continuously,I mean refreshing automatically&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;http://your.domain.com/server-status?refresh=N&lt;/span&gt;&lt;br /&gt;(This N is any number).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-4949281546767917265?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/4949281546767917265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=4949281546767917265' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/4949281546767917265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/4949281546767917265'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2009/05/apache-realtime-monitoring.html' title='Apache RealTime Monitoring MOD_STATUS'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-536267610244091150</id><published>2009-05-18T13:42:00.005+05:30</published><updated>2009-05-18T14:01:29.357+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='notification'/><category scheme='http://www.blogger.com/atom/ns#' term='yum update'/><category scheme='http://www.blogger.com/atom/ns#' term='centos'/><category scheme='http://www.blogger.com/atom/ns#' term='rhel'/><title type='text'>Update notification through email RHEL / Centos</title><content type='html'>As everybody know,the system should be update. So an administrator should be vigilant on the new updates and patches from the vendor. But how do we know there is a patch available in the remote server. Here a way to get notified when an update is available.&lt;br /&gt;&lt;br /&gt;#vim /etc/yum/yum-updatesd.conf&lt;code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;pre class="ini"&gt;&lt;span style="color: rgb(0, 0, 102); font-weight: bold;"&gt;&lt;span style=""&gt;[&lt;/span&gt;main&lt;span style=""&gt;]&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;# how often to check for new updates &lt;span style=""&gt;(&lt;/span&gt;in seconds&lt;span style=""&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;run_interval &lt;/span&gt;=&lt;span style="color: rgb(102, 0, 102);"&gt; &lt;span style=""&gt;3600&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;# how often to allow checking on request &lt;span style=""&gt;(&lt;/span&gt;in seconds&lt;span style=""&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;updaterefresh &lt;/span&gt;=&lt;span style="color: rgb(102, 0, 102);"&gt; &lt;span style=""&gt;600&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;# how to send notifications &lt;span style=""&gt;(&lt;/span&gt;valid: dbus, email, syslog&lt;span style=""&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;emit_via &lt;/span&gt;=&lt;span style="color: rgb(102, 0, 102);"&gt; email&lt;/span&gt;&lt;br /&gt;# who to send the email&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;email_to &lt;/span&gt;=&lt;span style="color: rgb(102, 0, 102);"&gt; admin@adminguru.co.nr&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;# who send the notifications&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;email_from &lt;/span&gt;=&lt;span style="color: rgb(102, 0, 102);"&gt; updates@backup.server.com&lt;/span&gt;&lt;br /&gt;#&lt;br /&gt;# should we listen via dbus to give out update information/check for&lt;br /&gt;# new updates&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;dbus_listener &lt;/span&gt;=&lt;span style="color: rgb(102, 0, 102);"&gt; yes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;# automatically install updates&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;do_update &lt;/span&gt;=&lt;span style="color: rgb(102, 0, 102);"&gt; no&lt;/span&gt;&lt;br /&gt;# automatically download updates&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;do_download &lt;/span&gt;=&lt;span style="color: rgb(102, 0, 102);"&gt; no&lt;/span&gt;&lt;br /&gt;# automatically download deps of updates&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;do_download_deps &lt;/span&gt;=&lt;span style="color: rgb(102, 0, 102);"&gt; no&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Save and Exit&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Restart the Yum updater&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:arial;" &gt;#/etc/init.d/yum-updatesd restart&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;You will be notified when an update is available. Sample Email is as follows.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(51, 0, 153);font-family:arial;" &gt;Hi,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(51, 0, 153);font-family:arial;" &gt;This is the automatic update system on server.backup.com.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(51, 0, 153);font-family:arial;" &gt;There are 2 package updates available. Please run the system updater.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(51, 0, 153);font-family:arial;" &gt;Packages available for update:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(51, 0, 153);font-family:arial;" &gt;    kernel-2.6.18-92.el5&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(51, 0, 153);font-family:arial;" &gt;    kopete                       &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(51, 0, 153);font-family:arial;" &gt;Thank You,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(51, 0, 153);font-family:arial;" &gt;Your Computer&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-536267610244091150?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/536267610244091150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=536267610244091150' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/536267610244091150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/536267610244091150'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2009/05/update-notification-through-email-rhel.html' title='Update notification through email RHEL / Centos'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-5972981535521800455</id><published>2009-05-18T13:11:00.003+05:30</published><updated>2009-05-18T13:21:40.788+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='countrywise blocking'/><category scheme='http://www.blogger.com/atom/ns#' term='ipzone'/><category scheme='http://www.blogger.com/atom/ns#' term='iptables'/><title type='text'>Block Coutry wise traffic using Iptables.</title><content type='html'>&lt;div style="text-align: justify;"&gt;Some countries are blacklisted in ecommerce area due to spam flooding and DoS attacks. Its not difficult to find the root of an IP address. So the following script will block country based traffic in to your web server. The data will be updated in every day through a cronjob.&lt;br /&gt;You need to visit this &lt;a href="http://www.ipdeny.com/ipblocks/"&gt;SITE&lt;/a&gt; to download the zone file for which country you need to block.&lt;br /&gt;&lt;br /&gt;#mkdir -p /opt/scripts&lt;br /&gt;&lt;br /&gt;#vim /opt/scripts/ip_country_deny.sh&lt;br /&gt;&lt;br /&gt;Copy Paste the following&lt;br /&gt;&lt;br /&gt;&lt;pre class="bash"&gt;&lt;span style="color: rgb(128, 128, 128); font-style: italic;"&gt;#!/bin/bash&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 128, 128); font-style: italic;"&gt;### Block all traffic from AFGHANISTAN &lt;span style="color: rgb(122, 8, 116); font-weight: bold;"&gt;(&lt;/span&gt;af&lt;span style="color: rgb(122, 8, 116); font-weight: bold;"&gt;)&lt;/span&gt; and CHINA &lt;span style="color: rgb(122, 8, 116); font-weight: bold;"&gt;(&lt;/span&gt;CN&lt;span style="color: rgb(122, 8, 116); font-weight: bold;"&gt;)&lt;/span&gt;. Use ISO code ###&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;ISO=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"af cn"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 128, 128); font-style: italic;"&gt;### Set PATH ###&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;IPT=&lt;/span&gt;/sbin/iptables&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;WGET=&lt;/span&gt;/usr/bin/&lt;span style="color: rgb(194, 12, 185); font-weight: bold;"&gt;wget&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;EGREP=&lt;/span&gt;/bin/&lt;span style="color: rgb(194, 12, 185); font-weight: bold;"&gt;egrep&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 128, 128); font-style: italic;"&gt;### No editing below ###&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;SPAMLIST=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"countrydrop"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;ZONEROOT=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"/root/iptables"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;DLROOT=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"http://www.ipdeny.com/ipblocks/data/countries"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;cleanOldRules&lt;span style="color: rgb(122, 8, 116); font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(122, 8, 116); font-weight: bold;"&gt;)&lt;/span&gt;&lt;span style="color: rgb(122, 8, 116); font-weight: bold;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;$IPT&lt;/span&gt; -F&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;$IPT&lt;/span&gt; -X&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;$IPT&lt;/span&gt; -t nat -F&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;$IPT&lt;/span&gt; -t nat -X&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;$IPT&lt;/span&gt; -t mangle -F&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;$IPT&lt;/span&gt; -t mangle -X&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;$IPT&lt;/span&gt; -P INPUT ACCEPT&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;$IPT&lt;/span&gt; -P OUTPUT ACCEPT&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;$IPT&lt;/span&gt; -P FORWARD ACCEPT&lt;br /&gt;&lt;span style="color: rgb(122, 8, 116); font-weight: bold;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 128, 128); font-style: italic;"&gt;# create a dir&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(122, 8, 116); font-weight: bold;"&gt;[&lt;/span&gt; ! -d &lt;span style="color: rgb(0, 120, 0);"&gt;$ZONEROOT&lt;/span&gt; &lt;span style="color: rgb(122, 8, 116); font-weight: bold;"&gt;]&lt;/span&gt; &amp;amp;&amp;amp; /bin/&lt;span style="color: rgb(194, 12, 185); font-weight: bold;"&gt;mkdir&lt;/span&gt; -p &lt;span style="color: rgb(0, 120, 0);"&gt;$ZONEROOT&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 128, 128); font-style: italic;"&gt;# clean old rules&lt;/span&gt;&lt;br /&gt;cleanOldRules&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 128, 128); font-style: italic;"&gt;# create a new iptables list&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;$IPT&lt;/span&gt; -N &lt;span style="color: rgb(0, 120, 0);"&gt;$SPAMLIST&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-weight: bold;"&gt;for&lt;/span&gt; c  &lt;span style="color: rgb(0, 0, 0); font-weight: bold;"&gt;in&lt;/span&gt; &lt;span style="color: rgb(0, 120, 0);"&gt;$ISO&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-weight: bold;"&gt;do&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 128, 128); font-style: italic;"&gt;# &lt;span style="color: rgb(122, 8, 116); font-weight: bold;"&gt;local&lt;/span&gt; zone file&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;tDB=&lt;/span&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;$ZONEROOT&lt;/span&gt;/&lt;span style="color: rgb(0, 120, 0);"&gt;$c&lt;/span&gt;.zone&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 128, 128); font-style: italic;"&gt;# get fresh zone file&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;$WGET&lt;/span&gt; -O &lt;span style="color: rgb(0, 120, 0);"&gt;$tDB&lt;/span&gt; &lt;span style="color: rgb(0, 120, 0);"&gt;$DLROOT&lt;/span&gt;/&lt;span style="color: rgb(0, 120, 0);"&gt;$c&lt;/span&gt;.zone&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 128, 128); font-style: italic;"&gt;# country specific log message&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;SPAMDROPMSG=&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"$c Country Drop"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 128, 128); font-style: italic;"&gt;# get&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;BADIPS=&lt;/span&gt;$&lt;span style="color: rgb(122, 8, 116); font-weight: bold;"&gt;(&lt;/span&gt;&lt;span style="color: rgb(194, 12, 185); font-weight: bold;"&gt;egrep&lt;/span&gt; -v &lt;span style="color: rgb(255, 0, 0);"&gt;"^#|^$"&lt;/span&gt; &lt;span style="color: rgb(0, 120, 0);"&gt;$tDB&lt;/span&gt;&lt;span style="color: rgb(122, 8, 116); font-weight: bold;"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-weight: bold;"&gt;for&lt;/span&gt; ipblock &lt;span style="color: rgb(0, 0, 0); font-weight: bold;"&gt;in&lt;/span&gt; &lt;span style="color: rgb(0, 120, 0);"&gt;$BADIPS&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-weight: bold;"&gt;do&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 120, 0);"&gt;$IPT&lt;/span&gt; -A &lt;span style="color: rgb(0, 120, 0);"&gt;$SPAMLIST&lt;/span&gt; -s &lt;span style="color: rgb(0, 120, 0);"&gt;$ipblock&lt;/span&gt; -j LOG --log-prefix &lt;span style="color: rgb(255, 0, 0);"&gt;"$SPAMDROPMSG"&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: rgb(0, 120, 0);"&gt;$IPT&lt;/span&gt; -A &lt;span style="color: rgb(0, 120, 0);"&gt;$SPAMLIST&lt;/span&gt; -s &lt;span style="color: rgb(0, 120, 0);"&gt;$ipblock&lt;/span&gt; -j DROP&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-weight: bold;"&gt;done&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0); font-weight: bold;"&gt;done&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 128, 128); font-style: italic;"&gt;# Drop everything&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;$IPT&lt;/span&gt; -I INPUT -j &lt;span style="color: rgb(0, 120, 0);"&gt;$SPAMLIST&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;$IPT&lt;/span&gt; -I OUTPUT -j &lt;span style="color: rgb(0, 120, 0);"&gt;$SPAMLIST&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 120, 0);"&gt;$IPT&lt;/span&gt; -I FORWARD -j &lt;span style="color: rgb(0, 120, 0);"&gt;$SPAMLIST&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 128, 128); font-style: italic;"&gt;# call your other iptable script&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(128, 128, 128); font-style: italic;"&gt;# /path/to/other/iptables.sh&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(122, 8, 116); font-weight: bold;"&gt;exit&lt;/span&gt; &lt;span style="color: rgb(0, 0, 0);"&gt;0&lt;br /&gt;#Script Ends Here....&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;Save and Exit&lt;br /&gt;&lt;br /&gt;Setup a crontab for working in every day&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0); font-weight: bold;"&gt;#vim /etc/crontab&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Add the following at the end of the file&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0); font-weight: bold;"&gt;03 03 * * * root /opt/scripts/ip_country_deny.sh&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To start the script immediately&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0); font-weight: bold;"&gt;#/opt/scripts/ip_country_deny.sh&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0); font-weight: bold;"&gt;#iptable -L -n -v&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Check out the wonderful output....&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-5972981535521800455?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/5972981535521800455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=5972981535521800455' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/5972981535521800455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/5972981535521800455'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2009/05/block-coutry-wise-traffic-using.html' title='Block Coutry wise traffic using Iptables.'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-5689808403811977728</id><published>2009-05-18T12:50:00.000+05:30</published><updated>2009-05-18T12:52:00.607+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Disable USB'/><category scheme='http://www.blogger.com/atom/ns#' term='Grub'/><title type='text'>Disable USB in Grub</title><content type='html'>&lt;div style="text-align: justify;"&gt;Now a days USB storage devices are common in the industry. This is very halmful in any unsecured network. Because this devices are considered to be the virus spreading agents. In corporates USB media is prevented because of above said reasons. So here a small tip to prevent USB storage in Linux machines through GRUB.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;Scenario&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;OS : Debian / Ubuntu&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Open the Grub configuration file&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);"&gt;#vi /boot/grub/menu.lst&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Add "nousb" at the end of the Kernel Line. Like the following&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;kernel /vmlinuz-2.6.18-128.1.1.el5 ro root=LABEL=/ console=tty0 console=ttyS1,19200n8 nousb&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;Secure GRUB with a strong Password !!!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;#/sbin/shutdown -r now&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So nobody can use USB storage unless you allowed to do so.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-5689808403811977728?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/5689808403811977728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=5689808403811977728' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/5689808403811977728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/5689808403811977728'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2009/05/disable-usb-in-grub.html' title='Disable USB in Grub'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-7653553576762768000</id><published>2009-05-17T13:49:00.001+05:30</published><updated>2009-05-18T12:53:31.344+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='VLAN'/><category scheme='http://www.blogger.com/atom/ns#' term='CISCO2900XL'/><title type='text'>Adding a VLAN in CISCO 2900</title><content type='html'>Creating a Virtual Lan is an advanced job in the case of networking. This needs experience in networking,Switching etc. But here i am stating how to add a new VLAN in the CISCO 2900 XL.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;Assumptions&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;1.You have a basic knowledge in networking&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;2.You have the administrator access to switch&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;3.You should be aware on what you are doing !!!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;CISCO2900&gt;switchport mod access&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;CISCO2900&gt;switchport mod access vlan5&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;CISCO2900&gt;conf t&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;CISCO2900&gt;int Fast 0/31&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;CISCO2900&gt;description To Marketing LAN&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;CISCO2900&gt;write&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;DONE.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-7653553576762768000?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/7653553576762768000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=7653553576762768000' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/7653553576762768000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/7653553576762768000'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2009/05/adding-vlan-in-cisco-2900-xl.html' title='Adding a VLAN in CISCO 2900'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-1477952919556808726</id><published>2009-05-16T13:24:00.006+05:30</published><updated>2009-05-16T18:37:16.450+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='qmailctl'/><category scheme='http://www.blogger.com/atom/ns#' term='qmail tips'/><category scheme='http://www.blogger.com/atom/ns#' term='qmail'/><title type='text'>Qmail Tips &amp; Tricks.</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Qmail"&gt;qmail&lt;/a&gt; is a mail transfer agent that runs on Unix. It was written, starting December 1995, by &lt;a href="http://en.wikipedia.org/wiki/Daniel_J._Bernstein"&gt;Daniel J. Bernstein&lt;/a&gt; as a more secure replacement for the popular Sendmail program. qmail's source code is released to the public domain, making qmail free software. Most Popular email services like Yahoo,Gmail are using qmail for their mail traffic. Here I am pasting some qmail tips,which helped me to override when I was blackout with my Qmail Box.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;qmailctl &lt;/span&gt;-  This command will show you a lot of information about your qmail server.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;[root@mail.admin.org] qmailctl stat &lt;/span&gt;&lt;br /&gt;/service/qmail-send: up (pid 3030) 30 seconds&lt;br /&gt;/service/qmail-send/log: up (pid 3025) 30 seconds&lt;br /&gt;/service/qmail-smtpd: up (pid 3028) 30 seconds&lt;br /&gt;/service/qmail-smtpd/log: up (pid 3029) 30 seconds&lt;br /&gt;/service/qmail-pop3d: up (pid 3026) 30 seconds&lt;br /&gt;/service/qmail-pop3d/log: up (pid 3027) 30 seconds&lt;br /&gt;messages in queue: 0&lt;br /&gt;messages in queue but not yet preprocessed: 0&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;The above output means your Qmail server is Ready to deliver / receive messages. The seconds figure should be same,for a clean server.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;[root@mail.admin.org]qmailctl queue&lt;/span&gt;&lt;br /&gt;messages in queue: 0&lt;br /&gt;messages in queue but not yet preprocessed: 0&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;This will shows the list of mails which were not delivered in the server.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;[root@mail.admin.org]qmailctl queue | wc -l&lt;/span&gt;&lt;br /&gt;Which will give the number of mails in the queue.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;[root@mail.admin.org]qmailctl start&lt;/span&gt;&lt;br /&gt;Starts mail service (smtp connection accepted, mail can go out)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;[root@mail.admin.org]qmailctl stop&lt;/span&gt;&lt;br /&gt;Stops mail service (smtp connections refused, nothing goes out).&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;[root@mail.admin.org]qmailctl pause&lt;/span&gt;&lt;br /&gt;Temporarily stops mail service (connections accepted, nothing leaves).&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;To block a sender or entire domain to your Qmail Box. Because some times you need to block a user or entire domain from outside world to reach to your qmail&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;[root@mail.admin.org] vi  /var/qmail/control/badmailfrom&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Inside the " badmailfrom " file, the syntax might look something like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);"&gt;spam@spammerhell.org&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);"&gt;@spammerhell.org&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;What do the above lines do?&lt;br /&gt;&lt;br /&gt;The entry for "spam@spammerhell.org" would block all mail coming from "spam@spammerhell.org".&lt;br /&gt;&lt;br /&gt;The entry for "@spammerhell.org" would block any and all mail coming from the domain "@spammerhell.org".&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(204, 51, 204);"&gt;To be Continued.... &lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(204, 51, 204);"&gt;Because Qmail Administration is an Ocean,I am just seeing it from the Shore. ..&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-1477952919556808726?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/1477952919556808726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=1477952919556808726' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/1477952919556808726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/1477952919556808726'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2009/05/qmail-tips-tricks.html' title='Qmail Tips &amp; Tricks.'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-5351072782476125604</id><published>2009-05-11T18:18:00.008+05:30</published><updated>2009-05-11T18:30:31.176+05:30</updated><title type='text'>Beautifying Nagios</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Nagios"&gt;Nagios&lt;/a&gt;  is a popular open source computer system and network monitoring software application. It watches hosts and services, alerting users when things go wrong and again when they get better. Nagios, originally created under the name NetSaint, was written and is currently maintained by Ethan Galstad, along with a group of developers actively maintaining both official and unofficial plugins. Nagios was originally designed to run under Linux, but also runs well on other Unix variants. There is lot of plugins available in nagios for various purposes. But so far nothing found to beautify nagios from traditional look. Now there is a beautiful theme available&lt;br /&gt;&lt;/div&gt;to beautify the nagios. This will give you a new look for your monitoring master.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;span style="color: rgb(102, 51, 255);"&gt;Assumptions.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 255);"&gt;You have installed and setup Nagios for your network.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 255);"&gt;You are the Nagios Administrator.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;[nagios@server]# wget http://tomas.cat/blog/sites/default/files/nagios-nuvola-1.0.3.tar_.gz&lt;/span&gt; &lt;span style="color: rgb(153, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;[nagios@server]# tar zxvf nagios-nuvola-1.0.3.tar_.gz&lt;/span&gt; &lt;span style="color: rgb(153, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;[nagios@server]# cp -a nuvola/html/* /usr/share/nagios3/htdocs/&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;&lt;br /&gt;[nagios@server]# cp -a nuvola/html/stylesheets/* /etc/nagios3/stylesheets/.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Reload Nagios&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;[nagios@server]#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;[nagios@server]# /etc/init.d/nagios reload&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Check out......How beautiful ........&lt;br /&gt;&lt;br /&gt;ScreenShots of my Nagios server after Makeup&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_3Lgl7ZQyPyk/SggfdeaeddI/AAAAAAAAAIM/5vzY-IecAHU/s1600-h/nagios_nuvola.jpg"&gt;&lt;img style="cursor: pointer; width: 200px; height: 101px;" src="http://2.bp.blogspot.com/_3Lgl7ZQyPyk/SggfdeaeddI/AAAAAAAAAIM/5vzY-IecAHU/s200/nagios_nuvola.jpg" alt="" id="BLOGGER_PHOTO_ID_5334548349861131730" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_3Lgl7ZQyPyk/Sggfkt9PvLI/AAAAAAAAAIU/IKMgUpQQUTc/s1600-h/nagios_host_nuvola.jpg"&gt;&lt;img style="cursor: pointer; width: 200px; height: 101px;" src="http://4.bp.blogspot.com/_3Lgl7ZQyPyk/Sggfkt9PvLI/AAAAAAAAAIU/IKMgUpQQUTc/s200/nagios_host_nuvola.jpg" alt="" id="BLOGGER_PHOTO_ID_5334548474292583602" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-5351072782476125604?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/5351072782476125604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=5351072782476125604' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/5351072782476125604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/5351072782476125604'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2009/05/beautifying-nagios.html' title='Beautifying Nagios'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_3Lgl7ZQyPyk/SggfdeaeddI/AAAAAAAAAIM/5vzY-IecAHU/s72-c/nagios_nuvola.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-5728720867104775236</id><published>2009-04-16T13:08:00.002+05:30</published><updated>2009-04-16T13:33:59.519+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='DDOS'/><category scheme='http://www.blogger.com/atom/ns#' term='AWK'/><category scheme='http://www.blogger.com/atom/ns#' term='Prevention'/><category scheme='http://www.blogger.com/atom/ns#' term='Netstat'/><title type='text'>How to Find Server is Under DDOS</title><content type='html'>&lt;div style="text-align: justify;"&gt;A denial-of-service attack (DoS attack) or distributed denial-of-service attack (DDoS attack) is an attempt to make a computer resource unavailable to its intended users. Although the means to carry out, motives for, and targets of a DoS attack may vary, it generally consists of the concerted efforts of a person or persons to prevent an Internet site or service from functioning efficiently or at all, temporarily or indefinitely. Perpetrators of DoS attacks typically target sites or services hosted on high-profile web servers such as banks, credit card payment gateways, and even root nameservers.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;netstat -anp | grep "tcp\|udp" | awk {'print $5'} | cut -d: -f1 | uniq -c | sort -n&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So what will be the output ?&lt;br /&gt;&lt;br /&gt;   &lt;span style="color: rgb(51, 51, 255);"&gt; 1 0.0.0.0&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      1 208.80.152.2&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      1 208.80.152.2&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      1 208.80.152.3&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      1 209.85.135.103&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      1 209.85.135.113&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      1 74.125.43.113&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      2 208.80.152.2&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      2 208.80.152.3&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      2 208.80.152.3&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      3 0.0.0.0&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      3 208.80.152.2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Left column indicates the number of connection,from the IP address which shown in right column. This was taken from my local test machine. If you are under an attack,this number may vary. The number will be any number.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-5728720867104775236?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/5728720867104775236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=5728720867104775236' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/5728720867104775236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/5728720867104775236'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2009/04/how-to-find-server-is-under-ddos.html' title='How to Find Server is Under DDOS'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-7365945114919914672</id><published>2009-04-14T14:14:00.006+05:30</published><updated>2009-04-14T14:27:35.100+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='Capistrano'/><category scheme='http://www.blogger.com/atom/ns#' term='Gem'/><category scheme='http://www.blogger.com/atom/ns#' term='ServerFarm'/><title type='text'>Manage your Server Farm with CapistranO</title><content type='html'>&lt;div style="text-align: justify;"&gt;Capistrano is an open source tool for running scripts on multiple servers; its main use is deploying web applications. It automates the process of making a new version of an application available on one or more web servers, including supporting tasks such as changing databases. Capistrano is written in the Ruby language and is distributed using the RubyGems distribution channel. It is an outgrowth of the Ruby on Rails web application framework, but has also been used to deploy web applications written using other frameworks, including ones written in PHP. The usage on the bash command line is easy to learn. When used with the Ruby on Rails Framework many default Capistrano recipes can be used, e.g. to deploy current changes to the web application or roll back to the previous deployment state.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Installation&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;#apt-get install ruby1.8 ruby1.8-dev rubygems1.8 libruby-extras libruby1.8-extras&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt; (Ubuntu / Debian)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;#yum install ruby1.8 ruby1.8-dev rubygems1.8 libruby-extras libruby1.8-extras &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;(Centos / Redhat)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Check the Ruby Details&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;#ruby -v&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;ruby 1.8.7 &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;OK,Lets move to install Capistrano Boy&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;#gem install -y capistrano echoe&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Capistrano makes a few assumptions about your servers. In order to use Capistrano, you will need to comply with these assumptions:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;You are using SSH to access your remote machines. Telnet and FTP are not supported.&lt;/li&gt;&lt;li&gt;Your remote servers have a POSIX-compatible shell installed. The shell must be called “sh”  and must reside in the default system path.&lt;/li&gt;&lt;li&gt;If you are using passwords to access your servers, they must all have the same password. Because this is not generally a good idea, the preferred way of accessing your &lt;/li&gt;&lt;li&gt;servers is with a public key. Make sure you’ve got a good passphrase on your key.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;We are going to trigger some examples here. So my remote servers are 192.168.1.12  and 192.168.1.13 (You can Add any number here).&lt;br /&gt;&lt;br /&gt;In the following example we are going to check the uptime of above servers.&lt;br /&gt;&lt;br /&gt;Copy paste the following code into a text editor (Vim,Emacs).&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;task :health, :hosts =&gt; "192.168.1.12" , "192.168.1.13" do&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;run "uptime"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;end&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Save the file with name "capfile" without any extension.&lt;br /&gt;&lt;br /&gt;Wakeup the code&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;#cap health&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I found that some times while you apply this command shell returned an error "Command not found",then do the following&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;#vi ~/.bashrc&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Copy paste the following at the end of the File&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;export PATH=$PATH:/var/lib/gems/1.8/bin&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then rebuild the bashrc&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;# source ~/.bashrc&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Then Re-run the command,If you are against a password access server,it will ask for the password,enter it,other wise the result will be like following&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(51, 51, 255);font-family:arial;" &gt;[192.168.1.12] executing command&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:arial;" &gt;[192.168.1.13] executing command&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:arial;" &gt; ** [out :: 192.168.1.12] 11:30:55 up 27 days, 22:40,  0 users,  load average: 0.01, 0.01, 0.00&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:arial;" &gt; ** [out :: 192.168.1.12] 11:30:55 up 37 days, 08:40,  0 users,  load average: 0.05, 0.01, 0.08&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:arial;" &gt; command finished&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0); font-style: italic;"&gt;We Can Do any command by the above said method,I hope you will be happy if you have a critical update on all of your 100 servers ...&lt;br /&gt;Is int it ?&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-7365945114919914672?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/7365945114919914672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=7365945114919914672' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/7365945114919914672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/7365945114919914672'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2009/04/manage-your-server-farm-with-capistrano.html' title='Manage your Server Farm with CapistranO'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-3405419525542528543</id><published>2009-04-12T13:43:00.004+05:30</published><updated>2009-04-14T14:28:29.833+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Monitoring'/><category scheme='http://www.blogger.com/atom/ns#' term='Disk'/><category scheme='http://www.blogger.com/atom/ns#' term='Usage'/><category scheme='http://www.blogger.com/atom/ns#' term='Shell'/><title type='text'>Monitoring Disk Usage In Linux</title><content type='html'>One of the routine job of a Linux administrator to monitor the Disk space continuously.  Normal people will write a simple script to check the disk space and report to system administrator through email. Good Idea,but here i am telling a new one which will continuously monitor your Disk and report if it cross a preset value. This will run as a cronjob.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;#!/bin/bash&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;#Script for monitoring Disk Usage&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;#Author BipinDas,Arab Open University.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;ADMIN="yourname@yourdomain.com"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;# set alert level 80% is default&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;ALERT=80&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;do&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;  #echo $output&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;  usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1  )&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;  partition=$(echo $output | awk '{ print $2 }' )&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;  if [ $usep -ge $ALERT ]; then&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;    echo "Running out of space \"$partition ($usep%)\" on $(hostname) $(hostname -i) as on $(date)" |&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;     mail -s "Alert: Almost out of disk space $usep " $ADMIN&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;  fi&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;done&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Save it as disk_monitor.sh in your scripts folder.&lt;br /&gt;&lt;br /&gt;Open Crontab Editor&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 0);"&gt;vi /etc/crontab&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 0);"&gt;*/5 * * * * root  /path/to/script/disk_monitor.sh&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Perfect,This will frequently check your Disk and inform once it cross the limit.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-3405419525542528543?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/3405419525542528543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=3405419525542528543' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/3405419525542528543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/3405419525542528543'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2009/04/monitoring-disk-usage-in-linux.html' title='Monitoring Disk Usage In Linux'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-5547893003388438361</id><published>2008-12-24T12:37:00.004+05:30</published><updated>2009-04-14T14:28:56.070+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='failover'/><category scheme='http://www.blogger.com/atom/ns#' term='network'/><category scheme='http://www.blogger.com/atom/ns#' term='redundency'/><title type='text'>Network Failover</title><content type='html'>&lt;div style="text-align: justify;"&gt;&lt;a style="font-weight: bold; color: rgb(153, 0, 0);" href="http://en.wikipedia.org/wiki/Failover"&gt;Failover&lt;/a&gt; is the process of switching to a backup component, element, or operation while recovery from a disruption is undertaken. Failover procedures determine the continuity of a network operation. Failover mechanisms can be devised so that they take place immediately or shortly after a disruption occurs. Many systems use automatic failover and data replication for instant recovery. Preemptive failover can also be used if an imminent disruption is detected.Failover requires the availability of a backup system to eventually take overservice. The type of failover model required dictates the backup state of readiness(Figure 2.2). There are three basic types of failover model. Each has implications onthe amount of information that must be available to the backup system at the time of failover:&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);"&gt;• Hot or immediate failover&lt;/span&gt; requires a running duplicate of the production system as a backup to provide immediate recovery. Consequently, it is the more complex end expensive to implement. The backup system, referred to as a hot standby, must constantly be updated with current state information about the activity of the primary system, so that it is ready to take over operation quickly when needed. This is why this type of failover is sometimes referred to as a&lt;br /&gt;stateful failover. Applications residing on the backup system must be designed to use this state information when activated. For these reasons, hot standby systems are often identical to the primary system. They are sometimes designed to load share with the primary system,  processing a portion of the live traffic.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: rgb(153, 0, 0); font-weight: bold;"&gt;• Cold failover,&lt;/span&gt; on the other hand, is the least complex to implement but likely results in some disruption until the backup is able to initiate service. A cold standby backup element will maintain no information about the state of the primary system and must begin processing as if it were a new system. The backup must be initialized upon failover, consuming additional time. For these reasons, a cold failover model is usually the least expensive to implement.&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="color: rgb(153, 0, 0); font-weight: bold;"&gt;• Warm failover&lt;/span&gt; uses a backup system that is not provided with state information on the primary system until a failover takes place. Although the backup may already be initialized, configuration of the backup with the information may be required, adding time to the failover process. In some variants of this model, the standby can perform other types of tasks until it is required to take over the primary system’s responsibilities. This model is less expensive than&lt;br /&gt;the hot standby model because it reduces standby costs  and may not necessarily require a backup system identical to the primary system&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-5547893003388438361?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/5547893003388438361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=5547893003388438361' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/5547893003388438361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/5547893003388438361'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2008/12/network-failover.html' title='Network Failover'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-3690810500008887913</id><published>2008-12-03T11:27:00.005+05:30</published><updated>2008-12-03T11:35:11.276+05:30</updated><title type='text'>Checking Load of server in Frequent intervals</title><content type='html'>One of the major problem in linux server is rising of load to high. This can be happened due to various reason. This script will check the load of machine in frequent intervals and inform the administrator through email. This will also send the current server status.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;#mkdir -p /opt/scripts&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;#cd /opt/scripts&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;#touch server_load.sh&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;#chmod 755 server_load.sh&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Copy paste the following into the server_load.sh&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;#!/bin/bash&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;EMAIL="yourname@yourdomain.com"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;SUBJECT="Alert $(hostname) load average is $L05"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;TEMPFILE="/tmp/$(hostname)"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;echo "Load average Crossed allowed limit." &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;echo "Hostname: $(hostname)" &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;echo "Local Date &amp;amp; Time : $(date)" &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;echo "| Uptime status: |" &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;echo "-----------------------------------------------------" &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;/usr/bin/uptime &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;echo "-----------------------------------------------------" &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;echo "| Top 20 CPU consuming processes: |" &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;ps aux | head -1 &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;ps aux --no-headers | sort -rn  | head -20 &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;echo "| Top 10 memory-consuming processes: |" &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;ps aux --no-headers| sort -rn  | head &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;echo "----------------------------------------------------" &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;echo "| Memory and Swap status: |" &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;/usr/bin/free -m &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;echo "----------------------------------------------------" &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;echo "| Active network connection: |" &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;echo "----------------------------------------------------" &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;/bin/netstat -tnup | grep ESTA &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;echo "----------------------------------------------------" &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;echo "| Disk Space information: |" &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;echo "----------------------------------------------------" &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;/bin/df -h &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;echo "-----------------THE END----------------------------" &gt;&gt; $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;#Store the Current Load into a variable&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;L05="$(uptime|awk '{print $(NF-2)}'|cut -d. -f1)"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;#Checking whether it goes beyond the limit&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;if test $L05 -gt 0&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;then&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;mail -s "$SUBJECT $L05" "$EMAIL" &lt; $TEMPFILE fi  &lt;/span&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;#Remove the Temporary file.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;rm -f $TEMPFILE&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;Create CronJob for this&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;#vi /etc/crontab&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;#The following script will run in every minute.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;*/1 * * * * root /opt/scripts/server_load.sh&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-3690810500008887913?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/3690810500008887913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=3690810500008887913' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/3690810500008887913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/3690810500008887913'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2008/12/checking-load-of-server-in-frequent.html' title='Checking Load of server in Frequent intervals'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-1386290601473716327</id><published>2008-12-01T16:08:00.000+05:30</published><updated>2008-12-01T16:09:11.865+05:30</updated><title type='text'>Block Bad Bots using htaccess</title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/Internet_bot"&gt;Bots&lt;/a&gt; are software applications that run automated tasks over the Internet. But there is some bad bots which will run on your web root and pass your information to outside public. This  should be prevented. In this article I am stating how to search for a bad bot and prevent it.&lt;br /&gt;&lt;br /&gt;Enable the htaccess as described in the previous post&lt;br /&gt;&lt;br /&gt;Open the htaccess&lt;br /&gt;&lt;br /&gt;vi .htaccess&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0); font-style: italic;"&gt;RewriteEngine on&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0); font-style: italic;"&gt;   RewriteCond %{HTTP_USER_AGENT} ^BadBot [OR]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0); font-style: italic;"&gt;   RewriteCond %{HTTP_USER_AGENT} ^EvilScraper [OR]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0); font-style: italic;"&gt;   RewriteCond %{HTTP_USER_AGENT} ^FakeUser&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0); font-style: italic;"&gt;   RewriteRule ^(.*)$ http://go.away/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Save and exit&lt;br /&gt;So, what does this code do? It's simple: the above lines tell your webserver to check for any bot whose user-agent string starts with "BadBot". When it sees a bot that matches, it redirects them to a non-existent site called "go.away". And&lt;br /&gt;also it will check for 3 types of bots and if found one among them the control will be directed to some site.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-1386290601473716327?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/1386290601473716327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=1386290601473716327' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/1386290601473716327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/1386290601473716327'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2008/12/block-bad-bots-using-htaccess.html' title='Block Bad Bots using htaccess'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-1136837206950490063</id><published>2008-12-01T15:34:00.002+05:30</published><updated>2008-12-01T15:42:06.328+05:30</updated><title type='text'>Prevent access from an IP address using .htaccess</title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/Htaccess"&gt;htaccess&lt;/a&gt; is a powerful tool is used to manipulated the webroot and apache configurations as well. The Rewrite rules can be written in .htaccess file. .htaccess file normally located in the webroot.&lt;br /&gt;&lt;br /&gt;#Open the &lt;a href="http://en.wikipedia.org/wiki/Apache_HTTP_Server"&gt;Apache&lt;/a&gt; configuration file.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;vi /etc/httpd/conf/httpd.conf (Redhat Based,Centos Distros)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;vi /etc/apache2/apache2.conf (Debian Based,Ubuntu Distros)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;# Uncomment the Following Line&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 102);"&gt;LoadModule rewrite_module modules/mod_rewrite.so&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;we need to change the AllowOverride directive also from&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;&lt;directory&gt;&lt;/directory&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;Options FollowSymLinks&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;AllowOverride None&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;Order deny,allow&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;Deny from all&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;Satisfy all&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;to&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;&lt;directory&gt;&lt;/directory&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;Options FollowSymLinks&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;AllowOverride All&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;Order deny,allow&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;Deny from all&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;Satisfy all&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Perfect !!! You have enabled the .htaccess support in your apache webserver.&lt;br /&gt;&lt;br /&gt;Now go to your webroot. Normally its /var/www/html/domain.com. Create an htaccess file&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;touch .htaccess&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;vi .htaccess&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Copy paste the following in to .htaccess file&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 255); font-style: italic;"&gt;order allow,deny&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 255); font-style: italic;"&gt;deny from 123.45.6.7&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 255); font-style: italic;"&gt;deny from 012.34.5.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 255); font-style: italic;"&gt;allow from all&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Save And Exit&lt;br /&gt;&lt;br /&gt;Viola !!! You have blocked the above IPs from watching your site. Same like you can restrict an IP range also. Do the following if you would like to block a range&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0); font-style: italic;"&gt;order allow,deny&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0); font-style: italic;"&gt;deny from 123.45.6&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0); font-style: italic;"&gt;deny from 012.34.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0); font-style: italic;"&gt;allow from all&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can block an ISP through the above method. Changes will look like following&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 153, 255); font-style: italic;"&gt;order allow,deny&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 153, 255); font-style: italic;"&gt;deny from some-evil-isp.com&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 153, 255); font-style: italic;"&gt;deny from subdomain.another-evil-isp.com&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 153, 255); font-style: italic;"&gt;allow from all&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The above will all traffic from the specified Internet Service Providers IPs&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-1136837206950490063?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/1136837206950490063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=1136837206950490063' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/1136837206950490063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/1136837206950490063'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2008/12/prevent-access-from-ip-address-using.html' title='Prevent access from an IP address using .htaccess'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-5681801509518763234</id><published>2008-10-23T13:36:00.002+05:30</published><updated>2008-10-23T13:39:35.366+05:30</updated><title type='text'>How your Linux Boots ?</title><content type='html'>This is the Normal boot process of a Linux Operating System in to your computer. Boot process takes place in 4 scenes with 4 main characters.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);"&gt;Scene 1&lt;/span&gt;&lt;br /&gt;when the computer is switched on,it automatically invokes &lt;a href="http://en.wikipedia.org/wiki/BIOS"&gt;BIOS&lt;/a&gt;[a ROM chip embedded in the motherboard].The BIOS will start the processor and perform a &lt;a href="http://en.wikipedia.org/wiki/Power-on_self-test"&gt;POST&lt;/a&gt;[power on self test] to check whether the connected device are ready to use and are working properly. Once the POST is completes BIOS will jump to a specified location in the &lt;a href="http://en.wikipedia.org/wiki/RAM"&gt;RAM&lt;/a&gt; and check for the booting device.The boot sector is always the first sector of the hard disk and BIOS will load the &lt;a href="http://en.wikipedia.org/wiki/Master_boot_record"&gt;MBR&lt;/a&gt; into the memory.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);"&gt;Scene 2&lt;/span&gt;&lt;br /&gt;Here the boot loader takes the control of the booting process.LILO or GRUB are the boot loaders commonly available. It will help the user to select various boot options.Depending on the boot option selected the kernel is loaded.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);"&gt;scene 3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After kernel is loaded the kernel will take the control of the booting process and it will initialize all the hardwares including I/O processors etc.kernel then creates a root device and mounts the partitions.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(204, 0, 0);"&gt;Scene 4&lt;/span&gt;&lt;br /&gt;INIT is loaded&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-5681801509518763234?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/5681801509518763234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=5681801509518763234' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/5681801509518763234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/5681801509518763234'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2008/10/how-your-linux-boots.html' title='How your Linux Boots ?'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-8963128729747105837</id><published>2008-10-15T10:26:00.001+05:30</published><updated>2008-10-15T10:28:12.843+05:30</updated><title type='text'>Encrypt the Mail Attachment.</title><content type='html'>Now a days internet is considered to be the most unsecured area of data transfer. Most people will send emails with attachment of their confidential matters,agreements etc. Anybody can read once you hack the email. But if attach with an encrypted key,you can open only with the help of a password,which you give at the time of encryption. I am briefing,how to encrypt a file.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);"&gt;Infrastructure&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;OS: Ubuntu 8.04&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;Application : gpgv&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0); font-weight: bold;"&gt;#gpg -c &lt;filename&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This time it will ask for the password twice,give it. And you are done. Now you can&lt;br /&gt;see a filename called Filename.gpg. You can send it through internet comfortably.&lt;br /&gt;&lt;br /&gt;For Decrypting do the following&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0); font-weight: bold;"&gt;#gpg Filename.gpg&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Again it will ask for the password. Give ,OK file is decrypted.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-8963128729747105837?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/8963128729747105837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=8963128729747105837' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/8963128729747105837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/8963128729747105837'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2008/10/encrypt-mail-attachment.html' title='Encrypt the Mail Attachment.'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-5107122758029673949</id><published>2008-10-10T15:17:00.002+05:30</published><updated>2008-10-10T15:22:28.229+05:30</updated><title type='text'>Restart APACHE Safely</title><content type='html'>In all the Unix like machines ,there is an &lt;a href="http://en.wikipedia.org/wiki/Init"&gt;INIT&lt;/a&gt; script running for &lt;a href="http://en.wikipedia.org/wiki/Apache_HTTP_Server"&gt;APACHE&lt;/a&gt;. Normally it is located in /etc/init.d/httpd (In case of REDHAT based systems). But in Debian based systems it could be /etc/init.d/apache2. For restarting we use the following&lt;br /&gt;&lt;br /&gt;#/etc/init.d/httpd restart   (&lt;a href="http://en.wikipedia.org/wiki/Red_Hat"&gt;Redhat&lt;/a&gt; Based Systems)&lt;br /&gt;&lt;br /&gt;            OR&lt;br /&gt;&lt;br /&gt;#/etc/init.d/apache2 restart (&lt;a href="http://en.wikipedia.org/wiki/Debian"&gt;Debian&lt;/a&gt; Based Systems)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;While doing this command,it will KILL all the listening processes in the machine and stopping and starting Apache. But the problem is while applying the command CLIENTS will losts its all the established connections and result may be an error.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There is a wonderful command is in Apache for preventing this,the command is APACHECTL. Normally called Apache Control. Before restarting apache think once and apply the following&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#&lt;span style="font-weight: bold; color: rgb(204, 0, 0);"&gt;apachectl -k graceful&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The impact is Apache will serve all the established requests to the server. Then only it go for RE-start. User wont have a feelings of this COLD restart.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-5107122758029673949?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/5107122758029673949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=5107122758029673949' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/5107122758029673949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/5107122758029673949'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2008/10/restart-apache-safely.html' title='Restart APACHE Safely'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-3080343452424864701</id><published>2008-10-10T14:44:00.001+05:30</published><updated>2008-10-10T14:46:46.904+05:30</updated><title type='text'>What is GLUE Record</title><content type='html'>A glue record is an &lt;a href="http://en.wikipedia.org/wiki/List_of_DNS_record_types"&gt;A record&lt;/a&gt; that is created as part of a delegation. If a zone is delegated to a name server whose &lt;a href="http://en.wikipedia.org/wiki/Hostname"&gt;hostname&lt;/a&gt; is a Descendant of that particular zone, then a glue record for that hostname must be included in the delegation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-3080343452424864701?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/3080343452424864701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=3080343452424864701' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/3080343452424864701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/3080343452424864701'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2008/10/what-is-glue-record.html' title='What is GLUE Record'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-9161695830916937872</id><published>2008-09-24T15:37:00.006+05:30</published><updated>2008-09-24T15:44:02.164+05:30</updated><title type='text'>How to Find APACHE under Attack</title><content type='html'>Apache is the worlds largest using &lt;a href="http://en.wikipedia.org/wiki/Web_server"&gt;WEB SERVER&lt;/a&gt;. According to &lt;a href="http://news.netcraft.com/archives/2008/05/06/may_2008_web_server_survey.html"&gt;netcraft&lt;/a&gt; survey &lt;span style="font-weight: bold; color: rgb(255, 153, 255);"&gt;49.73%&lt;/span&gt; of the market is owned by this wonderful product. This was free under &lt;a href="http://en.wikipedia.org/wiki/GNU_General_Public_License"&gt;GPL&lt;/a&gt;. The attackers are trying to hack the websites,whichever may be the server. So a Web Administrator should be vigilant about his Apache server.&lt;br /&gt;&lt;br /&gt;Here I would like to tell how an administrator find whether his Apache server is Under Attack.&lt;br /&gt;&lt;br /&gt;1.First checkout the load of the server&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;top -u apache (Here apache means the web server user)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 0);"&gt;Tasks: 126 total,   1 running, 125 sleeping,   0 stopped,   0 zombie&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 0);"&gt;Cpu(s):  3.8%us,  0.7%sy,  0.0%ni, 94.3%id,  1.1%wa,  0.0%hi,  0.0%si,  0.0%st&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 0);"&gt;Mem:   1027224k total,   927296k used,    99928k free,    46428k buffers&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 0);"&gt;Swap:  3004112k total,        0k used,  3004112k free,   410736k cached&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 0);"&gt; PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 0);"&gt;5573 apache    20   0 20696 3284  584 S    0  0.3   0:00.00 apache2                                                                                        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 0);"&gt;5575 apache    20   0 20696 3284  584 S    0  0.3   0:00.00 apache2                                                                                        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 0);"&gt;5576 apache    20   0 20696 3284  584 S    0  0.3   0:00.00 apache2                                                                                        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 0);"&gt;5577 apache    20   0 20696 3284  584 S    0  0.3   0:00.00 apache2                                                                                        &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 102, 0);"&gt;5578 apache    20   0 20696 3284  584 S    0  0.3   0:00.00 apache2               &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is the normal stage of Apache. If the CPU usage is increasing,take care you are in trouble&lt;br /&gt;&lt;br /&gt;2.Check the number of running Apache processes&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ps -ef | grep apache | wc -l&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you get a number below 50,no problem. Other wise something nasty is happening&lt;br /&gt;&lt;br /&gt;3.Check how many listening connection to port 80&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ps -ef | grep apache | wc -l&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If the number goes beyong 100,an attacker closely watching your servers&lt;br /&gt;&lt;br /&gt;4.Check your listening foriegn IPs&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;netstat -tn&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can see that the same IP or IPrange is listening on your Web port (80). If you made a DNS lookup to those IPs You can found that all those IPS are come from a &lt;a href="http://en.wikipedia.org/wiki/Dhcp"&gt;DHCP&lt;/a&gt; pool,it means ATTACK.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-9161695830916937872?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/9161695830916937872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=9161695830916937872' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/9161695830916937872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/9161695830916937872'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2008/09/how-to-find-apache-under-attack.html' title='How to Find APACHE under Attack'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-8974552324301671075</id><published>2008-09-24T15:10:00.001+05:30</published><updated>2008-09-24T15:12:52.567+05:30</updated><title type='text'>MySQL Replication - A brief Note</title><content type='html'>Replication enables data from one MySQL database server (called the master) to be replicated to one or more MySQL database servers (slaves). Replication is asynchronous - your replication slaves do not need to be connected permanently to receive updates from the master, which means that updates can occur over long-distance connections and even temporary solutions such as a dial-up service. Depending on the configuration, you can replicate all databases, selected databases, or even selected tables within a database.  With the help of Replication we can assure the scalability of Data. Because once the Master server went off-line,the slave will act as the master and start serving data. The Data will be replicated into slave server in a frequent intervals. Replication in MySQL features support for one-way, asynchronous replication, in which one server acts as the master, while one or more other servers act as slaves&lt;br /&gt;&lt;br /&gt;The mail advantages of MySQL Replication are as follows&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;1.Scale-out solutions &lt;/span&gt;&lt;br /&gt;spreading the load among multiple slaves to improve performance. In this environment, all writes and updates must take place on the master server. Reads, however, may take place on one or more slaves. This model can improve the performance of writes (since the master is dedicated to updates), while dramatically increasing read speed across an increasing number of slaves.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&gt;2.Data security&lt;/span&gt;&lt;br /&gt;Because data is replicated to the slave, and the slave can pause the replication process, it is possible to run backup services on the slave without corrupting the corresponding master data.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 153, 0);"&gt;3.Analytics &lt;/span&gt;&lt;br /&gt;Live data can be created on the master, while the analysis of the information can take place on the slave without affecting the performance of the master.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 153, 102);"&gt;4.Long-distance data distribution&lt;br /&gt;&lt;/span&gt;If a branch office would like to work with a copy of your main data, you can use replication to create a local copy of the data for their use without requiring permanent access to the master.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-8974552324301671075?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/8974552324301671075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=8974552324301671075' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/8974552324301671075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/8974552324301671075'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2008/09/mysql-replication-brief-note.html' title='MySQL Replication - A brief Note'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-1070722621153894319</id><published>2008-09-24T14:16:00.000+05:30</published><updated>2008-09-24T14:17:54.639+05:30</updated><title type='text'>Voice problem in Firefox Flash plugin</title><content type='html'>The latest version of Ubuntu is Hardy. Its a perfect desktop I have ever seen. Some times you may face a problem hearing sound in FLASH player of Firefox. I am telling here how to  solve it. Most of the case its due to missing of a library file of adobe flash player&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;Infrastructure&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;OS :Ubuntu 8.04&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;Browser : Firefox 3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;apt-get install libflashsupport&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Restart the Firefox and enjoy the Sound&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-1070722621153894319?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/1070722621153894319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=1070722621153894319' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/1070722621153894319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/1070722621153894319'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2008/09/voice-problem-in-firefox-flash-plugin.html' title='Voice problem in Firefox Flash plugin'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-2546608308813456007</id><published>2008-09-18T10:23:00.002+05:30</published><updated>2008-09-18T10:47:31.666+05:30</updated><title type='text'>Wireless Internet in Ubuntu Hardy</title><content type='html'>People think getting wireless connectivity in LINUX is a difficult task. That is not right always It takes some times to configure. Because there is a one button click environment is not available nowadays. So we need some more steps to get it working. Also I am preparing a Script to do this automatically.&lt;br /&gt;&lt;br /&gt;Scenario&lt;br /&gt;To get wireless internet through DLINK access point in the ubuntu 8.04&lt;br /&gt;&lt;br /&gt;Infrastructure&lt;br /&gt;&lt;br /&gt;Machine  :  Acer Aspire 4715Z NWXMI-Pentium dual core-T2310&lt;br /&gt;OS  :  Ubuntu 8.04&lt;br /&gt;Wireless card :  Atheros&lt;br /&gt;&lt;br /&gt;1.First of all check your BIT version of OS&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;getconf LONG_BIT&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2.Check the Manufacture of your wireless car&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;lspci | grep wireless&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;3.Lets install the Drivers for Atheros Card . Download the ndiswrapper source code and AR5007EG Windows drivers&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;http://wifix.sourceforge.net/software.php?title=ndiswrapper&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;4.Download the AR5007EG Windows XP drivers,If you're using a 32-bit version of Linux, use this command&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;wget http://blakecmartin.googlepages.com/ar5007eg-32-0.2.tar.gz&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;5.Extract the archieves&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;tar xvf ar5007eg-*.tar.gz&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;tar xvf ndiswrapper-newest.tar.gz&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;6.Ensure you have your kernel headers and the build essential package.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;aptitude update &amp;amp;&amp;amp; sudo aptitude install linux-headers-$(uname -r) build-essential&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;7.Blacklist the ath_pci kernel module (it doesn't support our chipset).&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;echo "blacklist ath_pci" | sudo tee -a /etc/modprobe.d/blacklist&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;8.Compile Ndiswrapper&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;pushd ndiswrapper-*/&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;sudo make uninstall&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;make&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;sudo make install&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;popd&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;9.Install the Windows drivers (using ndiswrapper).&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;pushd */ar5007eg/&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;sudo ndiswrapper -i net5211.inf&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;popd&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;10.Make sure Ndiswrapper up and running everytime OS starts&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;sudo modprobe ndiswrapper&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;echo "ndiswrapper" | sudo tee -a /etc/modules&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;11.Just Reboot the Laptop&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;/sbin/shutdown -r now&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;You will get a NETWORK icon in the right top panel&lt;/span&gt;. &lt;span style="color: rgb(0, 0, 0);"&gt;Click on the ICON and search for available access point.&lt;br /&gt;EnjoY WirelesS InterneT.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-2546608308813456007?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/2546608308813456007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=2546608308813456007' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/2546608308813456007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/2546608308813456007'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2008/09/wireless-internet-in-ubuntu-hardy.html' title='Wireless Internet in Ubuntu Hardy'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-1887205892064211075</id><published>2008-09-15T14:04:00.005+05:30</published><updated>2008-11-25T14:00:15.636+05:30</updated><title type='text'>Prevent DoS attack in Linux using IPTABLES</title><content type='html'>A major problem facing by mail server admin is DOS (Deniel Of Service) attack. Hackers will try to mess up with the most popular ports of a UNIX/LINUX machines. We can prevent this my writing an IPTABLE rule in the server. The working is ,if some one is trying make connection continuously through a specified port the rule will block the IPADDRESS permanently. Here I am stating the securing of PORT 25 (SMTP) here you can use your own&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;iptables -I INPUT -p tcp --dport 25 -i eth0 -m state --state NEW -m recent --set&lt;br /&gt;&lt;br /&gt;iptables -I INPUT -p tcp --dport 25 -i eth0 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 -j DROP&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This will Block all the IP ADDRESS which will make connection to port 25 continuously within ie 4 SMTP connection within 60 seconds. You can change PORT,INTERVALs here.&lt;br /&gt;&lt;br /&gt;We can also log these ips as well and use for future purpose for example,if you would like to add these logged IP to  &lt;a href="http://en.wikipedia.org/wiki/TCP_Wrapper"&gt;TCPWRAPPER&lt;/a&gt; etc.&lt;br /&gt;Do the following.&lt;br /&gt;&lt;br /&gt;Firts of all Set your Log Daemon to log the IPTABLES&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;# vi /etc/syslog.conf&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Add the following line at the end of the file&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;#kern.warning /var/log/iptables.log&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;#touch /var/log/iptables.log&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Restart the System Log Service&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;#/etc/init.d/syslog restart&lt;/span&gt; (On Redhat based,Centos)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;iptables -A INPUT -j LOG --log-level 4&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;iptables -I INPUT -p tcp --dport 25 -i eth0 -m state --state NEW -m recent --set&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;iptables -I INPUT -p tcp --dport 25 -i eth0 -m state --state NEW -m recent --update --seconds 60 --hitcount 4 -j DROP --log-prefix '** HACKERS **'--log-level 4&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic; color: rgb(204, 0, 0);"&gt;PERFECT. THE HACKERS ARE BEING LOGGED NOW !!!.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The next stage is to add these logged ips to TCPWRAPPER (/etc/hosts.deny).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;#/bin/cat /var/log/iptables.log | awk '{print $9}' | cut -f2 -d "="  &gt;&gt; /root/badip.txt&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The above line will grep the SOURCE ip from the log and append to badip.txt&lt;br /&gt;&lt;br /&gt;Next Run this command as a frequent interval with the help of CRON&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;#vi /etc/crontab&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;*/1 * * * * root /bin/cat /var/log/iptables.log | awk '{print $9}' | cut -f2 -d "="  &gt;&gt; /root/badip.txt&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Here the script will run in every minutes. The file will be grow up rapidly to heavy size if your server have heavy traffic. So CleanUP the file in a frequent intervals. Better setup another CRON for it.&lt;br /&gt;&lt;br /&gt;Next to add these IPs in the hosts.deny file&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;#vi /etc/hosts.deny&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SSHD:/root/badip.txt&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;So things are clear. The first CRON job will update the file badip.txt list, as well as it will blocked by TCPWRAPPER.&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-1887205892064211075?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/1887205892064211075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=1887205892064211075' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/1887205892064211075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/1887205892064211075'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2008/09/prevent-dos-attack-in-linux.html' title='Prevent DoS attack in Linux using IPTABLES'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-4765206307202872630</id><published>2008-06-18T14:15:00.011+05:30</published><updated>2008-06-18T14:29:32.246+05:30</updated><title type='text'>Restrict Access With Apache</title><content type='html'>&lt;div style="text-align: justify;"&gt;In this document I hereby explain how to restrict access to a specified Directory in Apache.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;My infrastructure is&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;FC9&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Apache 2.2.6&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;For this example let’s say I want to protect a directory called private. Although your files may be in other locations, my files are located here:&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 255);"&gt;Directory to protect: /var/www/htdocs/private&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 255);"&gt;httpd.conf: /etc/apache/conf/httpd.conf&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;The very first thing to do is create an .htaccess file with following details right in the Directory&lt;br /&gt;&lt;/div&gt;[root@server ] &lt;span style="color: rgb(255, 102, 0);"&gt;touch /var/www/htdocs/private/.htaccess&lt;/span&gt;&lt;br /&gt;[root@server ] &lt;span style="color: rgb(255, 102, 0);"&gt;vi /var/www/htdocs/private/.htaccess&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;AuthType Basic&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;AuthUserFile /var/www/conf/.htpasswd&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;AuthName RestrictedArea&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;require valid-user&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 0);"&gt;satisfy any&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Here the .htpasswd file is storing the user name and password of authenticated users. You can specify this file any where in the directory.&lt;br /&gt;Change its ownership and permissions&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;[root@server ]&lt;span style="color: rgb(255, 102, 0);"&gt;chown apache.apache /var/www/conf/.htpasswd&lt;/span&gt;&lt;br /&gt;[root@server ]&lt;span style="color: rgb(255, 102, 0);"&gt;chmod 644 /var/www/conf/.htpasswd&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Next lets add this following content in the httpd.conf file. Put the following content in the Directory Tag&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;[root@server]&lt;span style="color: rgb(255, 102, 0);"&gt;vi /etc/httpd/conf/httpd.conf&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;directory&gt;&lt;directory&gt;&lt;br /&gt;deny from all&lt;br /&gt;Options ExecCGI&lt;br /&gt;AllowOverride AuthConfig&lt;br /&gt;Order deny,allow&lt;br /&gt;&lt;/directory&gt;&lt;/directory&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;Save and Exit&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now Lets add some users in the .htpasswd files&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[root@server]&lt;span style="color: rgb(255, 102, 0);"&gt;htpasswd –bc /var/www/conf/.htpasswd admin passwd&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;OK,Now lets restart the Apache&lt;br /&gt;&lt;br /&gt;[root@server]&lt;span style="color: rgb(255, 102, 0);"&gt;apachectl -k graceful&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Check the Web server ports are listening.&lt;br /&gt;&lt;br /&gt;[root@server]&lt;span style="color: rgb(255, 102, 0);"&gt;netstat -ntlp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;If the 80 port is listening go to your favourite web browser and type the address. It will ask for user name and password to check in.Other wise you will get an internal server error. You may miss something. Check with your server logs.&lt;div style="text-align: justify;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-4765206307202872630?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/4765206307202872630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=4765206307202872630' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/4765206307202872630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/4765206307202872630'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2008/06/restrict-access-with-apache-mini-how-to.html' title='Restrict Access With Apache'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-1452710992030730395</id><published>2008-06-11T10:10:00.012+05:30</published><updated>2008-06-17T09:07:53.248+05:30</updated><title type='text'>Point-to-Point Tunneling Protocol in FC9 How-To</title><content type='html'>&lt;div style="text-align: justify;"&gt;This article describe about how to setup a MPPE in Fedora 9.PPTP is used to connect a remote local network using Virtual Private Network. You can use this article in a COPY-PASTE method. It works fine for me. If you found any difficult while doing this,feel free to contact me&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;System Requirements&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0); font-weight: bold;"&gt;1.Kernel 2.6.15 or Later.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;install MPPE capability:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;MPPE is Microsoft Point-To-Point Encryption, and is described in RFC3078. You will need to install it if your PPTP Server requires it, and if your kernel is before 2.6.15. Microsoft Windows VPN Server requires MPPE. If you do not require MPPE, skip this step.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;If you can upgrade to 2.6.15 or later, do so, then skip the remainder of this step.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt; 1.Install the kernel-devel package for your kernel (or kernel-smp-devel if you are running an SMP kernel), for example:&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;# yum install kernel-devel&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt; 2.Check that your system is running the kernel corresponding to the package requested in the previous step. Use the uname command to display the version of the running kernel, for example:&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;# uname -r&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;    If the version shown is not the version installed in the previous step, reboot into that kernel. Otherwise the dkms build below may fail, because the kernel package for the current kernel may not be installed.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;3. install the dkms package:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;# yum install dkms&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;4. download the &lt;a href="http://prdownloads.sourceforge.net/poptop/kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm"&gt;kernel_ppp_mppe dkms&lt;/a&gt; rpm  and install it:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;# rpm --install kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;5. test that the MPPE module loads on request:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;# modprobe ppp-compress-18 &amp;amp;&amp;amp; echo success&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;    Note: this may fail if the ppp_generic module was already loaded when the kernel_ppp_mppe package was installed, as the original module is replaced on disk but not in memory. Check this by unloading the module, e.g. using "rmmod ppp_generic" or rebooting. Then repeat the modprobe.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;# download the PPTP client program &lt;/span&gt;&lt;a style="color: rgb(255, 102, 0);" href="http://prdownloads.sourceforge.net/pptpclient/pptp-1.7.0-1.i386.rpm"&gt;pptp&lt;/a&gt;&lt;span style="color: rgb(255, 102, 0);"&gt; rpm  and install it like this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;# rpm --install pptp-1.7.0-1.i386.rpm&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;Note: alternatively we've been told that you can get it from Fedora Extras, like this:&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;# yum install pptp&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;# verify that you have dependencies installed for the packages in the next step; (usually this is only a problem if you did a custom install):&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;# yum install libxml libglade&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;These packages are also available on the distribution media.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: justify;"&gt;# download the configuration program interpreter &lt;a href="http://prdownloads.sourceforge.net/pptpclient/php-pcntl-4.4.0-1.i386.rpm"&gt;php-pcntl&lt;/a&gt; rpm  install it like this:&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;# rpm --install php-pcntl-4.4.0-1.i386.rpm&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;# download the configuration program GTK+ interface &lt;a href="http://prdownloads.sourceforge.net/pptpclient/php-gtk-pcntl-1.0.2-1.i386.rpm"&gt;php-gtk-pcntl&lt;/a&gt; rpm (mirror link) and install it like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;# rpm --install php-gtk-pcntl-1.0.2-1.i386.rpm&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;# download the configuration program &lt;a href="http://prdownloads.sourceforge.net/pptpclient/pptpconfig-20040722-6.noarch.rpm"&gt;pptpconfig&lt;/a&gt; rpm  and install it like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;# rpm --install pptpconfig-20040722-6.noarch.&lt;/span&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;rpm&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:verdana,arial,helvetica,sans-serif;" &gt;&lt;b&gt;Configuration&lt;/b&gt;&lt;/span&gt;&lt;p&gt;  &lt;!-- future, table, images on right hand side --&gt; &lt;/p&gt;&lt;span style="color: rgb(0, 0, 0);font-family:verdana,arial,helvetica,sans-serif;" &gt;&lt;li&gt;obtain from your PPTP Server administrator:&lt;p&gt;  &lt;/p&gt;&lt;ul&gt;&lt;li&gt;the IP address or host name of the server, &lt;/li&gt;&lt;li&gt;the authentication domain name, (e.g. WORKGROUP), &lt;/li&gt;&lt;li&gt;the username you are to use, &lt;/li&gt;&lt;li&gt;the password you are to use, &lt;/li&gt;&lt;li&gt;whether encryption is required. &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;  &lt;/p&gt;&lt;/li&gt;&lt;li&gt;run &lt;i&gt;pptpconfig&lt;/i&gt; &lt;a href="http://pptpclient.sourceforge.net/howto-diagnosis.phtml#x_display"&gt;as root&lt;/a&gt;, and a window should appear,&lt;p&gt; &lt;img src="http://pptpclient.sourceforge.net/images/ss-1.png" height="213" width="309" /&gt;&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;/li&gt;&lt;li&gt;enter the server, domain, username and password into the &lt;i&gt;Server&lt;/i&gt; tab,&lt;p&gt;  &lt;/p&gt;&lt;/li&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:verdana,arial,helvetica,sans-serif;" &gt;&lt;li&gt;&lt;div style="text-align: justify;"&gt;if you decided in Installation step 1 above that you would need MPPE, and if your administrator says encryption is required, then on the &lt;i&gt;Encryption&lt;/i&gt; tab, click on &lt;i&gt;Require Microsoft Point-to-Point Encryption (MPPE)&lt;/i&gt;,&lt;/div&gt;&lt;p&gt; &lt;img src="http://pptpclient.sourceforge.net/images/ss-4-encryption.png" height="85" width="303" /&gt;&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;/li&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:verdana,arial,helvetica,sans-serif;" &gt;&lt;li&gt;&lt;div style="text-align: justify;"&gt;click on &lt;i&gt;Add&lt;/i&gt;, and the tunnel will appear in the list,&lt;/div&gt;&lt;p&gt;  &lt;/p&gt;&lt;/li&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);font-family:verdana,arial,helvetica,sans-serif;" &gt;&lt;li&gt;&lt;div style="text-align: justify;"&gt;click on the tunnel to select it, click on &lt;i&gt;Start&lt;/i&gt;, and a window will appear with the tunnel connection log and status,&lt;/div&gt;&lt;p&gt;  &lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;/li&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-1452710992030730395?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/1452710992030730395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=1452710992030730395' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/1452710992030730395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/1452710992030730395'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2008/06/point-to-point-tunneling-protocol-in.html' title='Point-to-Point Tunneling Protocol in FC9 How-To'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-3703557312512985914</id><published>2008-05-30T14:32:00.005+05:30</published><updated>2008-05-30T14:39:12.126+05:30</updated><title type='text'>Mail sending from EC2 using Postfix.</title><content type='html'>&lt;div style="text-align: justify;"&gt;One of the main problem I found in the EC2 is to sending mail to outside world. Some mail servers like YAHOO and HOTMAIL will block all the orphan mails from EC2 as &lt;a href="http://en.wikipedia.org/wiki/E-mail_spam"&gt;SPAM&lt;/a&gt;. So people cannot send mail like CustomerVerification,NewsLetter from EC2 comfortably.So I am hereby stating an alternate method which was experimented by Paul to get out of this problem. This is sending mails using &lt;a href="http://en.wikipedia.org/wiki/Postfix_%28software%29"&gt;POSTFIX&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;Scenario&lt;/span&gt;&lt;br /&gt;1.Amazon EC2&lt;br /&gt;2.Customised AMI from FC4&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;HowTo&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;1.Stop Sendmail&lt;/span&gt;&lt;br /&gt;#/etc/init.d/sendmail stop&lt;br /&gt;#chkconfig --levels 2345 sendmail off&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;2.Installing Postfix&lt;/span&gt;&lt;br /&gt;#yum -y install postfix&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;3.Editing the /etc/postfix/main.cf&lt;/span&gt;&lt;br /&gt;#vi /etc/postfix/main.cf&lt;br /&gt;&lt;br /&gt;myhostname = www.YOURDOMAIN.com&lt;br /&gt;mydomain = YOURDOMAIN.com&lt;br /&gt;myorigin = $mydomain&lt;br /&gt;&lt;br /&gt;smtpd_banner = $myhostname ESMTP $mail_name&lt;br /&gt;biff = no&lt;br /&gt;append_dot_mydomain = no&lt;br /&gt;&lt;br /&gt;alias_maps = hash:/etc/aliases&lt;br /&gt;alias_database = hash:/etc/aliases&lt;br /&gt;mydestination = localdomain, localhost, localhost.localdomain, localhost&lt;br /&gt;mynetworks = 127.0.0.0/8&lt;br /&gt;mailbox_size_limit = 0&lt;br /&gt;recipient_delimiter = +&lt;br /&gt;&lt;br /&gt;# SECURITY NOTE: Listening on all interfaces. Make sure your firewall is&lt;br /&gt;# configured correctly&lt;br /&gt;inet_interfaces = all&lt;br /&gt;&lt;br /&gt;relayhost = [mail.authsmtp.com]&lt;br /&gt;smtp_connection_cache_destinations = mail.authsmtp.com&lt;br /&gt;smtp_sasl_auth_enable = yes&lt;br /&gt;smtp_sasl_password_maps = static:YOUR_AUTHSMPT_USER_ID:YOUR_AUTHSMTP_PW&lt;br /&gt;smtp_sasl_security_options = noanonymous&lt;br /&gt;&lt;br /&gt;default_destination_concurrency_limit = 4&lt;br /&gt;&lt;br /&gt;soft_bounce = yes&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;4.Save and Exit&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;5.Start the Postfix&lt;/span&gt;&lt;br /&gt;#/etc/init.d/postfix start&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;6.Check whether master is listening or not&lt;/span&gt;&lt;br /&gt;#ps -ef | grep master&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Enjoy Mailing from &lt;span style="font-style: italic;"&gt;EC2&lt;/span&gt; without trouble&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-3703557312512985914?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/3703557312512985914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=3703557312512985914' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/3703557312512985914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/3703557312512985914'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2008/05/one-of-main-problem-i-found-in-ec2-is.html' title='Mail sending from EC2 using Postfix.'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-4183994718216846666</id><published>2008-05-29T17:06:00.005+05:30</published><updated>2008-12-14T21:50:05.231+05:30</updated><title type='text'>How a DNS works - Simple Example</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_3Lgl7ZQyPyk/SD6bfu1zjLI/AAAAAAAAADc/x25Nr2cKBKo/s1600-h/how_dns_works.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_3Lgl7ZQyPyk/SD6bfu1zjLI/AAAAAAAAADc/x25Nr2cKBKo/s200/how_dns_works.png" alt="" id="BLOGGER_PHOTO_ID_5205769188738829490" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;ul&gt;&lt;li style="text-align: justify;"&gt;A User opens a web browser and tries to connect to &lt;span style="color: rgb(102, 102, 204);"&gt;www.google.com&lt;/span&gt;. The operating system not knowing the IP Address for &lt;span style="color: rgb(102, 102, 204);"&gt;www.google.com,&lt;/span&gt; asks the &lt;a href="http://en.wikipedia.org/wiki/Internet_service_provider"&gt;ISP&lt;/a&gt;'s &lt;a href="http://en.wikipedia.org/wiki/Domain_Name_System"&gt;DNS&lt;/a&gt; Server for this information.&lt;/li&gt;&lt;li style="text-align: justify;"&gt;The ISP's DNS Server does not know this information, so it connects to a &lt;a href="http://en.wikipedia.org/wiki/Root_nameserver"&gt;Root Server&lt;/a&gt; to find out what name server, running somewhere in the world, to know the information about google.com.&lt;/li&gt;&lt;li style="text-align: justify;"&gt;The Root Server tells the ISP's DNS Server to contact a particular name server that knows the information about google.com.&lt;/li&gt;&lt;li style="text-align: justify;"&gt;The ISP's DNS Server connects to &lt;span style="color: rgb(204, 102, 0);"&gt;Google's&lt;/span&gt; DNS server and asks for the IP Address for www.google.com.&lt;/li&gt;&lt;li style="text-align: justify;"&gt;Google's DNS Server responds to the ISP's DNS server with the appropriate &lt;a href="http://en.wikipedia.org/wiki/IP_address"&gt;IP&lt;/a&gt; Address.&lt;/li&gt;&lt;li style="text-align: justify;"&gt;The ISP's DNS Server tells the User's operating system the IP Address for google.com.&lt;/li&gt;&lt;li style="text-align: justify;"&gt;The operating system tells the Web Browser the IP Address for www.google.com.&lt;/li&gt;&lt;li style="text-align: left;"&gt;The web browser connects and starts communication with &lt;a href="http://google.com/"&gt;&lt;span style="color: rgb(102, 102, 204);"&gt;www.google.com&lt;/span&gt;&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;Graphical Representation&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-4183994718216846666?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/4183994718216846666/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=4183994718216846666' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/4183994718216846666'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/4183994718216846666'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2008/05/how-dns-works-simple-example.html' title='How a DNS works - Simple Example'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_3Lgl7ZQyPyk/SD6bfu1zjLI/AAAAAAAAADc/x25Nr2cKBKo/s72-c/how_dns_works.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-1314689861618914170</id><published>2008-05-20T10:42:00.002+05:30</published><updated>2008-05-20T10:46:12.634+05:30</updated><title type='text'>Amazon S3. New definition in Storage</title><content type='html'>&lt;div style="text-align: justify;"&gt;Amazon &lt;span style="font-weight: bold;"&gt;S3 (Simple Storage Service)&lt;/span&gt; is an online storage web service offered by Amazon Web Services. Amazon S3 provides unlimited storage through a simple web services interface. Amazon launched S3, its first publicly-available web service, in the United States in March 2006 and in Europe in November 2007. Amazon charges fees for data stored and for bandwidth used in sending and receiving data. Amazon S3 uses the same scalable storage infrastructure that Amazon.com uses to run its own global e-commerce network.[citation needed Amazon S3 is reported to store more than 10 billion objects as of November 2007.[citation needed] Many small start-ups and enterprise clients use S3 as a web hosting service, image hosting service, back-up system, and more ...&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-1314689861618914170?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/1314689861618914170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=1314689861618914170' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/1314689861618914170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/1314689861618914170'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2008/05/amazon-s3-new-definition-in-storage.html' title='Amazon S3. New definition in Storage'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-2201748588770815772</id><published>2008-05-20T10:40:00.002+05:30</published><updated>2008-05-20T10:45:21.011+05:30</updated><title type='text'>Amazon EC2. New Wave in Webhosting</title><content type='html'>&lt;div style="text-align: justify;"&gt;Amazon Elastic Compute Cloud, also known as &lt;span style="color: rgb(204, 51, 204);"&gt;"&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(204, 51, 204);"&gt;EC2&lt;/span&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;",&lt;/span&gt; is a commercial web service which allows paying customers to rent computers to run computer applications on. &lt;span style="font-weight: bold;"&gt;EC2&lt;/span&gt; allows scalable deployment of applications by providing a web services interface through which customers can request an arbitrary number of Virtual Machines, i.e. server instances, on which they can load any software of their choice. Current users are able to create, launch, and terminate server instances on demand, hence the term "elastic". The Amazon implementation allows server instances to be created in zones that are insulated from correlated failures. EC2 is one of several Web Services provided by Amazon.com under the blanket term Amazon Web Services &lt;span style="font-weight: bold;"&gt;(AWS)&lt;/span&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-2201748588770815772?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/2201748588770815772/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=2201748588770815772' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/2201748588770815772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/2201748588770815772'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2008/05/amazon-ec2-new-wave-in-webhosting.html' title='Amazon EC2. New Wave in Webhosting'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-7020886881394700981</id><published>2007-04-12T15:06:00.000+05:30</published><updated>2007-04-12T15:16:14.186+05:30</updated><title type='text'>SCRIPT TO MONITOR  A SERVER IN EVERY 30 MINUTES</title><content type='html'>&lt;pre&gt;&lt;tt&gt;&lt;b&gt;&lt;span style="font-size:12;"&gt;This script is used to check the health of Your servers.&lt;br /&gt;# !/bin/bash&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;pre&gt;&lt;tt&gt;&lt;span style="color: rgb(154, 25, 0);font-size:12;" &gt;# add ip / hostname separated by while space &lt;/span&gt;&lt;/tt&gt;&lt;tt&gt;&lt;span style="font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;pre&gt;&lt;tt&gt;&lt;span style="font-size:12;"&gt;HOSTS&lt;span style="color: rgb(153, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color:red;"&gt;"aaa.com bbb.com 202.10.193.46 router"&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;pre&gt;&lt;tt&gt;&lt;span style="color: rgb(154, 25, 0);font-size:12;" &gt;# no ping request&lt;/span&gt;&lt;/tt&gt;&lt;tt&gt;&lt;span style="font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;pre&gt;&lt;tt&gt;&lt;span style="font-size:12;"&gt;COUNT&lt;span style="color: rgb(153, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(153, 51, 153);"&gt;1&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;pre&gt;&lt;tt&gt;&lt;span style="color: rgb(154, 25, 0);font-size:12;" &gt;# email report when &lt;/span&gt;&lt;/tt&gt;&lt;tt&gt;&lt;span style="font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;pre&gt;&lt;tt&gt;&lt;span style="font-size:12;"&gt;SUBJECT&lt;span style="color: rgb(153, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color:red;"&gt;"Ping failed Server Seems to be DOWN"&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;pre&gt;&lt;tt&gt;&lt;span style="font-size:12;"&gt;EMAILID&lt;span style="color: rgb(153, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color:red;"&gt;"Your emailid"&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;pre&gt;&lt;tt&gt;&lt;b&gt;&lt;span style=";font-size:12;color:blue;"  &gt;for&lt;/span&gt;&lt;/b&gt;&lt;/tt&gt;&lt;tt&gt;&lt;span style="font-size:12;"&gt; myHost in &lt;span style="color: rgb(0, 153, 0);"&gt;$HOSTS&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;pre&gt;&lt;tt&gt;&lt;b&gt;&lt;span style=";font-size:12;color:blue;"  &gt;do&lt;/span&gt;&lt;/b&gt;&lt;/tt&gt;&lt;tt&gt;&lt;span style="font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;pre&gt;&lt;tt&gt;&lt;b&gt;&lt;span style=";font-size:12;color:blue;"  &gt;count&lt;/span&gt;&lt;/b&gt;&lt;/tt&gt;&lt;tt&gt;&lt;span style="color: rgb(153, 0, 0);font-size:12;" &gt;=&lt;/span&gt;&lt;/tt&gt;&lt;tt&gt;&lt;span style="color: rgb(0, 153, 0);font-size:12;" &gt;$&lt;/span&gt;&lt;/tt&gt;&lt;tt&gt;&lt;span style="color: rgb(153, 0, 0);font-size:12;" &gt;(&lt;/span&gt;&lt;/tt&gt;&lt;tt&gt;&lt;span style="font-size:12;"&gt;ping &lt;span style="color: rgb(153, 0, 0);"&gt;-&lt;/span&gt;c &lt;span style="color: rgb(0, 153, 0);"&gt;$COUNT&lt;/span&gt; &lt;span style="color: rgb(0, 153, 0);"&gt;$myHost&lt;/span&gt; &lt;span style="color: rgb(153, 0, 0);"&gt;|&lt;/span&gt; grep &lt;span style="color:red;"&gt;'received'&lt;/span&gt; &lt;span style="color: rgb(153, 0, 0);"&gt;|&lt;/span&gt; awk &lt;span style="color: rgb(153, 0, 0);"&gt;-&lt;/span&gt;F&lt;span style="color:red;"&gt;','&lt;/span&gt; &lt;span style="color:red;"&gt;'{ print $2 }'&lt;/span&gt; &lt;span style="color: rgb(153, 0, 0);"&gt;|&lt;/span&gt; awk &lt;span style="color:red;"&gt;'{ print $1 }'&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;)&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;pre&gt;&lt;tt&gt;&lt;b&gt;&lt;span style=";font-size:12;color:blue;"  &gt;if&lt;/span&gt;&lt;/b&gt;&lt;/tt&gt;&lt;tt&gt;&lt;span style="font-size:12;"&gt; &lt;span style="color: rgb(153, 0, 0);"&gt;[&lt;/span&gt; &lt;span style="color: rgb(0, 153, 0);"&gt;$count&lt;/span&gt; &lt;span style="color: rgb(153, 0, 0);"&gt;-&lt;/span&gt;eq &lt;span style="color: rgb(153, 51, 153);"&gt;0&lt;/span&gt; &lt;span style="color: rgb(153, 0, 0);"&gt;];&lt;/span&gt; then&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;pre&gt;&lt;tt&gt;&lt;span style="color: rgb(154, 25, 0);font-size:12;" &gt;# 100% failed &lt;/span&gt;&lt;/tt&gt;&lt;tt&gt;&lt;span style="font-size:12;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;pre&gt;&lt;tt&gt;&lt;b&gt;&lt;span style=";font-size:12;color:blue;"  &gt;echo&lt;/span&gt;&lt;/b&gt;&lt;/tt&gt;&lt;tt&gt;&lt;span style="font-size:12;"&gt; &lt;span style="color:red;"&gt;"Host : $myHost is down (ping failed) at $(date)"&lt;/span&gt; &lt;span style="color: rgb(153, 0, 0);"&gt;|&lt;/span&gt; mail &lt;span style="color: rgb(153, 0, 0);"&gt;-&lt;/span&gt;s &lt;span style="color:red;"&gt;"$SUBJECT"&lt;/span&gt; &lt;span style="color: rgb(0, 153, 0);"&gt;$EMAILID&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-7020886881394700981?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/7020886881394700981/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=7020886881394700981' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/7020886881394700981'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/7020886881394700981'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2007/04/script-to-monitor-server-in-every-30.html' title='SCRIPT TO MONITOR  A SERVER IN EVERY 30 MINUTES'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-4184227747587213886</id><published>2007-04-12T14:59:00.000+05:30</published><updated>2007-04-12T15:01:58.693+05:30</updated><title type='text'>Interview Questions for Linux Administrator</title><content type='html'>&lt;p style="text-align: justify;" class="MsoNormal"&gt;&lt;b&gt;The following are some questions which I faced from the interview board for the post of Linux Administrator. This will be update when I get more resources.&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;1.When do you need a virtual hosting ?&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style="font-size: 14pt;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="font-size: 14pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;The term &lt;span class="Quotation"&gt;Virtual Host&lt;/span&gt; refers to the practice of maintaining more than one server on one machine, as differentiated by their apparent hostname. For example, it is often desirable for companies sharing a web server to have their own domains, with web servers accessible as &lt;span class="Example"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;www.company1.com&lt;/span&gt;&lt;/span&gt; and &lt;span class="Example"&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;;"&gt;www.company2.com&lt;/span&gt;&lt;/span&gt;, without requiring the user to know any extra path information. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;2.In which port telnet is listening?&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;23&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;3.How to get the listening ports which is greater than 6000 using netstat ?&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;4.How to block and openrelay ?&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Open relays are e-mail servers that are configured to accept and transfer e-mail on behalf of any user anywhere, including unrelated third parties. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The qmail-smtpd daemon will consult the rcpthosts control file to determine valid destination addresses, and reject anything else. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;5.What is sandwitch configuration in qmail ?&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Qmail + Clam + Spamassassin- This is normally called Sandwitch configuration in qmail.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;6.Advantages of Qmail ?&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;a name="intelliTxt"&gt;&lt;/a&gt;More secure, better designed, modular, faster, more reliable, easier to configure, don't have to upgrade it every few months or worry about being vulnerable to something due to some obscure feature being enabled &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;qmail supports host and user masquerading, full host hiding, virtual domains, null clients, list-owner rewriting, relay control, double-bounce recording, arbitrary RFC 822 address lists, cross-host mailing list loop detection, per-recipient checkpointing, downed host backoffs, independent message retry schedules, etc. qmail also includes a drop-in ``sendmail'' wrapper so that it will be used transparently by your current UAs. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText" style="text-align: justify;"&gt;&lt;b&gt;7.What is the difference between POP3 and IMAP ?&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;strong&gt;&lt;span style="font-weight: normal;"&gt;The Difference&lt;/span&gt;&lt;/strong&gt; &lt;/p&gt;  &lt;p class="MsoBodyText" style="text-align: justify;"&gt;POP3 works by reviewing the inbox on the mail server, and downloading the new messages to your computer.  IMAP downloads the headers of the new messages on the server, then retrieves the message you want to read when you click on it. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText" style="text-align: justify;"&gt;When using POP3, your mail is stored on your PC. When using IMAP, the mail is stored on the mail server. Unless you copy a message to a "Local Folder" the messages are never copied to your PC.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;&lt;a name="sec2"&gt;&lt;/a&gt;Scenarios of Use&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;POP3&lt;/p&gt;  &lt;p class="MsoBodyText" style="margin-left: 35.35pt; text-indent: -14.15pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;You only check e-mail from one computer.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText" style="margin-left: 35.35pt; text-indent: -14.15pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;You want to remove your e-mail from the mail server.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText"&gt;IMAP&lt;/p&gt;  &lt;p class="MsoBodyText" style="margin-left: 35.35pt; text-indent: -14.15pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;You check e-mail from multiple locations.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoBodyText" style="margin-left: 35.35pt; text-indent: -14.15pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 9pt; font-family: Symbol;"&gt;·&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;You use Webmail.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;8.How to drop packets using iptables ?&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Iptables -A INPUT -s xx.xx.xx.xx -d xx.xx.xx.xx -j DROP&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;9.Daily routines of Linux Administrators ?&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;*.Check the health of servers&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;*.Check for updates &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;*.Check the Backup&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;*.Check with the trouble ticketing system for any unread ticket.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;*.Troubleshoot if there any problem&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;*.Installation of new servers, if needed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;*.Report to the Boss&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;10.How to take the Dump of a MySQL Database ?&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Mysqldump databasename &gt; dumpname&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;11.How to know the CPU usage of each process ?&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Top, uptime&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;12.How to bind another IP in a NIC ?&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Copy the contents eth0 to eth1, and change the ipaddress. Restart the network. .&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;13.Transparently proxy all web-surfing through Squid box&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="PreformattedText"&gt;iptables -t nat -A PREROUTING -i eth1 -tcp --dport 80 -j DNAT --to &lt;squid&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="PreformattedText"&gt;iptables -t nat -A PREROUTING -i eth1 -tcp --dport 80 -j DNAT --to &lt;squid&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="PreformattedText"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="PreformattedText"&gt;&lt;b&gt;14.Transparently redirect web connections from outside to the DMZ web server.&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="PreformattedText"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="PreformattedText"&gt;iptables -t nat -A PREROUTING -i eth0 -d 192.168.1.1 -dport 80 -j DNAT –to &lt;dmzip&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="PreformattedText"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="PreformattedText"&gt;&lt;b&gt;15 Howto Activate the forwarding&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="PreformattedText"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="PreformattedText" style="margin-bottom: 14.15pt;"&gt;echo 1 &gt;/proc/sys/net/ipv4/ip_forward&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="PreformattedText" style="margin-bottom: 14.15pt;"&gt;&lt;b&gt;16.Kill spoofed packets&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="PreformattedText"&gt;for f in /proc/sys/net/ipv4/conf/*/rp_filter; do&lt;/p&gt;  &lt;p class="PreformattedText"&gt;&lt;span style=""&gt;     &lt;/span&gt;echo 1 &gt; $f&lt;/p&gt;  &lt;p class="PreformattedText" style="margin-bottom: 14.15pt;"&gt;done.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="PreformattedText" style="margin-bottom: 14.15pt;"&gt;$iptables -A LDROP --proto tcp -j LOG --log-level info \ --log-prefix “TCP Drop”&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p class="PreformattedText" style="margin-bottom: 14.15pt;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-4184227747587213886?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/4184227747587213886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=4184227747587213886' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/4184227747587213886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/4184227747587213886'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2007/04/interview-questions-for-linux.html' title='Interview Questions for Linux Administrator'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-164427828051906280</id><published>2007-04-12T14:15:00.000+05:30</published><updated>2007-04-12T14:19:11.737+05:30</updated><title type='text'>IPTABLE firewall for a corporate mail server.</title><content type='html'>This is an &lt;span style="font-weight: bold;"&gt;IPTABLE firewall&lt;/span&gt; for a corporate mail server. This working fine for various live servers. All are running &lt;span style="font-weight: bold;"&gt;Qmail&lt;/span&gt;. You can test it it locally first.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Please do not install it on remote server first.  &lt;/span&gt;For further queries regarding this script please ask to me on &lt;span style="font-weight: bold;"&gt;bipinkdas@gmail.com&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#THIS IPTABLE RULES ARE FOR A QMAIL  SERVER&lt;br /&gt;#Replace ips as needed,if you need further queries do contact webmaster.&lt;br /&gt;&lt;br /&gt;#clean up existing rules and delete custom chains&lt;br /&gt;/sbin/iptables -t filter -F&lt;br /&gt;/sbin/iptables -t nat -F&lt;br /&gt;/sbin/iptables -t mangle -F&lt;br /&gt;/sbin/iptables -X&lt;br /&gt;&lt;br /&gt;#set default policy to drop everything&lt;br /&gt;/sbin/iptables -P INPUT DROP&lt;br /&gt;/sbin/iptables -P FORWARD DROP&lt;br /&gt;/sbin/iptables -P OUTPUT DROP&lt;br /&gt;&lt;br /&gt;$source=192.168.10.1&lt;br /&gt;$dest=192.168.20.1&lt;br /&gt;$dns=192.168.1.1&lt;br /&gt;$backup=192.168.10.10&lt;br /&gt;&lt;br /&gt;#####incoming rules######&lt;br /&gt;&lt;br /&gt;#drop all invalid packets&lt;br /&gt;/sbin/iptables -A INPUT -m state --state INVALID -j DROP&lt;br /&gt;&lt;br /&gt;#allow all icmp packets from world&lt;br /&gt;/sbin/iptables -A INPUT -s 0/0 -d $dest  -p icmp -j ACCEPT&lt;br /&gt;&lt;br /&gt;#allow all input from loopback&lt;br /&gt;/sbin/iptables -A INPUT -i lo -j ACCEPT&lt;br /&gt;&lt;br /&gt;#allow http from world&lt;br /&gt;/sbin/iptables -A INPUT -s 0/0 -d $dest -p tcp --dport 80 -j ACCEPT&lt;br /&gt;&lt;br /&gt;#allow mails from and to  world&lt;br /&gt;/sbin/iptables -A INPUT -s 0/0 -d $dest -p tcp --dport 25 -j ACCEPT&lt;br /&gt;/sbin/iptables -A INPUT -s 0/0 -d $dest -p tcp --dport 110 -j ACCEPT&lt;br /&gt;&lt;br /&gt;#allow rsync from  backup machine&lt;br /&gt;/sbin/iptables -A INPUT -s $backup -d $dest -p tcp --dport 873 -j ACCEPT&lt;br /&gt;&lt;br /&gt;#allow packets from connections we established&lt;br /&gt;/sbin/iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT&lt;br /&gt;&lt;br /&gt;######forwarding rules######&lt;br /&gt;&lt;br /&gt;#no forwarding rule for a mail server.&lt;br /&gt;&lt;br /&gt;######outgoing rules######&lt;br /&gt;&lt;br /&gt;#drop all outgoing invalid packets&lt;br /&gt;/sbin/iptables -A OUTPUT -m state --state INVALID -j DROP&lt;br /&gt;&lt;br /&gt;#allow all icmp packets to outside world&lt;br /&gt;/sbin/iptables -A OUTPUT -s $source -d 0/0 -p icmp -j ACCEPT&lt;br /&gt;&lt;br /&gt;#allow dns traffic&lt;br /&gt;/sbin/iptables -A OUTPUT -s $source -d $dns -p udp --dport 53 -j ACCEPT&lt;br /&gt;&lt;br /&gt;#allow mails to world&lt;br /&gt;/sbin/iptables -A OUTPUT -s $source -d 0/0 -p tcp --dport 25 -j ACCEPT&lt;br /&gt;&lt;br /&gt;#allow ftp to backup server&lt;br /&gt;/sbin/iptables -A OUTPUT -s $source -d $backup -p tcp --dport 21 -j ACCEPT&lt;br /&gt;&lt;br /&gt;#allow all input to loopback interface&lt;br /&gt;/sbin/iptables -A OUTPUT -o lo -j ACCEPT&lt;br /&gt;&lt;br /&gt;#allow packets of established connections&lt;br /&gt;/sbin/iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT&lt;br /&gt;&lt;br /&gt;######save iptables rules######&lt;br /&gt;service iptables save&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-164427828051906280?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/164427828051906280/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=164427828051906280' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/164427828051906280'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/164427828051906280'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2007/04/iptable-firewall-for-corporate-mail.html' title='IPTABLE firewall for a corporate mail server.'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-466215033562657499</id><published>2007-03-26T09:38:00.000+05:30</published><updated>2007-04-12T14:23:04.261+05:30</updated><title type='text'>Free software and Me</title><content type='html'>&lt;p class="MsoNormal" style="text-align: justify;"&gt;Linux is the fastest growing operating system in the world.&lt;span style=""&gt;  &lt;/span&gt;The kernel of the Linux was developed by &lt;a href="http://en.wikipedia.org/wiki/Linus_Torvalds"&gt;&lt;span style=""&gt;L&lt;/span&gt;&lt;span style=""&gt;INUS &lt;/span&gt;&lt;span style=""&gt;B&lt;/span&gt;&lt;span style=""&gt;ENEDICT &lt;/span&gt;&lt;span style=""&gt;T&lt;/span&gt;&lt;span style=""&gt;ORVALDS&lt;/span&gt;&lt;/a&gt; a finnish student. He was made it as his academic project. Its as UNIX like operating system also a predominant example of &lt;a href="http://fsf.org"&gt;Freesoftware&lt;/a&gt;. It is now considered as the most secured and widely used Server Operating System.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;I am not an expert in Linux System Administration. I had installed linux in my home PC on 2002. My friend Jayesh (Now working with Accenture Software Services) installed it for me. It was Redhat Linux 7.2. Since that day I have been using it for Browsing. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;From 2002 I had interacted with Linux. I was working with &lt;a href="http://ossics.com"&gt;Open software solutions&lt;span style=""&gt;  &lt;/span&gt;ICS ltd&lt;/a&gt; as a supporting staff. On the part of my job I had installed more than 200 linux installations and a very little bit knowledge on networking. I had left the company on October 2005. &lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;I had&lt;span style=""&gt;  &lt;/span&gt;joined &lt;a href="http://spectrum.net.in"&gt;Spectrum softtech solutions&lt;/a&gt; Ltd, Keralas leading ISP. This company give me opportunity to interact with Linux servers. This company have more than 30 Linux servers. 18 of them are Qmail server for their collocation customers. 5 of them are exclusive Apache web servers. Others multipurpose linux servers including Relay server, trouble ticketing server etc. I am very much thankful to AnuBhaskar (Now working with Accenture Software Services) and LeenoJose (Now working with Ditro advanced Technologies) who taught me the basics of Linux administration. With the help of these masters I had installed my first Mail server and send an email to my friend sabeesh with a subject line of Sub:I did it.from the id bipin@bipin.com.&lt;span style=""&gt;  &lt;/span&gt;From these masters I am trying to watch this ocean. I had completed 8 months in this company. In this short interval I had installed 5 Qmail servers, 8 Apache web servers, 1 Trouble ticketing system (OTRS).&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;2 Mail server migration. Etc. Apart from this I had managed the above said 30 servers for the customers. I had resigned from this company on November 2006.&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: justify;"&gt;I joined &lt;a href="http://ditro.com"&gt;Ditro Advanced Technologies&lt;/a&gt; as Linux Administrator for their overseas client Ran Internet SL, a Spanish ISP. In this company I had met a number of challenging events, like a mail server which running on SENDMAIL/CYRUS/LDAP. Interesting thing is all these servers are running on independent machines. The motive is to share the load of each servers.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-466215033562657499?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/466215033562657499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=466215033562657499' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/466215033562657499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/466215033562657499'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2007/03/free-software-and-me.html' title='Free software and Me'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6587524289582183832.post-7097674506404235348</id><published>2007-03-22T15:13:00.000+05:30</published><updated>2007-04-12T14:26:12.077+05:30</updated><title type='text'>MOD_SECURE APACHE 1.9.4 – HOWTO</title><content type='html'>&lt;p class="MsoTitle"&gt;&lt;u&gt;MOD_SECURE APACHE 1.9.4 – HOWTO&lt;o:p&gt;&lt;/o:p&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="text-align: justify;"&gt;ModSecurity is an embeddable web application firewall. It provides protection from a range of attacks against web applications and allows for HTTP traffic monitoring and real-time analysis with no changes to existing infrastructure. This is also known as rule based Intrusion Detection System.&lt;/p&gt;  &lt;p style="text-align: justify;"&gt;It is also an open source project that aims to make the web application firewall technology available to everyone.&lt;/p&gt;&lt;p style="text-align: justify;"&gt;(I had tested this on a debian sarge with Apache 1.3)&lt;br /&gt;&lt;/p&gt;  &lt;p style="margin: 0in 0in 0.0001pt;"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;!--[if !supportEmptyParas]--&gt; Create a directory for storing the source file.&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;$mkdir –p /opt/src&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;$cd /opt/src&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Download the latest stable release from the mirror&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;a href="http://www.modsecurity.org/download/modsecurity-apache_1.9.4.tar.gz"&gt;modsecurity-apache_1.9.4.tar.gz&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Untar the&lt;span style=""&gt;  &lt;/span&gt;pack&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt;$tar –zxvf modsecurity-apache_1.9.4.tar.gz&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;$cd mod_security-1.9.4/apache1/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;$apxs -cia mod_security.c&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;Restart your Webserver.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;  &lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;pre&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;/etc/init.d/httpd restart&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;If there was no error reporte,your installation successful.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;/span&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;FOLLOWING IS THE CONFIGURATION FILE &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;font-size:12;"  &gt;(Add to /etc/httpd/httpd.conf)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;b&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;ifmodule&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/ifmodule&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Turn the filtering engine On or Off&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;SecFilterEngine On&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Make sure that URL encoding is valid&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;SecFilterCheckURLEncoding On&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Only allow bytes from this range&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;SecFilterForceByteRange 32 126&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# The audit engine works independently and&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# can be turned On of Off on the per-server or&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# on the per-directory basis&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;SecAuditEngine RelevantOnly&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# The name of the audit log file&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;SecAuditLog /var/log/httpd/audit_log&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;SecFilterDebugLog /var/log/httpd/modsec_debug_log&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;SecFilterDebugLevel 0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Should mod_security inspect POST payloads&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;#SecFilterScanPOST On&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Action to take by default&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;SecFilterDefaultAction "deny,log,status:406"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Redirect user on filter match&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;#SecFilter xxx redirect:http://www.webkreator.com&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Execute the external script on filter match&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;#SecFilter yyy log,exec:/home/ivanr/apache/bin/report-attack.pl&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Simple filter&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;#SecFilter 111&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Only check the QUERY_STRING variable&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;#SecFilterSelective QUERY_STRING 222&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Only check the body of the POST request&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;#SecFilterSelective POST_PAYLOAD 333&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Only check arguments (will work for GET and POST)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;#SecFilterSelective ARGS 444&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Test filter&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;#SecFilter "/cgi-bin/keyword"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Another test filter, will be denied with 404 but not logged&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# action supplied as a parameter overrides the default action&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;#SecFilter 999 "deny,nolog,status:404"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Prevent OS specific keywords&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;#SecFilter /etc/password&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Prevent path traversal (..) attacks&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;SecFilter "\.\./"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Weaker XSS protection but allows common HTML tags&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;SecFilter "&lt;( |\n)*script"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Prevent XSS atacks (HTML/Javascript injection)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;SecFilter "&lt;(.|\n)+&gt;"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Very crude filters to prevent SQL injection attacks&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;SecFilter "delete[[:space:]]+from"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;SecFilter "insert[[:space:]]+into"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;SecFilter "select.+from"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Require HTTP_USER_AGENT and HTTP_HOST headers&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;SecFilterSelective "HTTP_USER_AGENT|HTTP_HOST" "^$"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Forbid file upload&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;#SecFilterSelective "HTTP_CONTENT_TYPE" multipart/form-data&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Only watch argument p1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;#SecFilterSelective "ARG_p1" 555&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Watch all arguments except p1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;#SecFilterSelective "ARGS|!ARG_p2" 666&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Only allow our own test utility to send requests (or Mozilla)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;#SecFilterSelective HTTP_USER_AGENT "!(mod_security|mozilla)"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Do not allow variables with this name&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt; &lt;span style=""&gt;   &lt;/span&gt;#SecFilterSelective ARGS_NAMES 777&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Do now allow this variable value (names are ok)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;#SecFilterSelective ARGS_VALUES 888&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# Stop spamming through FormMail&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# note the exclamation mark at the beginning&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# of the filter - only requests that match this regex will&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# be allowed&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;#&lt;location&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/location&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;        &lt;/span&gt;#SecFilterSelective "ARG_recipient" "!@webkreator.com$"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;#&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# when allowing upload, only allow images&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# note that this is not foolproof, a determined attacker&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;# could get around this &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;#&lt;location&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/location&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;        &lt;/span&gt;#SecFilterInheritance Off&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;        &lt;/span&gt;#SecFilterSelective POST_PAYLOAD "!image/(jpeg|bmp|gif)"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;span style=""&gt;    &lt;/span&gt;#&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=";font-family:&amp;quot;;" &gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Restart the Your Web server again&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;/etc/init.d/httpd restart.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6587524289582183832-7097674506404235348?l=bipinkdas.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://bipinkdas.blogspot.com/feeds/7097674506404235348/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6587524289582183832&amp;postID=7097674506404235348' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/7097674506404235348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6587524289582183832/posts/default/7097674506404235348'/><link rel='alternate' type='text/html' href='http://bipinkdas.blogspot.com/2007/03/modsecure-apache-194-howto.html' title='MOD_SECURE APACHE 1.9.4 – HOWTO'/><author><name>സമാധാനം</name><uri>http://www.blogger.com/profile/08749973752947029979</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='http://4.bp.blogspot.com/_3Lgl7ZQyPyk/SNoVx41sR7I/AAAAAAAAAFg/SkzPWT-GneE/S220/LonelyBoy.jpg'/></author><thr:total>0</thr:total></entry></feed>
