<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;D0AESHgycCp7ImA9WhRaFE8.&quot;"><id>tag:blogger.com,1999:blog-3005268194823480029</id><updated>2012-02-17T01:55:09.698+05:00</updated><category term="vmware crash" /><category term="startup script" /><category term="google+" /><category term="pam ldap" /><category term="mikrotik" /><category term="heartbeat failover ip failover service failover linux heartbeat" /><category term="disk size monitor" /><category term="linux open ldap" /><category term="mikrotik backup" /><category term="routeros" /><category term="diglinux" /><category term="vmware scripts" /><category term="mysql startup" /><category term="openldap authentication" /><category term="ldap" /><category term="linux ldap" /><category term="service console" /><category term="pam auth" /><category term="opensource" /><category term="mikrotik bash" /><category term="datasore" /><category term="mikrotik php" /><category term="disk size" /><category term="openldap pam auth" /><category term="vmware intro" /><category term="linux AD" /><category term="mysql daemon" /><category term="open ldap" /><category term="ldap auth" /><category term="linux authentication" /><category term="mikrotik bash scripts" /><category term="linux" /><category term="mikrotik router" /><category term="linux disk" /><category term="mikrotik ppp" /><category term="mikrotik user management" /><category term="vm recovery" /><category term="linux scripts" /><category term="mysql" /><category term="vmware" /><category term="mysql backup mysql db backup mysql disaster" /><category term="mysql script" /><category term="linux ldap auth" /><category term="directory server" /><category term="linux pam auth" /><category term="php user management" /><category term="openldap pam" /><category term="backups" /><category term="php hammer web-crawler php web-loaded php curl pcntl_fork web-spider php-spider" /><category term="openldap" /><category term="disk script" /><category term="ghettovcb" /><category term="bash script" /><category term="bash disk" /><category term="mikrotik script" /><category term="pam ldap auth" /><category term="bash scripts" /><category term="disk bash" /><category term="mysql service" /><category term="openvpn ubuntu vpn ovpn easy-rsa vpn certificate" /><category term="php mikrotik" /><category term="php ppp" /><category term="disk monitor" /><category term="pam authentication" /><category term="mikrotik email" /><category term="linux active directory" /><category term="mikrotik linux" /><title>Welcome to DigLinux, OpenSource Knowledge Platform</title><subtitle type="html">Here you will find OpenSource related tutorials and articles and tips which are handy for a Linux System Admin.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.diglinux.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://www.diglinux.com/" /><author><name>Mudasir Mirza</name><uri>http://www.blogger.com/profile/17219975193812064819</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/WelcomeToDiglinuxOpensourceKnowledgePlatform" /><feedburner:info uri="welcometodiglinuxopensourceknowledgeplatform" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;A0AMQ3kzeip7ImA9WhRSF0k.&quot;"><id>tag:blogger.com,1999:blog-3005268194823480029.post-7125074454231150398</id><published>2011-11-20T04:52:00.001+05:00</published><updated>2011-11-20T05:43:02.782+05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-20T05:43:02.782+05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="openldap authentication" /><category scheme="http://www.blogger.com/atom/ns#" term="pam ldap" /><category scheme="http://www.blogger.com/atom/ns#" term="pam auth" /><category scheme="http://www.blogger.com/atom/ns#" term="ldap auth" /><category scheme="http://www.blogger.com/atom/ns#" term="linux authentication" /><category scheme="http://www.blogger.com/atom/ns#" term="pam authentication" /><category scheme="http://www.blogger.com/atom/ns#" term="openldap" /><category scheme="http://www.blogger.com/atom/ns#" term="openldap pam" /><category scheme="http://www.blogger.com/atom/ns#" term="openldap pam auth" /><title>Configure OpenLDAP Client for PAM Authentication in Ubnutu</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/K2gr8cfkeYO0t6gasDn85SYsZNY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/K2gr8cfkeYO0t6gasDn85SYsZNY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/K2gr8cfkeYO0t6gasDn85SYsZNY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/K2gr8cfkeYO0t6gasDn85SYsZNY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
Previously in article &lt;a href="http://www.diglinux.com/2011/11/openldap-setup-on-ubunut-10042.html" target="_blank"&gt;OpenLDAP Setup&lt;/a&gt; I showed how to setup and configure basic OpenLDAP server with basic directory structure. By using that OpenLDAP structure we can implement centralized PAM Authentication. This is very useful when maintaining large amount of servers.&lt;br /&gt;
&lt;br /&gt;
To configure Ubuntu as OpenLDAP client for PAM Auth.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Basic Assumptions:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;We will be using&amp;nbsp;&lt;b&gt;root&lt;/b&gt;&amp;nbsp;account to install and configure OpenLDAP client for PAM Auth.&lt;/li&gt;
&lt;li&gt;We will be using&amp;nbsp;&lt;b&gt;"diglinux.com"&lt;/b&gt;&amp;nbsp;as our Domain, as previously setup in OpenLDAP Server.&lt;/li&gt;
&lt;li&gt;Admin user for managing OpenLDAP structure will be&amp;nbsp;&lt;b&gt;"Admin"&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Password for Admin user will be&amp;nbsp;&lt;b&gt;"diglinux"&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;OpenLDAP Server IP address is &lt;b&gt;192.168.1.1&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Internet is properly configured and working on the machine that we will be configuring OpenLDAP.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;b&gt;&lt;u&gt;&lt;i&gt;Installing OpenLDAP Client and Required Services&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;u&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;i&gt;root@diglinux.com:~#&amp;nbsp;&lt;/i&gt;&lt;/b&gt;apt-get install nss-updatedb libnss-ldap nscd libpam-ldap libpam-mkhomedir auth-client-config ldap-utils&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
All packaged play a different role in configuring OpenLDAP PAM Authentication. During installation of these packages, you will be asked some basic questions.&lt;/div&gt;
&lt;div&gt;
-----------------------------------------------------------------&lt;/div&gt;
&lt;div&gt;
1.&amp;nbsp;&amp;nbsp;LDAP server Uniform Resource Identifier:&lt;/div&gt;
&lt;div&gt;
-&amp;gt; &lt;i&gt;ldap://192.168.1.1&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
2.&amp;nbsp;Distinguished name of the search base:&lt;/div&gt;
&lt;div&gt;
-&amp;gt; &lt;i&gt;dc=diglinux,dc=com&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
3.&amp;nbsp;&amp;nbsp;LDAP version to use:&lt;/div&gt;
&lt;div&gt;
-&amp;gt; &lt;i&gt;Version 3&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
4.&amp;nbsp;&amp;nbsp;Make local root Database admin:&lt;/div&gt;
&lt;div&gt;
-&amp;gt; &lt;i&gt;Yes&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
5.&amp;nbsp;Does the LDAP database require login?&lt;/div&gt;
&lt;div&gt;
-&amp;gt; &lt;i&gt;Yes&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
6.&amp;nbsp;&amp;nbsp;LDAP account for root:&lt;/div&gt;
&lt;div&gt;
-&amp;gt;&amp;nbsp;&lt;i&gt;cn=Admin,dc=diglinux,dc=com&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
7.&amp;nbsp;&amp;nbsp;LDAP root account password:&lt;/div&gt;
&lt;div&gt;
-&amp;gt; &lt;i&gt;diglinux&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
8.&amp;nbsp;Unprivileged database user:&lt;/div&gt;
&lt;div&gt;
-&amp;gt;&amp;nbsp;&lt;i&gt;cn=Admin,dc=diglinux,dc=com&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
9.&amp;nbsp;Password for database login account:&lt;/div&gt;
&lt;div&gt;
-&amp;gt; &lt;i&gt;diglinux&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
-----------------------------------------------------------------&lt;/div&gt;
&lt;div&gt;
Remember to change the settings as per the settings of your server, these settings we implemented on our OpenLDAP setup guide.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Once above settings are done you will need to edit file "/etc/ldap.conf"&lt;/div&gt;
&lt;div&gt;
Find&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;#bind_policy hard&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
and &amp;nbsp;replace it with&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;bind_policy soft&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Un-comment parameter&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;pam_password crypt&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
Save and exit this file.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now execute this command, this command will add "LDAP" in&amp;nbsp;/etc/nsswitch.conf , which tells where to look for credentials first.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;root@diglinux.com:~#&amp;nbsp;&lt;/b&gt;&lt;/i&gt;auth-client-config -t nss -p lac_ldap&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now we need to update the PAM Auth DB. For this execute this command&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;root@diglinux.com:~#&amp;nbsp;&lt;/b&gt;&lt;/i&gt;pam-auth-update&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Make sure you select "LDAP Authentication".&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Final step is to restart some services.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;root@diglinux.com:~#&amp;nbsp;&lt;/b&gt;&lt;/i&gt;/etc/init.d/libnss-ldap restart &amp;amp;&amp;amp; /etc/init.d/nscd restart&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
If everything goes without error, then you can authenticate PAM using OpenLDAP. To verify, create a user in OpenLDAP. Once user is created, issue below command to verify whether that user has been picked up by Linux or not&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b style="font-style: italic;"&gt;root@diglinux.com:~#&lt;/b&gt;&amp;nbsp;&amp;nbsp;getent passwd&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
This will show you a list of users present in system.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Till here you have a working OpenLDAP PAM Authentication. However an issue that can come is that user will not have their own home directory which is defined in OpenLDAP. PAM does provide a plugin that can dynamically create user home directory if not found.&lt;/div&gt;
&lt;div&gt;
We previously did the installation of this plugin, we only need to configure it. And it is very easy to configure.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
For this we will need to create a plain text file "/usr/share/pam-configs/my_mkhomedir". Copy and Paste below lines in this file and then save and exit&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
#------------------------------------&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Name: activate mkhomedir&lt;/div&gt;
&lt;div&gt;
Default: yes&lt;/div&gt;
&lt;div&gt;
Priority: 900&lt;/div&gt;
&lt;div&gt;
Session-Type: Additional&lt;/div&gt;
&lt;div&gt;
Session:&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; required &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;pam_mkhomedir.so umask=0022 skel=/etc/skel&lt;/div&gt;
&lt;div&gt;
#------------------------------------&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
Do not copy the "----" lines. Once done now we have to update PAM. This will be done using below command.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;b&gt;root@diglinux.com:~#&amp;nbsp;&lt;/b&gt;&lt;/i&gt;pam-auth-update&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Here you will now see "activate mkhomedir", make sure this is checked.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
If everything goes without errors, you will have a 100% working OpenLDAP PAM Authentication.&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/3005268194823480029-7125074454231150398?l=www.diglinux.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~4/-yqENs46UZw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.diglinux.com/feeds/7125074454231150398/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.diglinux.com/2011/11/configure-openldap-client-for-pam.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/7125074454231150398?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/7125074454231150398?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~3/-yqENs46UZw/configure-openldap-client-for-pam.html" title="Configure OpenLDAP Client for PAM Authentication in Ubnutu" /><author><name>Mudasir Mirza</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="22" height="32" src="http://1.bp.blogspot.com/-OIdZxzRxr18/TiCjus8skeI/AAAAAAAAAG8/jjPpjboBsxU/s220/RHCE.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.diglinux.com/2011/11/configure-openldap-client-for-pam.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkUMQn4_eSp7ImA9WhRTF04.&quot;"><id>tag:blogger.com,1999:blog-3005268194823480029.post-1456240900112786317</id><published>2011-11-08T11:35:00.001+05:00</published><updated>2011-11-08T11:38:03.041+05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-08T11:38:03.041+05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="google+" /><category scheme="http://www.blogger.com/atom/ns#" term="diglinux" /><category scheme="http://www.blogger.com/atom/ns#" term="opensource" /><title>DigLinux on G+</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/REY7XCm0joLxwd7NvBQUa_s_M3Y/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/REY7XCm0joLxwd7NvBQUa_s_M3Y/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/REY7XCm0joLxwd7NvBQUa_s_M3Y/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/REY7XCm0joLxwd7NvBQUa_s_M3Y/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;link href="https://plus.google.com/115020611882158841381/" rel="publisher"&gt;&lt;/link&gt;


&lt;a href="https://plus.google.com/115020611882158841381/?prsrc=3" style="color: #333333; text-decoration: none;"&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div style="display: inline-block;"&gt;
&lt;a href="https://plus.google.com/115020611882158841381/?prsrc=3" style="color: #333333; text-decoration: none;"&gt;&lt;span style="float: left; font: normal normal bold 13px/16px arial, sans-serif; margin-right: 4px; margin-top: 7px;"&gt;DigLinux on G+&lt;/span&gt;&lt;span style="float: left; font: normal normal normal 13px/16px arial, sans-serif; margin-right: 11px; margin-top: 7px;"&gt;on&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div style="float: left;"&gt;
&lt;a href="https://plus.google.com/115020611882158841381/?prsrc=3" style="color: #333333; text-decoration: none;"&gt;&lt;img height="32" src="https://ssl.gstatic.com/images/icons/gplus-32.png" style="border: 0;" width="32" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="clear: both;"&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
DigLinux has officially launched its Google+ Page, DigLinux will now regularly be updated. And we hope to bring on more authors to this platform.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3005268194823480029-1456240900112786317?l=www.diglinux.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~4/UAQQXgf_Tpg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.diglinux.com/feeds/1456240900112786317/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.diglinux.com/2011/11/diglinux-on-g.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/1456240900112786317?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/1456240900112786317?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~3/UAQQXgf_Tpg/diglinux-on-g.html" title="DigLinux on G+" /><author><name>Mudasir Mirza</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="22" height="32" src="http://1.bp.blogspot.com/-OIdZxzRxr18/TiCjus8skeI/AAAAAAAAAG8/jjPpjboBsxU/s220/RHCE.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.diglinux.com/2011/11/diglinux-on-g.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0cER3c6fyp7ImA9WhRSFks.&quot;"><id>tag:blogger.com,1999:blog-3005268194823480029.post-7102478341516900162</id><published>2011-11-03T09:55:00.000+05:00</published><updated>2011-11-19T05:03:26.917+05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-19T05:03:26.917+05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="linux ldap auth" /><category scheme="http://www.blogger.com/atom/ns#" term="linux ldap" /><category scheme="http://www.blogger.com/atom/ns#" term="open ldap" /><category scheme="http://www.blogger.com/atom/ns#" term="pam ldap auth" /><category scheme="http://www.blogger.com/atom/ns#" term="linux active directory" /><category scheme="http://www.blogger.com/atom/ns#" term="linux pam auth" /><category scheme="http://www.blogger.com/atom/ns#" term="linux open ldap" /><category scheme="http://www.blogger.com/atom/ns#" term="linux AD" /><category scheme="http://www.blogger.com/atom/ns#" term="directory server" /><category scheme="http://www.blogger.com/atom/ns#" term="diglinux" /><category scheme="http://www.blogger.com/atom/ns#" term="linux" /><category scheme="http://www.blogger.com/atom/ns#" term="openldap" /><category scheme="http://www.blogger.com/atom/ns#" term="ldap" /><title>OpenLDAP Setup on Ubunut 10.04.2</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/M7zvBHcAOXihgIIToY1XmDWzOT0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/M7zvBHcAOXihgIIToY1XmDWzOT0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/M7zvBHcAOXihgIIToY1XmDWzOT0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/M7zvBHcAOXihgIIToY1XmDWzOT0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
In this article I will be covering how to install and configure basic OpenLDAP. Many people have asked me regarding this and yes there are many tutorials available on internet. No one is bound to use or follow this article.&lt;br /&gt;
&lt;br /&gt;
I have tried to make things as easy as possible in covering all aspects of this subject.&lt;br /&gt;
&lt;br /&gt;
Lets Start...&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Basic Assumptions:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style="text-align: left;"&gt;
&lt;/div&gt;
&lt;ol style="text-align: left;"&gt;
&lt;li&gt;We will be using freshly installed Ubuntu Server 10.04.2 LTS.&lt;/li&gt;
&lt;li&gt;We will be using &lt;b&gt;root&lt;/b&gt; account to install and configure OpenLDAP and related services.&lt;/li&gt;
&lt;li&gt;We will be using &lt;b&gt;"diglinux.com"&lt;/b&gt; as our Domain.&lt;/li&gt;
&lt;li&gt;Admin user for managing OpenLDAP structure will be &lt;b&gt;"Admin"&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Password for Admin user will be &lt;b&gt;"diglinux"&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;Internet is properly configured and working on the machine that we will be configuring OpenLDAP.&lt;/li&gt;
&lt;/ol&gt;
&lt;b&gt;&lt;u&gt;&lt;i&gt;Step1: Installing OpenLDAP&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style="text-align: left;"&gt;
&lt;br /&gt;
root@diglinux.com:~# apt-get update&lt;/div&gt;
&lt;div style="text-align: left;"&gt;
root@diglinux.com:~# apt-get install slapd ldap-utils&lt;br /&gt;
&lt;br /&gt;
Package "slapd" is used to install OpenLDAP on&amp;nbsp;Ubuntu&amp;nbsp;and package "ldap-utils" installs some useful scripts to play around with LDAP without restarting LDAP server.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;i&gt;Step2: Importing Basic LDAP Schema&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
root@diglinux.com:~#&amp;nbsp;ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/cosine.ldif&lt;br /&gt;
root@diglinux.com:~#&amp;nbsp;ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/inetorgperson.ldif&lt;br /&gt;
root@diglinux.com:~#&amp;nbsp;ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/nis.ldif&lt;br /&gt;
root@diglinux.com:~#&amp;nbsp;ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/misc.ldif&lt;br /&gt;
&lt;br /&gt;
By default OpenLDAP comes with some basic predefined data types, by importing these schemas we add more data types are more often used.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;i&gt;Step3: Creating Basic Backend OpenLDAP Structure&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Here we will be creating the basic back-end structure for out OpenLDAP Server.&lt;br /&gt;
First we will create a file, you can name it what ever you want, here I will name it as "diglinux.backend.ldif"&lt;br /&gt;
&lt;br /&gt;
root@diglinux.com:~# vim diglinux.backend.ldif&lt;br /&gt;
&lt;br /&gt;
Now copy and paste below lines in this file. Make sure that you replace "diglinux" with your domain and password with the password that you want to set.&lt;br /&gt;
--------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
# Load dynamic backend modules&lt;br /&gt;
dn: cn=module{0},cn=config&lt;br /&gt;
objectClass: olcModuleList&lt;br /&gt;
cn: module{0}&lt;br /&gt;
olcModulePath: /usr/lib/ldap&lt;br /&gt;
olcModuleLoad: {0}back_hdb&lt;br /&gt;
&lt;br /&gt;
# Create directory database&lt;br /&gt;
dn: olcDatabase={1}hdb,cn=config&lt;br /&gt;
objectClass: olcDatabaseConfig&lt;br /&gt;
objectClass: olcHdbConfig&lt;br /&gt;
olcDatabase: {1}hdb&lt;br /&gt;
olcDbDirectory: /var/lib/ldap&lt;br /&gt;
olcSuffix: dc=diglinux,dc=com&lt;br /&gt;
olcRootDN: cn=Admin,dc=diglinux,dc=com&lt;br /&gt;
olcRootPW: diglinux&lt;br /&gt;
olcAccess: {0}to attrs=userPassword,shadowLastChange by dn="cn=Admin,dc=diglinux,dc=com" write by anonymous auth by self write by * none&lt;br /&gt;
olcAccess: {1}to dn.base="" by * read&lt;br /&gt;
olcAccess: {2}to * by dn="cn=Admin,dc=diglinux,dc=com" write by * read&lt;br /&gt;
olcLastMod: TRUE&lt;br /&gt;
olcDbCheckpoint: 512 30&lt;br /&gt;
olcDbConfig: {0}set_cachesize 0 2097152 0&lt;br /&gt;
olcDbConfig: {1}set_lk_max_objects 1500&lt;br /&gt;
olcDbConfig: {2}set_lk_max_locks 1500&lt;br /&gt;
olcDbConfig: {3}set_lk_max_lockers 1500&lt;br /&gt;
olcDbIndex: uid pres,eq&lt;br /&gt;
olcDbIndex: cn,sn,mail pres,eq,approx,sub&lt;br /&gt;
olcDbIndex: objectClass eq&lt;br /&gt;
################################&lt;br /&gt;
# Modifications&lt;br /&gt;
################################&lt;br /&gt;
&lt;br /&gt;
dn: cn=config&lt;br /&gt;
changetype: modify&lt;br /&gt;
&lt;br /&gt;
dn: olcDatabase={-1}frontend,cn=config&lt;br /&gt;
changetype: modify&lt;br /&gt;
delete: olcAccess&lt;br /&gt;
&lt;br /&gt;
dn: olcDatabase={0}config,cn=config&lt;br /&gt;
changetype: modify&lt;br /&gt;
add: olcRootDN&lt;br /&gt;
olcRootDN: cn=Admin,cn=config&lt;br /&gt;
&lt;br /&gt;
dn: olcDatabase={0}config,cn=config&lt;br /&gt;
changetype: modify&lt;br /&gt;
add: olcRootPW&lt;br /&gt;
olcRootPW: diglinux&lt;br /&gt;
&lt;br /&gt;
dn: olcDatabase={0}config,cn=config&lt;br /&gt;
changetype: modify&lt;br /&gt;
delete: olcAccess&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
--------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Once this file is created, you will need to import this in LDAP to create basic structure and add LDAP Admin User.&lt;br /&gt;
&lt;br /&gt;
root@diglinux.com:~# ldapadd -Y EXTERNAL -H ldapi:/// -f &amp;nbsp;diglinux.backend.ldif&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;i&gt;Step4: Creating Basic OU Structure&lt;/i&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Here we will be creating two basic OU's. This is pretty much like default in OpenLDAP, almost all tutorials on internet plays around with the same OU's.&lt;br /&gt;
You can change them as per your needs, but remember whatever you create here, you should have a good idea what you are doing.&lt;br /&gt;
&lt;br /&gt;
We will create a file, you can name it what ever you want, here I will name it as "diglinux.ou.ldif"&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now copy and paste below lines in this file. Make sure that you replace "diglinux" with your domain and password with the password that you want to set.&lt;br /&gt;
--------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
# Tree root&lt;/div&gt;
&lt;div&gt;
dn: dc=diglinux,dc=com&lt;/div&gt;
&lt;div&gt;
objectClass: dcObject&lt;/div&gt;
&lt;div&gt;
objectclass: organization&lt;/div&gt;
&lt;div&gt;
o: diglinux&lt;/div&gt;
&lt;div&gt;
dc: diglinux&lt;/div&gt;
&lt;div&gt;
description: Tree root&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
# Creating Admin User&lt;/div&gt;
&lt;div&gt;
dn: cn=Admin,dc=diglinux,dc=com&lt;/div&gt;
&lt;div&gt;
objectClass: simpleSecurityObject&lt;/div&gt;
&lt;div&gt;
objectClass: organizationalRole&lt;/div&gt;
&lt;div&gt;
cn: admin&lt;/div&gt;
&lt;div&gt;
userPassword: diglinux&lt;/div&gt;
&lt;div&gt;
description: LDAP administrator&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
# Creating an OU named "people"&lt;/div&gt;
&lt;div&gt;
dn: ou=people,dc=diglinux,dc=com&lt;/div&gt;
&lt;div&gt;
ou: people&lt;/div&gt;
&lt;div&gt;
objectClass: organizationalUnit&lt;/div&gt;
&lt;div&gt;
objectClass: top&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
# Creating an OU named "groups"&lt;/div&gt;
&lt;div&gt;
dn: ou=groups,dc=diglinux,dc=com&lt;/div&gt;
&lt;div&gt;
ou: groups&lt;/div&gt;
&lt;div&gt;
objectClass: organizationalUnit&lt;/div&gt;
&lt;div&gt;
objectClass: top&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
#Adding a test user name "diglinux"&lt;/div&gt;
&lt;div&gt;
dn: uid=diglinux,ou=people,dc=diglinux,dc=com&lt;/div&gt;
&lt;div&gt;
objectClass: inetOrgPerson&lt;/div&gt;
&lt;div&gt;
objectClass: posixAccount&lt;/div&gt;
&lt;div&gt;
objectClass: shadowAccount&lt;/div&gt;
&lt;div&gt;
uid: diglinux&lt;/div&gt;
&lt;div&gt;
sn: com&lt;/div&gt;
&lt;div&gt;
givenName: DigLinux&lt;/div&gt;
&lt;div&gt;
cn: DigLinux&lt;/div&gt;
&lt;div&gt;
displayName: DigLinux&lt;/div&gt;
&lt;div&gt;
uidNumber: 1002&lt;/div&gt;
&lt;div&gt;
gidNumber: 1000&lt;/div&gt;
&lt;div&gt;
userPassword: diglinux&lt;/div&gt;
&lt;div&gt;
gecos: DigLinux&lt;/div&gt;
&lt;div&gt;
loginShell: /bin/bash&lt;/div&gt;
&lt;div&gt;
homeDirectory: /home/diglinux&lt;/div&gt;
&lt;div&gt;
shadowExpire: -1&lt;/div&gt;
&lt;div&gt;
shadowFlag: 0&lt;/div&gt;
&lt;div&gt;
shadowWarning: 7&lt;/div&gt;
&lt;div&gt;
shadowMin: 8&lt;/div&gt;
&lt;div&gt;
shadowMax: 999999&lt;/div&gt;
&lt;div&gt;
shadowLastChange: 10877&lt;/div&gt;
&lt;div&gt;
mail: info@diglinux.com&lt;/div&gt;
&lt;div&gt;
postalCode: 31000&lt;/div&gt;
&lt;div&gt;
l: Karachi&lt;/div&gt;
&lt;div&gt;
o: diglinux&lt;/div&gt;
&lt;div&gt;
mobile: +92 123 1234567&lt;/div&gt;
&lt;div&gt;
homePhone: +92 123 1234567&lt;/div&gt;
&lt;div&gt;
title: System Administrator&lt;/div&gt;
&lt;div&gt;
postalAddress:&lt;/div&gt;
&lt;div&gt;
initials: DL&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
--------------------------------------------------------------------------------------------------&lt;/div&gt;
&lt;div&gt;
Make sure that you make required changes in this file. Once all changes are done, save and exit.&lt;/div&gt;
&lt;div&gt;
Now its time to import these settings.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
root@diglinux.com:~#&amp;nbsp;ldapadd -x -D "cn=Admin,dc=diglinux,dc=com" -W -f &amp;nbsp;diglinux.backend.ldif&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Once you execute this command, this will ask for a password. And in our backend file we set the password as "diglinux", if you have changed the password, you will need to enter the same password here.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now if everything goes fine and without any errors, you should have a running OpenLDAP server with basic structure.&lt;/div&gt;
&lt;div&gt;
You can verify this by using JXplorer a free windows based utility for managing OpenLDAP. This application can be downloaded from&amp;nbsp;&lt;a href="http://www.jxplorer.org/"&gt;http://www.jxplorer.org/&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Below is the snapshot of JXplorer connection settings to connect to LDAP server.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-sS17N2BUPnw/Tsbxdog0gCI/AAAAAAAAAOI/7lkoGrhtUYI/s1600/JXplorer-1.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="441" src="http://3.bp.blogspot.com/-sS17N2BUPnw/Tsbxdog0gCI/AAAAAAAAAOI/7lkoGrhtUYI/s640/JXplorer-1.jpg" width="640" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;JXplorer Connection Settings&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&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/3005268194823480029-7102478341516900162?l=www.diglinux.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~4/TxwT-shWFG8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.diglinux.com/feeds/7102478341516900162/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.diglinux.com/2011/11/openldap-setup-on-ubunut-10042.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/7102478341516900162?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/7102478341516900162?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~3/TxwT-shWFG8/openldap-setup-on-ubunut-10042.html" title="OpenLDAP Setup on Ubunut 10.04.2" /><author><name>Mudasir Mirza</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="22" height="32" src="http://1.bp.blogspot.com/-OIdZxzRxr18/TiCjus8skeI/AAAAAAAAAG8/jjPpjboBsxU/s220/RHCE.JPG" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-sS17N2BUPnw/Tsbxdog0gCI/AAAAAAAAAOI/7lkoGrhtUYI/s72-c/JXplorer-1.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.diglinux.com/2011/11/openldap-setup-on-ubunut-10042.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0IBRX0yfyp7ImA9WhdWGE4.&quot;"><id>tag:blogger.com,1999:blog-3005268194823480029.post-7314024561552506574</id><published>2011-09-12T18:52:00.000+05:00</published><updated>2011-09-12T18:52:34.397+05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-12T18:52:34.397+05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="php user management" /><category scheme="http://www.blogger.com/atom/ns#" term="php ppp" /><category scheme="http://www.blogger.com/atom/ns#" term="mikrotik php" /><category scheme="http://www.blogger.com/atom/ns#" term="mikrotik ppp" /><category scheme="http://www.blogger.com/atom/ns#" term="php mikrotik" /><category scheme="http://www.blogger.com/atom/ns#" term="mikrotik user management" /><title>Mikrotik PHP PPP User Management System</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/y6bDJrnohPRjUVag5LX4igBbrSk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/y6bDJrnohPRjUVag5LX4igBbrSk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/y6bDJrnohPRjUVag5LX4igBbrSk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/y6bDJrnohPRjUVag5LX4igBbrSk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
I have uploaded a simple PHP based Mikrotik PPP User Management System.&lt;br /&gt;
&lt;br /&gt;
Please visit&amp;nbsp;&lt;a href="http://wiki.mikrotik.com/wiki/Basic_php_ppp_scripts"&gt;http://wiki.mikrotik.com/wiki/Basic_php_ppp_scripts&lt;/a&gt;&amp;nbsp;for complete instructions.&lt;br /&gt;
&lt;br /&gt;
You can request for more features.&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/3005268194823480029-7314024561552506574?l=www.diglinux.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~4/g1XtKb-avk0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.diglinux.com/feeds/7314024561552506574/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.diglinux.com/2011/09/mikrotik-php-ppp-user-management-system.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/7314024561552506574?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/7314024561552506574?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~3/g1XtKb-avk0/mikrotik-php-ppp-user-management-system.html" title="Mikrotik PHP PPP User Management System" /><author><name>Mudasir Mirza</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="22" height="32" src="http://1.bp.blogspot.com/-OIdZxzRxr18/TiCjus8skeI/AAAAAAAAAG8/jjPpjboBsxU/s220/RHCE.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.diglinux.com/2011/09/mikrotik-php-ppp-user-management-system.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UBRnc-fyp7ImA9WhdWF00.&quot;"><id>tag:blogger.com,1999:blog-3005268194823480029.post-3079858104599843523</id><published>2011-09-11T07:47:00.001+05:00</published><updated>2011-09-11T07:47:37.957+05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-11T07:47:37.957+05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="mikrotik bash" /><category scheme="http://www.blogger.com/atom/ns#" term="mikrotik script" /><category scheme="http://www.blogger.com/atom/ns#" term="linux scripts" /><category scheme="http://www.blogger.com/atom/ns#" term="mikrotik linux" /><category scheme="http://www.blogger.com/atom/ns#" term="mikrotik bash scripts" /><category scheme="http://www.blogger.com/atom/ns#" term="bash scripts" /><title>Mikrotik Bash Script</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/r6dexWRAw5TUvldeb6QDEDKnK1Q/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/r6dexWRAw5TUvldeb6QDEDKnK1Q/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/r6dexWRAw5TUvldeb6QDEDKnK1Q/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/r6dexWRAw5TUvldeb6QDEDKnK1Q/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
I have created a Wiki article on Mikrotik site and thought that I should share it with you all. Please follow the link below to view the article.&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a href="http://wiki.mikrotik.com/wiki/Useful_Bash_Scripts"&gt;http://wiki.mikrotik.com/wiki/Useful_Bash_Scripts&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Please feel free to provide your important feedback&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/3005268194823480029-3079858104599843523?l=www.diglinux.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~4/K-mB-urWWW0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.diglinux.com/feeds/3079858104599843523/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.diglinux.com/2011/09/mikrotik-bash-script.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/3079858104599843523?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/3079858104599843523?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~3/K-mB-urWWW0/mikrotik-bash-script.html" title="Mikrotik Bash Script" /><author><name>Mudasir Mirza</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="22" height="32" src="http://1.bp.blogspot.com/-OIdZxzRxr18/TiCjus8skeI/AAAAAAAAAG8/jjPpjboBsxU/s220/RHCE.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.diglinux.com/2011/09/mikrotik-bash-script.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUQGQ3g9fSp7ImA9WhdWFUs.&quot;"><id>tag:blogger.com,1999:blog-3005268194823480029.post-7917862995782655749</id><published>2011-09-09T16:16:00.000+05:00</published><updated>2011-09-09T16:22:02.665+05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-09T16:22:02.665+05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="mysql script" /><category scheme="http://www.blogger.com/atom/ns#" term="startup script" /><category scheme="http://www.blogger.com/atom/ns#" term="mysql startup" /><category scheme="http://www.blogger.com/atom/ns#" term="mysql daemon" /><category scheme="http://www.blogger.com/atom/ns#" term="mysql" /><category scheme="http://www.blogger.com/atom/ns#" term="mysql service" /><title>MySQL Startup Script</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Cs2fHp3Ia3XYt8ICsre-Eo4sNrw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Cs2fHp3Ia3XYt8ICsre-Eo4sNrw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Cs2fHp3Ia3XYt8ICsre-Eo4sNrw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Cs2fHp3Ia3XYt8ICsre-Eo4sNrw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
This is a MySQL start up script. I created this script when I faced issues in Ubuntu 10.04 LTS MySQL start up script.&lt;br /&gt;
&lt;div&gt;
This is a very handy small script which can be used not only for MySQL but for almost all services.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;#! /bin/bash&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;JOB=/usr/sbin/mysqld&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;case $1 in&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp; start)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; $JOB &amp;amp;&amp;gt; /dev/null &amp;amp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; ps aux | grep mysqld | grep -v grep | awk '{print $2}' &amp;gt; /tmp/mysqld.pid&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; ;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp; stop)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; kill -9 $(cat /tmp/mysqld.pid)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; rm -f /tmp/mysqld.pid&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; ;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp; restart)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; stop&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; start&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; ;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp; *)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; echo Oops! bad options&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&amp;nbsp; &amp;nbsp; ;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;esac&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;exit 0&lt;/span&gt;&lt;/div&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/3005268194823480029-7917862995782655749?l=www.diglinux.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~4/eUIfxa9kn8I" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.diglinux.com/feeds/7917862995782655749/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.diglinux.com/2011/09/mysql-startup-script.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/7917862995782655749?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/7917862995782655749?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~3/eUIfxa9kn8I/mysql-startup-script.html" title="MySQL Startup Script" /><author><name>Mudasir Mirza</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="22" height="32" src="http://1.bp.blogspot.com/-OIdZxzRxr18/TiCjus8skeI/AAAAAAAAAG8/jjPpjboBsxU/s220/RHCE.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.diglinux.com/2011/09/mysql-startup-script.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4GQH0_cCp7ImA9WhdWE0g.&quot;"><id>tag:blogger.com,1999:blog-3005268194823480029.post-6590283344997726297</id><published>2011-09-07T04:44:00.000+05:00</published><updated>2011-09-07T04:48:41.348+05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-09-07T04:48:41.348+05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="mikrotik" /><category scheme="http://www.blogger.com/atom/ns#" term="routeros" /><category scheme="http://www.blogger.com/atom/ns#" term="mikrotik email" /><category scheme="http://www.blogger.com/atom/ns#" term="mikrotik router" /><category scheme="http://www.blogger.com/atom/ns#" term="backups" /><category scheme="http://www.blogger.com/atom/ns#" term="mikrotik backup" /><title>Mikrotik script to create and email backup</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XJ361eoYadsMNlZf-bjd3lHKEUU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XJ361eoYadsMNlZf-bjd3lHKEUU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XJ361eoYadsMNlZf-bjd3lHKEUU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XJ361eoYadsMNlZf-bjd3lHKEUU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
A small script I created after going through many scripts available at the &lt;a href="http://wiki.mikrotik.com/"&gt;Mikrotik wiki&lt;/a&gt;. This is a simple script that creates a backup file of the Mikrotik RouterOS and emails the file to any email address specified in the script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;:global file ([/system identity get name] . [:pick [/system clock get date ] 7 11] . [:pick [/system clock get date ] 0 3] . [:pick [/system clock get date ] 4 6] . ".backup")&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;/system backup save name=$file&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;/tool e-mail set server=smtp.example.com&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;/tool e-mail set from="backup@example.com"&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;b&gt;/tool e-mail send to="reports@example.com" subject="Mikrotik RouterOS Firewall Backup" body="Attached is the backup file of Mikrotik RouterOS" file=$file&lt;/b&gt;&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/3005268194823480029-6590283344997726297?l=www.diglinux.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~4/sp2t-wGnGcg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.diglinux.com/feeds/6590283344997726297/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.diglinux.com/2011/09/mikrotik-script-to-create-and-email.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/6590283344997726297?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/6590283344997726297?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~3/sp2t-wGnGcg/mikrotik-script-to-create-and-email.html" title="Mikrotik script to create and email backup" /><author><name>Mudasir Mirza</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="22" height="32" src="http://1.bp.blogspot.com/-OIdZxzRxr18/TiCjus8skeI/AAAAAAAAAG8/jjPpjboBsxU/s220/RHCE.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.diglinux.com/2011/09/mikrotik-script-to-create-and-email.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUYMQX0ycCp7ImA9WhRTF04.&quot;"><id>tag:blogger.com,1999:blog-3005268194823480029.post-2782759662586477744</id><published>2011-09-07T04:27:00.000+05:00</published><updated>2011-11-08T11:19:40.398+05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-08T11:19:40.398+05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="disk bash" /><category scheme="http://www.blogger.com/atom/ns#" term="disk size" /><category scheme="http://www.blogger.com/atom/ns#" term="disk monitor" /><category scheme="http://www.blogger.com/atom/ns#" term="disk size monitor" /><category scheme="http://www.blogger.com/atom/ns#" term="bash script" /><category scheme="http://www.blogger.com/atom/ns#" term="linux disk" /><category scheme="http://www.blogger.com/atom/ns#" term="bash disk" /><category scheme="http://www.blogger.com/atom/ns#" term="disk script" /><title>A very useful Disk Size Monitoring script</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/q9uoW2EGdab3zTI1VNZ79El23_I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/q9uoW2EGdab3zTI1VNZ79El23_I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/q9uoW2EGdab3zTI1VNZ79El23_I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/q9uoW2EGdab3zTI1VNZ79El23_I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
This is a very useful and small script that I created quiet some time back when I was creating custom monitoring plugins for one my my clients.&lt;br /&gt;
Still I use this script to perform Disk Size Monitoring at many places that I am monitoring.&lt;br /&gt;
&lt;br /&gt;
For this script to work properly, a small linux command line utility known as "mutt" needs to be installed. It is a very handy command line e-mail client. Normally this comes by default with linux, but just in case this is not present, simply use the native package manager (yum for redhat/centos/fedora and apt-get for debian/ubuntu) to install this utility.&lt;br /&gt;
&lt;br /&gt;
Now for the script. It is a bit messed up.&lt;br /&gt;
&lt;br /&gt;
[root@crystalnetworks.org home]# cat disksize.sh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;#!/bin/bash&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;#&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# Author : Mudasir Mirza&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;#Un-comment the following line to run the script in debug mode&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;#set -x&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# Absolute path to CSV file that will be generated by script&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;OUTPUT="/tmp/size.csv"&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;rm -f $OUTPUT&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;NUM_COL=`df -h | head -n1 | awk '{ print NF }'`&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;for (( i=1; i&amp;lt;=$NUM_COL; i++ ))&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;do&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;COM[$i]=`df -h | head -n1 | awk -v "awkvar=$i" '{print $awkvar}'`&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;done&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;FLD=`echo ${COM[@]} | sed 's/\ /,/g'`&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;echo $FLD &amp;gt; $OUTPUT&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;P=`df -h | tail -n+2 | wc -l`&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;for (( i=1; i&amp;lt;=$P; i++ ))&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;do&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CMD=`df -h | tail -n+2 | sed "${i}!d"`&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;CMDA=`echo $CMD | sed 's/\ /,/g'`&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;echo $CMDA &amp;gt;&amp;gt; $OUTPUT&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;done&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;echo | mutt -a $OUTPUT -s "Daily Disk Size Email" monitoring@example.com&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;###########################################################&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;# End of Scirpt&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3005268194823480029-2782759662586477744?l=www.diglinux.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~4/wCmOmcBio1Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.diglinux.com/feeds/2782759662586477744/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.diglinux.com/2011/09/very-useful-dist-size-monitoring-script.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/2782759662586477744?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/2782759662586477744?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~3/wCmOmcBio1Y/very-useful-dist-size-monitoring-script.html" title="A very useful Disk Size Monitoring script" /><author><name>Mudasir Mirza</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="22" height="32" src="http://1.bp.blogspot.com/-OIdZxzRxr18/TiCjus8skeI/AAAAAAAAAG8/jjPpjboBsxU/s220/RHCE.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.diglinux.com/2011/09/very-useful-dist-size-monitoring-script.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0ECSH4-cCp7ImA9WhdXF0k.&quot;"><id>tag:blogger.com,1999:blog-3005268194823480029.post-5520740012767579304</id><published>2011-08-31T05:06:00.000+05:00</published><updated>2011-08-31T05:14:29.058+05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-31T05:14:29.058+05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="datasore" /><category scheme="http://www.blogger.com/atom/ns#" term="vmware crash" /><category scheme="http://www.blogger.com/atom/ns#" term="ghettovcb" /><category scheme="http://www.blogger.com/atom/ns#" term="vm recovery" /><category scheme="http://www.blogger.com/atom/ns#" term="vmware intro" /><category scheme="http://www.blogger.com/atom/ns#" term="vmware" /><category scheme="http://www.blogger.com/atom/ns#" term="vmware scripts" /><category scheme="http://www.blogger.com/atom/ns#" term="service console" /><title>Brief VMware Intro</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/wb_4tKllzW2HkwXrWj1SG7_9CWU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wb_4tKllzW2HkwXrWj1SG7_9CWU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/wb_4tKllzW2HkwXrWj1SG7_9CWU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wb_4tKllzW2HkwXrWj1SG7_9CWU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;For last 4 to 5 years I have worked on VMware Virtualization Platform and Linux based Virtual Hosts. In my very short experience, I found out some very important things that can help any System Admin who is managing VMware Infrastructure. I have also written some Perl and Bash based scripts to automate some the tasks that help me out in managing backups of VMs and keep an eye on some of the very important aspects.&lt;br /&gt;
&lt;br /&gt;
Here I will share those scripts and those aspects with you all, and hope that anyone who faces the same situation can easily resolve it.&lt;br /&gt;
&lt;br /&gt;
The main aspects are listed below, more to come very soon.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Disaster Recovery and Backups&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
When I started work on VMware, the main thing or concern of my client and employer was the backups of Virtual Machines and Data that is being saved on those virtual machines.&lt;br /&gt;
I will very soon be sharing a complete method of how to make this a very easy task to manage and be on top of everything. I have written few custom scripts to verify everything, and using the ALL TIME FAMOUS &lt;a href="http://communities.vmware.com/docs/DOC-8760"&gt;GhettoVCB&lt;/a&gt; scripts to take backups of VMs.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Service Console&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
Service Console is a port / console through which you are directly connected to the VMware Server. This is the most important part of VMware which needs to be configured very well.&lt;br /&gt;
One more thing that I have learned after my little experience is that, one should always have a secondary / backup service console.&lt;br /&gt;
I will also be explaining this in my coming posts, how to configure service console and how to make backup service consoles.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;VM Recovery from Backup After Crash&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
This is something that initially created allot of issues for me, but as time passed and after going through allot of documents and communities this became very clear to me. In fact now I think this is the most easiest task that can be completed in few minutes.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Creating and Managing Datastores&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
What is a Datastore? Datastore is just like another partition or your can also take it as a special mount point, where all your data is kept in VMware. Datasore can be on the local hard disk or over network or every a USB device connected. Inside a normal Datastore, you will find Virtial Machines, VM Disks, VM Configuration files and any other files that you want to place in the Datacenter ( such as a separate folder for ISO files and some scripts, etc).&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;ESX Host behind VPN and Firewall&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
This is something that I have found to be very very useful and very secure method. I have managed many VMware ESX hosts, and believe me I think this is the most secure method to put your ESX host over internet. In this method what happens is that, your main ESX host is actually not on Public IP but is only&amp;nbsp;accessible&amp;nbsp;through a Local IP and that is also only when you are connected to a VPN Server that is running on one of the Virtual Machines. I usually use an OpenVPN server for this.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3005268194823480029-5520740012767579304?l=www.diglinux.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~4/xToECfC9xu4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.diglinux.com/feeds/5520740012767579304/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.diglinux.com/2011/08/brief-vmware-intro.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/5520740012767579304?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/5520740012767579304?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~3/xToECfC9xu4/brief-vmware-intro.html" title="Brief VMware Intro" /><author><name>Mudasir Mirza</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="22" height="32" src="http://1.bp.blogspot.com/-OIdZxzRxr18/TiCjus8skeI/AAAAAAAAAG8/jjPpjboBsxU/s220/RHCE.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.diglinux.com/2011/08/brief-vmware-intro.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUQER38-eSp7ImA9WhdSF0s.&quot;"><id>tag:blogger.com,1999:blog-3005268194823480029.post-3740132061645849985</id><published>2011-07-27T15:41:00.000+05:00</published><updated>2011-07-27T15:41:46.151+05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-27T15:41:46.151+05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="mysql backup mysql db backup mysql disaster" /><title>MySQL DB Backup Script</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/P2KEpoggkdxKFeFkmctnwbQfnmE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P2KEpoggkdxKFeFkmctnwbQfnmE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/P2KEpoggkdxKFeFkmctnwbQfnmE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P2KEpoggkdxKFeFkmctnwbQfnmE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;I created this script for a project of mine that I was working on about 3 years back. This script takes MySQL backups based on the database names in a file.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;You can modify and use this script as per your needs.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;root@crystalnetworks:~# cat /root/scripts/dbackup.sh&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;******************************************************************************************************&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;#!/bin/bash&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;bk_dir="/backups/mysql" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# dir where backups will be takes&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;dir=`date +%Y-%m-%d`&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;tm=`date +%H%M%S`&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;bk_date=`date +%F`&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;bk_time=`date +%H-%M-%S`&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;db_list_file="db_list" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# list of DB dynamically created using&amp;nbsp;MySQL&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;bk_log_file="backup.log" &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# while creating backups, messages will be logged&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;## DB Credentials&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;db_user="root"&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;db_pass="root"&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;## Creating Necessary directories&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;if [ ! -d $bk_dir/$bk_date ]; then&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mkdir $bk_dir/$bk_date&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;fi&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;if [ ! -d $bk_dir/$bk_date/$bk_time ]; then&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mkdir $bk_dir/$bk_date/$bk_time&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;fi&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;mysql -u $db_user -p$db_pass -Bse 'show databases' | grep -vE "information_schema|mysql" &amp;gt; $bk_dir/$db_list_file&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;cat $bk_dir/$db_list_file |while read line&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;do&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;mysqldump -u $db_user -p$db_pass --database $line --default-character-set=utf8 &amp;nbsp;&amp;gt; $bk_dir/$bk_date/$bk_time/$line.sql&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;if [ "$?" -eq 0 ]; then&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;echo "backup sucessfull database: $line" &amp;gt;&amp;gt; $bk_dir/$bk_date/$bk_time/$bk_log_file&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;elif [ "$?" -eq 1 ]; then&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;echo "error during backup database: $line" &amp;gt;&amp;gt; $bk_dir/$bk_date/$bk_time/$bk_log_file&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;fi&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;done&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;cd $bk_dir/$bk_date/$bk_time; gzip *.sql&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;echo "Compressed all SQL files successfuly" &amp;gt;&amp;gt; $bk_dir/$bk_date/$bk_time/$bk_log_file&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;******************************************************************************************************&lt;/span&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/3005268194823480029-3740132061645849985?l=www.diglinux.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~4/5s_EykYYPQw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.diglinux.com/feeds/3740132061645849985/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.diglinux.com/2011/07/mysql-db-backup-script.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/3740132061645849985?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/3740132061645849985?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~3/5s_EykYYPQw/mysql-db-backup-script.html" title="MySQL DB Backup Script" /><author><name>Mudasir Mirza</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="22" height="32" src="http://1.bp.blogspot.com/-OIdZxzRxr18/TiCjus8skeI/AAAAAAAAAG8/jjPpjboBsxU/s220/RHCE.JPG" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.diglinux.com/2011/07/mysql-db-backup-script.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08GRH88cCp7ImA9WhdSFkU.&quot;"><id>tag:blogger.com,1999:blog-3005268194823480029.post-7734209788738815129</id><published>2011-07-26T17:03:00.000+05:00</published><updated>2011-07-26T17:03:45.178+05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-26T17:03:45.178+05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="php hammer web-crawler php web-loaded php curl pcntl_fork web-spider php-spider" /><title>PHP Web Spider / Hammer</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MmQFiAXFVey4ZHwaPItoEKARvC4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MmQFiAXFVey4ZHwaPItoEKARvC4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MmQFiAXFVey4ZHwaPItoEKARvC4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MmQFiAXFVey4ZHwaPItoEKARvC4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;Recently I was working on a PHP script with simple tasks that were needed to be performed. Now as I read more about the PHP Treading function, I thought of creating a web-spider or you can say web-site load testing script based on PHP.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;Currently this script is under heavy modification and performance tuning, but I thought it would be great to share my first draft with you people.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;This script is heavily documented, you can just go through this script and understand the purpose of each and every line.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;root@crystalnetworks:~# cat hammer.php&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;#!/usr/bin/php -q&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;##################################################################&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# Author : Mudasir Mirza&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# Date : 25-July-2011&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# E-Mail : mudasirmirza@gmail.com&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# Purpose : PHP based web spider, to put load on web-site.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# Limitations : HTTPS is not properly supported yet, Only one url can be given as input.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# Defaults : Default -c = 1 , Default -s = 300&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# Note : -c , -s and -u are only supported arguments.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# License : Under GNU / GPL, if you want to re-distribute this script, please include the name of author.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;##################################################################&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# Set time limit to 0, to make sure script does not get any php timeout errors&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;set_time_limit(0);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# PHP Class taken from internet for Spidering the url provided&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;class wSpider&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var $ch; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# going to used to hold our cURL instance&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var $html; &amp;nbsp; &amp;nbsp; &amp;nbsp;# used to hold resultant html data&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var $binary; &amp;nbsp; &amp;nbsp;# used for binary transfers&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var $uri; &amp;nbsp; &amp;nbsp; &amp;nbsp; # used to hold the url to be downloaded&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; function wSpider()&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this-&amp;gt;html = "";&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this-&amp;gt;binary = 0;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this-&amp;gt;uri = "";&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; function fetchPage($uri)&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this-&amp;gt;uri = $uri;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"; # Defining user agent that will be shown to remote URL&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (isset($this-&amp;gt;uri)) {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this-&amp;gt;ch = curl_init (); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # open a cURL instance&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; curl_setopt($this-&amp;gt;ch,CURLOPT_RETURNTRANSFER, 1); &amp;nbsp; &amp;nbsp; &amp;nbsp; # tell cURL to return the data&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; curl_setopt($this-&amp;gt;ch,CURLOPT_USERAGENT, $agent); &amp;nbsp; &amp;nbsp; &amp;nbsp; # Setting User agent for the curl session, defined earlier&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; curl_setopt($this-&amp;gt;ch,CURLOPT_URL, $this-&amp;gt;uri); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # set the URL to download&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; curl_setopt($this-&amp;gt;ch,CURLOPT_FOLLOWLOCATION, true); &amp;nbsp; &amp;nbsp;# Follow any redirects&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; curl_setopt($this-&amp;gt;ch,CURLOPT_BINARYTRANSFER, $this-&amp;gt;binary); &amp;nbsp; # tells cURL if the data is binary data or not&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; curl_setopt($this-&amp;gt;ch,CURLOPT_VERBOSE, false); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Set verbose, this writes error to STDERR (standard Error)&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; curl_setopt($this-&amp;gt;ch,CURLOPT_TIMEOUT, 1000); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Setting timeout for curl&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; curl_setopt($this-&amp;gt;ch,CURLOPT_SSL_VERIFYPEER, true); &amp;nbsp; &amp;nbsp;# Setting curl to accept any SSL certficate blindly&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this-&amp;gt;html = curl_exec($this-&amp;gt;ch); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # pulls the webpage from the internet&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; curl_close ($this-&amp;gt;ch); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # closes the connection&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# Defining arguments that will be taken as input from user&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;$opts = getopt('c:s:u:');&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# A foreach loop to go through each argument and set respective paratemers, using switch statement with foreach loop&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;foreach (array_keys($opts) as $opt) switch ($opt) {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; case 'c': &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # What to do with the input argument "c", and the input value of it.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $concurrent = $opts['c']; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Setting the value of argumetn -c in variable $concurrent, number of process to start&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; break; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# go out of switch statement for case "c"&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; case 's': &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # What to do with input argument "s", and the input value of if.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $proc_time = $opts['s']; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Setting the value of argument -s in variable $proc_time, this the process time.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; break; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# go out of switch statement for case "-s"&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; case 'u': &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # What to do with the input &amp;nbsp;argument "u", and the input value of it.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(!empty($opts['u'])){ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Checking if the argument "u" is not empty&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $url = $opts['u']; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# If argument "u is not empty, then set $url as the variable holding the value or argument "u"&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } else { &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# if argument "u" is foung empty then&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $url = ""; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Set the $url variable as an empty variable (nul)&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # End of if&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; break; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# go out of switch statement for case "-u"&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;} &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # End of foreach loop&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# Some basic validation&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# Checking if input argument "-c" has any value or not, $concurrent is defined above which contains value of -c&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;if(empty($concurrent)){&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # if $concurrent if found empty (null), print to screen below text&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo "\nNo Concurrent session defined, using default\n";&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Setting default value to $concurrent, default is 1&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $concurrent = '1';&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# Checking if input parameter "-s" has any value or not, $proc_time is defined above which contains value of -s&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;if(empty($proc_time)){&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # if $proc_time is found empty (null), print to screen below text&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo "No Process time is defined, using default\n\n";&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # setting default value to $proc_time, defaut 300&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $proc_time = '300';&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# Checking if input parameter "-u" has any valu or not, if no URL is defined script will not run. $url defined above&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;if(empty($url)){&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # IF url is found empty (null), then below text will print on screen, this is the script usage text.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo "Please specifiy URL\n";&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo "Usage ./blast.php [options] [url]\n";&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo "Example: ./blast.php -c 10 -s 100 -u http://www.yahoo.com\n";&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo "Options:\n";&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo "-c\tConcurrent processes to run\n";&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo "-s\tTime for each process in Sec\n";&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo "-u\tURL to hit with each process\n\n";&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; exit(1); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# script will exit without performing any further tasks, with exit status code 1&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# Print to screen the settings defined by user as input arguments.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;echo "Concurrent processes set to $concurrent\n";&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;echo "Process session time set to $proc_time sec\n";&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;echo "URL To Spider is set to $url\n\n";&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# Setting $child with value of $concurrent (concurrent processes to start)&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;$child = $concurrent;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# using for loop, with maximum iterations equals to the concurrent number processes that this script needs to start&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;for ($i=1; $i&amp;lt;=$child; $i++)&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; $pid = pcntl_fork(); &amp;nbsp;# $pid is set to the process id of the main process using pcntl_fork() function&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; if ($pid == -1) &amp;nbsp; &amp;nbsp; &amp;nbsp; # if $pid == -1, which means for some reason main process is unable to start child processes.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; die("could not fork\n");&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; else if ($pid) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# if $pid = 1, this means the process is the parent process, which is used to fork children processes.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; exit(0); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# exit the parent process after giving birth to children processes&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; else &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# if $pid not equals 1 or -1 then do the following&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; $cpid = pcntl_fork(); &amp;nbsp; &amp;nbsp; &amp;nbsp; # $cpid will start child processes and will contain there pids using function pcntl_fork()&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; if ($cpid == -1) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# if $cpid is = -1, then child process can not be reached, print on screen and die.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; die("could not fork in child process\n");&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; if (!$cpid) &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # if $cpid != 1, then this is the child process.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # Here we define what to do with child process.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # A for loop will going to start with maximum iterations equals to the argument "-s" seconds defined by input.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # each iteration will call the Visit function which uses curl to load the web-site&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # after the function Visit is called, the loop will sleep for 1sec, thats how i made the loop to iterate for the&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # amount of time in seconds defined by input&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $start_date = strtotime(date('Y-m-d H:i:s')); &amp;nbsp; # Start time to calculate Proper Process running time&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for ($k=1; $k&amp;lt;=$proc_time; $k++) { &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Start of for loop, iterations = $proc_time&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $end_date = strtotime(date('Y-m-d H:i:s')); # End time to check for process running time&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $seconds = $start_date - $end_date; &amp;nbsp; &amp;nbsp; # Caclucate Seconds from start_date and end_date&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if($seconds &amp;gt; $proc_time){ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# if running time is greater then provided argument -s&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; exit(0); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# then exit the process&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $mySpider = new wSpider(); &amp;nbsp; &amp;nbsp; &amp;nbsp;# creates a new instance of the wSpider&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $mySpider-&amp;gt;fetchPage($url); &amp;nbsp; &amp;nbsp; # fetches the home page of url provided by the user as input argument&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sleep(1); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # sleep for 1 second in the iteration of loop&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; exit(0); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# Now exiting the child process properly, after the iterations of loop for given time are complete.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;# End of Script&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;########################################&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', serif;"&gt;This script should be used only for testing purposes, and the person using this script will be responsible for any outcomes related to System and / or Legal.&lt;/span&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/3005268194823480029-7734209788738815129?l=www.diglinux.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~4/IugLltmXWmA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.diglinux.com/feeds/7734209788738815129/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.diglinux.com/2011/07/php-web-spider-hammer.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/7734209788738815129?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/7734209788738815129?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~3/IugLltmXWmA/php-web-spider-hammer.html" title="PHP Web Spider / Hammer" /><author><name>Mudasir Mirza</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="22" height="32" src="http://1.bp.blogspot.com/-OIdZxzRxr18/TiCjus8skeI/AAAAAAAAAG8/jjPpjboBsxU/s220/RHCE.JPG" /></author><thr:total>2</thr:total><feedburner:origLink>http://www.diglinux.com/2011/07/php-web-spider-hammer.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkABSHc-fyp7ImA9WhdSFkU.&quot;"><id>tag:blogger.com,1999:blog-3005268194823480029.post-3787495375226689307</id><published>2011-07-26T16:45:00.000+05:00</published><updated>2011-07-26T16:45:59.957+05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-26T16:45:59.957+05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="openvpn ubuntu vpn ovpn easy-rsa vpn certificate" /><title>OpenVPN on Ubuntu 10.04.2</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/n0szkGP-VrS38GOLo0vNRae0Qrg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/n0szkGP-VrS38GOLo0vNRae0Qrg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/n0szkGP-VrS38GOLo0vNRae0Qrg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/n0szkGP-VrS38GOLo0vNRae0Qrg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;
&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;This article is specially designed to help Linux Beginners in setting up OpenVPN on Ubuntu 10.04.2 platform. Server configuration and certificate generation steps on all Linux Distributions are almost the same. Installation of OpenVPN can differ from Distribution to Distribution.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Lets Start with OpenVPN !!!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;&lt;span style="font-size: 12pt;"&gt;Basic Assumptions.&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul type="disc"&gt;&lt;li class="MsoNormal" style="line-height: normal; mso-list: l1 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;We will be working on a freshly installed Ubuntu      10.04.2 LTS Server.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l1 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;We will use root account for this article.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l1 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Two Ethernet cards are attached. (eth0 connected to      internet and eth1 connected to local network with IP range      192.168.100.0/24. eth1 has IP Address 192.168.100.1/24) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l1 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Server is directly connected to Internet and is not      behind any firewall. If server is placed behind firewall then port 1194      (tcp/udp based on your config) should be forwarded to OpenVPN Server.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l1 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;We will not use same certificate for multiple clients.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l1 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;We will not apply any restriction / access policy based      on OpenVPN Certificates.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l1 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;We will use 172.16.0.0/24 as our VPN IP Range.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 2;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: yellow;"&gt;&lt;u&gt;Step 1 : (Setting root password and updating APTITUDE Repo)&lt;/u&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 2;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: yellow;"&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;mudasir@crystalnetworks:~#&lt;/span&gt;&lt;/u&gt;&lt;span style="font-size: 12pt;"&gt; sudo passwd root&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;root@crystalnetworks:~#&lt;/span&gt;&lt;/u&gt;&lt;span style="font-size: 12pt;"&gt; apt-get update &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 2;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: yellow;"&gt;&lt;u&gt;Step 2 : (Installing OpenVPN Using apt-get) &lt;/u&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;root@crystalnetworks:~#&lt;/span&gt;&lt;/u&gt;&lt;span style="font-size: 12pt;"&gt; apt-get install openvpn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;The above command takes care of installing OpenVPN on Ubuntu 10.04.2, now the main thing which is left is configuring the server and creating certificates for server and clients.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 2;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: yellow;"&gt;&lt;u&gt;Step 3 : (Creating Certificates for Server)&lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 12pt;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;We need to copy easy-rsa tools so that we can create certificates.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;root@crystalnetworks:~#&lt;/span&gt;&lt;/u&gt;&lt;span style="font-size: 12pt;"&gt; cp -fr /usr/share/doc/openvpn/examples/easy-rsa/ /etc/openvpn/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Above command will copy easy-rsa tools to /etc/openvpn directory. Now we will create certificates.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;root@crystalnetworks:~#&lt;/span&gt;&lt;/u&gt;&lt;span style="font-size: 12pt;"&gt; cd /etc/openvpn/easy-rsa/2.0/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Edit "vars" file and set some basic parameters which are present at the bottom of the file. Below given are the parameters which you should change in this file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;export KEY_COUNTRY="PK"&lt;br /&gt;
export KEY_PROVINCE="SN"&lt;br /&gt;
export KEY_CITY="Karachi"&lt;br /&gt;
export KEY_ORG="Crystal Networks"&lt;br /&gt;
export KEY_EMAIL=" &lt;script&gt;
&lt;/script&gt;&lt;a href="mailto:support@crystalnetworks.org"&gt;&lt;span style="color: blue;"&gt;support@crystalnetworks.org&lt;/span&gt;&lt;/a&gt;&lt;script&gt;
&lt;/script&gt;&lt;span style="display: none; mso-hide: all;"&gt;This e-mail address is being protected from spambots, you need JavaScript enabled to view it &lt;script&gt;
&lt;/script&gt;&lt;/span&gt;"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Set these parameters to your liking and then save and exit the file. (Output is not shown of below commands) &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;root@crystalnetworks:/etc/openvpn/easy-rsa/2.0#&lt;/span&gt;&lt;/u&gt;&lt;span style="font-size: 12pt;"&gt; source ./vars&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;root@crystalnetworks:/etc/openvpn/easy-rsa/2.0#&lt;/span&gt;&lt;/u&gt;&lt;span style="font-size: 12pt;"&gt;./clean-all&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;root@crystalnetworks:/etc/openvpn/easy-rsa/2.0#&lt;/span&gt;&lt;/u&gt;&lt;span style="font-size: 12pt;"&gt; ./build-dh&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;root@crystalnetworks:/etc/openvpn/easy-rsa/2.0#&lt;/span&gt;&lt;/u&gt;&lt;span style="font-size: 12pt;"&gt; ./build-ca&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;root@crystalnetworks:/etc/openvpn/easy-rsa/2.0#&lt;/span&gt;&lt;/u&gt;&lt;span style="font-size: 12pt;"&gt; ./build-key-server Server&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;This completes the generation of Certificates for our Server. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;We can use the Server Certificate from its current location, however I normally copy these Certificates to /etc/openvpn directory. All generated certificates are present in "/etc/openvpn/easy-rsa/2.0/keys/". Now I will copy the Server related Certificates to /etc/openvpn/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;root@crystalnetworks:/etc/openvpn/easy-rsa/2.0#&lt;/span&gt;&lt;/u&gt;&lt;span style="font-size: 12pt;"&gt; cp keys/{ca.crt,Server.crt,Server.key,dh1024.pem} /etc/openvpn/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 2;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: yellow;"&gt;&lt;u&gt;Step 4: (Configuration file for OpenVPN Server) &lt;/u&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 12pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;root@crystalnetworks:/etc/openvpn/easy-rsa/2.0#&lt;/span&gt;&lt;/u&gt;&lt;span style="font-size: 12pt;"&gt; cp /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz &amp;nbsp; /etc/openvpn/&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;root@crystalnetworks:/etc/openvpn/easy-rsa/2.0#&lt;/span&gt;&lt;/u&gt;&lt;span style="font-size: 12pt;"&gt; cd /etc/openvpn&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;root@crystalnetworks:/etc/openvpn/easy-rsa/2.0#&lt;/span&gt;&lt;/u&gt;&lt;span style="font-size: 12pt;"&gt; gzip -d server.conf.gz&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Now we have a raw server configuration file with default settings. We need to change settings as per our requirement. The settings that we will change in the config file as as follows.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ol start="1" type="1"&gt;&lt;li class="MsoNormal" style="line-height: normal; mso-list: l0 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Set "proto" to "tcp".&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l0 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Make sure that "dev tun" is enabled and      "dev tap" is disabled.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l0 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Set "ca", and give the path to      "ca.crt" file ( example: "ca ca.crt" , because we      copied the ca.crt to /etc/openvpn directory)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l0 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Set "cert", and give path to      "Server.crt"file ( example: "cert Server.crt" ,      because we copied the Server.crt to /etc/openvpn directory)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l0 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Set"key", and give path to      "Server.key" file ( example: "key Server.key" ,      because we copied the Server.key to /etc/openvpn directory)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l0 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Set "dh", and give path to      "dh1024.pem" file (example: "dh dh1024.pem" , because      we copied the dh1024.pem file to /etc/openvpn directory)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l0 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Enable "Server 172.16.0.0 255.255.255.0"      line. This is the network IP Range that will be used for VPN Connection.      This is also mentioned in Basic Assumptions part.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l0 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Set "push 192.168.100.0 255.255.255.0" . This      dynamically adds routes entry in the OS of client that this range with      this subnet should be routed through the VPN. This range is also mentioned      in Basic Assumptions part.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l0 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Enable "log" and "log-append" lines      and do not change any thing.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Now we will need to restart our OpenVPN Server.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;root@crystalnetworks:#&lt;/span&gt;&lt;/u&gt;&lt;span style="font-size: 12pt;"&gt; /etc/init.d/openvpn restart&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;After restarting OpenVPN Server, to confirm whether the server has properly started or not we can either check log files or just issue "ifconfig" and if you see an interface like tun0 then the service has started successfully.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 2;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: yellow;"&gt;&lt;u&gt;Step 5: (Setting Firewall Rules) &lt;/u&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; mso-outline-level: 2;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color: yellow;"&gt;&lt;u&gt;&lt;br /&gt;
&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Now we need to set firewall rules to allow proper communication between remote client and office machines.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ol start="1" type="1"&gt;&lt;li class="MsoNormal" style="line-height: normal; mso-list: l2 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;IP Range of VPN is 172.16.0.0/24&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l2 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;IP Range of local network is 192.168.100.0/24&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class="MsoNormal" style="line-height: normal; mso-list: l2 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;eth0 is connected to WAN&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;root@crystalnetworks:#&lt;/span&gt;&lt;/u&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp; iptables -t nat -A POSTROUTING -d 192.168.100.0/24 -s 172.16.0.0/24 -j SNAT --to-source 192.168.100.1&lt;br /&gt;
&lt;u&gt;root@crystalnetworks:#&lt;/u&gt; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;u&gt;&lt;span style="font-size: 12pt;"&gt;root@crystalnetworks:#&lt;/span&gt;&lt;/u&gt;&lt;span style="font-size: 12pt;"&gt;&amp;nbsp; echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;To make these rules persistent you can simple copy these rules to /etc/rc.local which is knows as the startup script for Linux. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="MsoNormal" style="line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style="font-size: 12pt; line-height: 115%;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Well that is all from OpenVPN Server side. I will very soon be updating another article related to Client config of OpenVPN and also in near future I will be updating another article related to integration of OpenVPN with OpenLDAP.&amp;nbsp;&lt;/span&gt;&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/3005268194823480029-3787495375226689307?l=www.diglinux.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~4/Q5X70cgjSso" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.diglinux.com/feeds/3787495375226689307/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.diglinux.com/2011/07/openvpn-on-ubuntu-10042.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/3787495375226689307?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/3787495375226689307?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~3/Q5X70cgjSso/openvpn-on-ubuntu-10042.html" title="OpenVPN on Ubuntu 10.04.2" /><author><name>Mudasir Mirza</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="22" height="32" src="http://1.bp.blogspot.com/-OIdZxzRxr18/TiCjus8skeI/AAAAAAAAAG8/jjPpjboBsxU/s220/RHCE.JPG" /></author><thr:total>3</thr:total><feedburner:origLink>http://www.diglinux.com/2011/07/openvpn-on-ubuntu-10042.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMHSH0-cCp7ImA9WhdTF0o.&quot;"><id>tag:blogger.com,1999:blog-3005268194823480029.post-2900163629444296029</id><published>2011-07-16T04:27:00.000+05:00</published><updated>2011-07-16T04:27:19.358+05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-07-16T04:27:19.358+05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="heartbeat failover ip failover service failover linux heartbeat" /><title>Linux HeartBeat IP Fail-over</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/MkIziq0j-IDEUVFQMpWs36A_GCE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MkIziq0j-IDEUVFQMpWs36A_GCE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/MkIziq0j-IDEUVFQMpWs36A_GCE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/MkIziq0j-IDEUVFQMpWs36A_GCE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;-------------------------------------------------------------------------------&lt;br /&gt;
TITLE &amp;nbsp; &amp;nbsp;: Heartbeat fail-over of IP addresses&lt;br /&gt;
OS LEVEL : Linux (Ubuntu)&lt;br /&gt;
AUTHOR &amp;nbsp; : Mudasir Mirza&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
Few years back I was working as System Administrator and had to implement High-Availability. I googled allot and came across the HeartBeat Daemon which provides this functionality in the most flexible ways that one can think of.&lt;br /&gt;
&lt;br /&gt;
In this post I will guide you all in configuring HeartBeat as an IP Fail-over daemon, which can provide you high-availability between servers running synced data / service.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Pre-requisites:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Basic install of Ubuntu 10.04.2 LTS.&lt;/li&gt;
&lt;li&gt;Internet connectivity for installing heartbeat.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;b&gt;Assumptions:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;u&gt;For Host 1 (i.e. named as Dell )&lt;/u&gt;&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;Host 1 = Dell&lt;/li&gt;
&lt;li&gt;Interface connected on Host 1 =&amp;nbsp;eth0 (192.168.0.5/24)&lt;/li&gt;
&lt;li&gt;Hostname = dell.intranet.local&lt;/li&gt;
&lt;li&gt;cat /etc/hosts&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;#/etc/hosts should have below entries&lt;/li&gt;
&lt;li&gt;192.168.0.4&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;inbox&lt;/li&gt;
&lt;li&gt;192.168.0.5&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;dell&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;li&gt;For Host 2 (i.e. named as INBOX )&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;Host 2 = INBOX&lt;/li&gt;
&lt;li&gt;Interface connected on Host 2 = eth0 (192.168.0.4/24)&lt;/li&gt;
&lt;li&gt;Hostname = inboxess.intranet.local&lt;/li&gt;
&lt;li&gt;cat /etc/hosts&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;#/etc/hosts should have below entries&lt;/li&gt;
&lt;li&gt;192.168.0.4&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;inbox&lt;/li&gt;
&lt;li&gt;192.168.0.5&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;dell&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;li&gt;Service IP: Service IP is the IP that is used to provide the service provided by the server to users. This is basically the IP that will automatically shift from Host 1 to Host 2 on Fail-over.&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;Server IP = 192.168.0.9/24&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;NOTE: &lt;/u&gt;&lt;/b&gt;Where ever you see "DELL#&amp;gt;" this means shell prompt on Host 1 (i.e. named as Dell) and whenever you see "INBOX#&amp;gt;" this means shell prompt on Host 2 (i.e. named as INBOX)&lt;br /&gt;
&lt;br /&gt;
I will configure both servers simultaneously, because configuration on both servers are very identical, except for some minor changed.&lt;br /&gt;
&lt;br /&gt;
Now Lets start installing and configuring HearBeat.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;---------------&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Step 1: Updating the aptitude package repository&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;---------------&lt;/b&gt;&lt;br /&gt;
DELL#&amp;gt; apt-get update&lt;br /&gt;
INBOX#&amp;gt; apt-get update&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;---------------&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Step 2: Installing Heartbeat Daemon&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;---------------&lt;/b&gt;&lt;br /&gt;
DELL#&amp;gt; apt-get install heartbeat&lt;br /&gt;
INBOX#&amp;gt; apt-get install heartbeat&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;---------------&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Step 3: Configure Heartbeat.&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;---------------&lt;/b&gt;&lt;br /&gt;
# This file ha.cf contains the configuration of your heartbeat daemon. Here we define which interface to listen, and which method to use. The path of log file and the fail-over time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;DELL#&amp;gt; vim /etc/ha.d/ha.cf&lt;/span&gt;&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;debugfile /var/log/ha-debug&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&amp;nbsp;   # error and debug logfile&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;logfile /var/log/ha-log &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # general log file for daemon&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;logfacility local0 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # method for logging, this is from syslog&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;keepalive 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# sets the interval between heartbeat p&lt;span class="Apple-style-span" style="line-height: 19px;"&gt;ackets, 2sec&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;deadtime 10 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;#&amp;nbsp;&lt;span class="Apple-style-span" style="line-height: 19px;"&gt;how quickly Heartbeat should decide &lt;/span&gt;&lt;span class="Apple-style-span" style="line-height: 19px;"&gt;the node is dead, 10sec&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;warntime 5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;#&amp;nbsp;&lt;span class="Apple-style-span" style="line-height: 19px;"&gt;how quickly Heartbeat should issue a "late heartbeat" warning.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;initdead 60 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&amp;nbsp; &amp;nbsp; #&amp;nbsp;&lt;span class="Apple-style-span" style="line-height: 19px;"&gt;set the time that it takes to declare a cluster node dead&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;ucast eth0 192.168.0.4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&amp;nbsp;#&amp;nbsp;&lt;span class="Apple-style-span" style="line-height: 19px;"&gt;communicate over a UDP unicast communications link&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;auto_failback on &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;# will&lt;span class="Apple-style-span" style="line-height: 19px;"&gt;&amp;nbsp;a resource will automatically fail back to its "primary" node&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;node dell &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; # primary node ( host 1 named as Dell)&lt;/li&gt;
&lt;li&gt;node inbox &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;# secondary node ( host 2 named as inbox)&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;INBOX#&amp;gt; vim /etc/ha.d/ha.cf&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;debugfile /var/log/ha-debug&lt;/li&gt;
&lt;li&gt;logfile /var/log/ha-log&lt;/li&gt;
&lt;li&gt;logfacility local0&lt;/li&gt;
&lt;li&gt;keepalive 2&lt;/li&gt;
&lt;li&gt;deadtime 10&lt;/li&gt;
&lt;li&gt;warntime 5&lt;/li&gt;
&lt;li&gt;initdead 60&lt;/li&gt;
&lt;li&gt;ucast eth0 192.168.0.5&lt;/li&gt;
&lt;li&gt;auto_failback on&lt;/li&gt;
&lt;li&gt;node dell&lt;/li&gt;
&lt;li&gt;node inbox&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;br /&gt;
&lt;b&gt;---------------&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Step 4: &amp;nbsp;Configure Auth keys for secure authentication of nodes with each other&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;---------------&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The file /etc/ha.d/authkeys contains the keys that are used by server to authenticate each other in starting the heartbeat server between servers.&lt;br /&gt;
&lt;br /&gt;
&lt;u style="font-weight: bold;"&gt;NOTE:&lt;/u&gt;&amp;nbsp;Heartbeat will not start if permissions of this file is not set to "0600".&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;DELL#&amp;gt; vim /etc/ha.d/authkeys&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;auth 1&lt;/li&gt;
&lt;li&gt;1 sha1 ess1234&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;DELL#&amp;gt; chmod 0600 /etc/ha.d/authkeys&lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;INBOX#&amp;gt; vim /etc/ha.d/authkeys&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;auth 1&lt;/li&gt;
&lt;li&gt;1 sha1 ess1234&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;INBOX#&amp;gt; chmod 0600 /etc/ha.d/authkeys&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;b&gt;---------------&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Step 5: Configure the heartbeat rule.&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;---------------&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The file /etc/ha.d/harecources contains all the rules related to heartbeat. Which server to monitor or which IP to fail-over.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;DELL#&amp;gt; vim /etc/ha.d/haresources&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;dell 192.168.0.9/24/eth0/192.168.0.255 ARP&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;When I was implementing this, I came across a small problem. When the IP used to shift from primary node to secondary, the communication between client and server used to get disconnected.&lt;/div&gt;&lt;div&gt;After doing some research I found that the issue was related to the ARP entry.&lt;/div&gt;&lt;div&gt;To resolve the issue, I created a small custom script that will run each time the IP is shifted to any node, and will broadcast the new IP and MAC address of the new node to the whole network using "arping"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Directory&amp;nbsp;"/etc/ha.d/resource.d/" contains all the scripts that can be used by heartbeat daemon and yes you can write or customize the given script.&lt;/div&gt;&lt;ul&gt;&lt;li&gt;DELL#&amp;gt; vim /etc/ha.d/resource.d/ARP&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;#!/bin/bash&lt;/li&gt;
&lt;li&gt;case "$1" in&lt;/li&gt;
&lt;li&gt;start)&lt;/li&gt;
&lt;li&gt;arping -f -q -c 5 -w 5 -I eth0 -U 192.168.0.9&lt;/li&gt;
&lt;li&gt;;;&lt;/li&gt;
&lt;li&gt;stop)&lt;/li&gt;
&lt;li&gt;# Stop commands go here&lt;/li&gt;
&lt;li&gt;;;&lt;/li&gt;
&lt;li&gt;status)&lt;/li&gt;
&lt;li&gt;# Status commands go here&lt;/li&gt;
&lt;li&gt;;;&lt;/li&gt;
&lt;li&gt;esac&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;DELL#&amp;gt; chmod +x &amp;nbsp;/etc/ha.d/resource.d/ARP&lt;/li&gt;
&lt;/ul&gt;Same will be done on Host 2 named as INBOX.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;INBOX#&amp;gt; vim /etc/ha.d/haresources&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;dell 192.168.0.9/24/eth0/192.168.0.255 ARP&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;div&gt;Here also we need the same script as defined in Host 1 (i.e. named as Dell)&lt;/div&gt;&lt;ul&gt;&lt;li&gt;INBOX#&amp;gt; vim /etc/ha.d/resource.d/ARP&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;#!/bin/bash&lt;/li&gt;
&lt;li&gt;case "$1" in&lt;/li&gt;
&lt;li&gt;start)&lt;/li&gt;
&lt;li&gt;arping -f -q -c 5 -w 5 -I eth0 -U 192.168.0.9&lt;/li&gt;
&lt;li&gt;;;&lt;/li&gt;
&lt;li&gt;stop)&lt;/li&gt;
&lt;li&gt;# Stop commands go here&lt;/li&gt;
&lt;li&gt;;;&lt;/li&gt;
&lt;li&gt;status)&lt;/li&gt;
&lt;li&gt;# Status commands go here&lt;/li&gt;
&lt;li&gt;;;&lt;/li&gt;
&lt;li&gt;esac&lt;/li&gt;
&lt;/ul&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;INBOX#&amp;gt; chmod +x &amp;nbsp;/etc/ha.d/resource.d/ARP&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
The heartbeat daemon is now configured. Now we need to restart our servers, and make sure that your primary server boots up before your secondary server, otherwise secondary server will make it self the primary server.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;---------------&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Step 6: Restarting the servers.&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;---------------&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;DELL#&amp;gt; /etc/init.d/heartbeat restart&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
Wait 1&amp;nbsp;Min&amp;nbsp;after that restart the service on INBOX&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;INBOX#&amp;gt; /etc/init.d/heartbeat restart&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;Please feel free to provide your feedback. More contributions from my side will be coming very soon.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&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/3005268194823480029-2900163629444296029?l=www.diglinux.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~4/HTumJjlNKZc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.diglinux.com/feeds/2900163629444296029/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.diglinux.com/2011/07/linux-heartbeat-ip-fail-over.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/2900163629444296029?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3005268194823480029/posts/default/2900163629444296029?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/WelcomeToDiglinuxOpensourceKnowledgePlatform/~3/HTumJjlNKZc/linux-heartbeat-ip-fail-over.html" title="Linux HeartBeat IP Fail-over" /><author><name>Mudasir Mirza</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="22" height="32" src="http://1.bp.blogspot.com/-OIdZxzRxr18/TiCjus8skeI/AAAAAAAAAG8/jjPpjboBsxU/s220/RHCE.JPG" /></author><thr:total>1</thr:total><feedburner:origLink>http://www.diglinux.com/2011/07/linux-heartbeat-ip-fail-over.html</feedburner:origLink></entry></feed>

