<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1767307989305526323</id><updated>2012-01-06T21:21:35.511+07:00</updated><title type='text'>Conheotiensinh</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>34</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-6353786859693954161</id><published>2011-12-26T10:11:00.019+07:00</published><updated>2011-12-26T10:55:43.737+07:00</updated><title type='text'>Setting Up A High-Availability Load Balancer With HAProxy/Pfsense 2.0.1</title><content type='html'>&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I/Overview&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-EZYh5ri9Ilk/TvfqA2Pfn7I/AAAAAAAAAdA/LNwukfC4upM/s1600/8.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 223px;" src="http://4.bp.blogspot.com/-EZYh5ri9Ilk/TvfqA2Pfn7I/AAAAAAAAAdA/LNwukfC4upM/s400/8.JPG" alt="" id="BLOGGER_PHOTO_ID_5690273954487312306" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:180%;" &gt;II/Intro&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As lastest document.I give you how to config haproxy on Pfsense 2.0.1.Now I will intro to you how to Setting Up A High-Availability Load Balancer With HAProxy/Pfsense 2.0.1&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold;"&gt;III/Setting&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1/Install haproxy on pfsense as &lt;a href="http://conheotiensinh.blogspot.com/2011/12/config-haproxy-with-pfsense-version-201.html"&gt;http://conheotiensinh.blogspot.com/2011/12/config-haproxy-with-pfsense-version-201.html&lt;/a&gt;&lt;br /&gt;2/Configuring CARP firewall failover&lt;br /&gt;&lt;br /&gt;2.1/On both machines, add a firewall to allow all traffic on the SYNC interface:&lt;br /&gt;&lt;br /&gt;a.   Browse to Firewall | Rules.&lt;br /&gt;b.   Click the  SYNC Interface  tab.&lt;br /&gt;c.   Click the "plus" button to add a new firewall rule.&lt;br /&gt;d.   Set  Protocol  to  any.&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/-mRYjGdEuqUU/Tvfqw5vzHVI/AAAAAAAAAdM/rSf24Y3lbU8/s1600/9.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 168px;" src="http://4.bp.blogspot.com/-mRYjGdEuqUU/Tvfqw5vzHVI/AAAAAAAAAdM/rSf24Y3lbU8/s400/9.JPG" alt="" id="BLOGGER_PHOTO_ID_5690274780061834578" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;e.   Save the changes.&lt;br /&gt;f.   Apply changes, if necessary.&lt;br /&gt;&lt;br /&gt;2.2/On the backup-pfsense machine, we need to enable CARP synchronization and&lt;br /&gt;configure it as a backup only:&lt;br /&gt;&lt;br /&gt;a.   Browse to Firewall | Virtual  IPs .&lt;br /&gt;b.   Click the  CARP Settings  tab.&lt;br /&gt;c.   Check  Synchronize Enabled.&lt;br /&gt;d.   Set  Synchronize Interface  to  SYNC.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-GcjV7obGubU/TvfrUX_3V6I/AAAAAAAAAdY/D4Srf-PHQmc/s1600/10.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 150px;" src="http://2.bp.blogspot.com/-GcjV7obGubU/TvfrUX_3V6I/AAAAAAAAAdY/D4Srf-PHQmc/s400/10.JPG" alt="" id="BLOGGER_PHOTO_ID_5690275389477705634" border="0" /&gt;&lt;/a&gt;e.   Save the changes.&lt;br /&gt;f.   We have now finished configuring the backup firewall.&lt;br /&gt;&lt;br /&gt;2.3/On the primary-pfsense machine, we need to enable CARP synchronization and&lt;br /&gt;configure it to act as the primary firewall:&lt;br /&gt;&lt;br /&gt;a.   Br owse to Firewall | Virtual  IPs .&lt;br /&gt;b.   Click the  CARP Settings tab.&lt;br /&gt;c.   Check  Synchronize Enabled.&lt;br /&gt;d.   Set  Synchronize Interface  to  SYNC.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-OIRZ9nixG3E/Tvfsd3Gu36I/AAAAAAAAAdk/wQspCB_6TNA/s1600/11.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 274px;" src="http://3.bp.blogspot.com/-OIRZ9nixG3E/Tvfsd3Gu36I/AAAAAAAAAdk/wQspCB_6TNA/s400/11.JPG" alt="" id="BLOGGER_PHOTO_ID_5690276651958460322" border="0" /&gt;&lt;/a&gt;e.  Check  Synchronize rules&lt;br /&gt;f.  Check  Synchronize nat&lt;br /&gt;g.  Check  Synchronize Virtual  IPs&lt;br /&gt;h.  Set  Synchronize to  IP  to the IP address of backup-pfsense&lt;br /&gt;i.  Set  Remote System Password to the password of backup-pfsense&lt;br /&gt;j  Save the changes&lt;br /&gt;&lt;br /&gt;2.4/We must now configure a virtual IP address for the WAN interface on the primary-pfsense machine:&lt;br /&gt;&lt;br /&gt;a.   Browse to Firewall | Virtual  IPs .&lt;br /&gt;b.   Click the  Virtual  IPs  tab.&lt;br /&gt;c.   Click the "plus" button  to add a new virtual IP.&lt;br /&gt;d.   Set the Type  to  CARP.&lt;br /&gt;e.   Set the Interface  to  WAN.&lt;br /&gt;f.   Set the IP  Address to the single WAN address that will be used throughout&lt;br /&gt;your systems, regardless of whether the primary or backup firewall is in&lt;br /&gt;effect.&lt;br /&gt;g.   Create a  Virtual  IP  Password.&lt;br /&gt;h.   Leave the  VHID Group set to  1.&lt;br /&gt;i.   Leave the  Advertising  Frequency  at  0.&lt;br /&gt;j.  Add a Description&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-Bdv1Zkx58i8/TvftoHqoEwI/AAAAAAAAAdw/laE2j8zEDRE/s1600/12.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 231px;" src="http://2.bp.blogspot.com/-Bdv1Zkx58i8/TvftoHqoEwI/AAAAAAAAAdw/laE2j8zEDRE/s400/12.JPG" alt="" id="BLOGGER_PHOTO_ID_5690277927714296578" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;k.Save the changes&lt;br /&gt;l.Apply changes, if necessary&lt;br /&gt;&lt;br /&gt;3/config Sync HAProxy configuration&lt;br /&gt;&lt;br /&gt;3.1/On the backup-pfsense machine we need check Sync HAProxy configuration to backup CARP members via XMLRPC.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-2UmPigQszTE/Tvfuzy5doxI/AAAAAAAAAd8/-AEJtRnYvfU/s1600/13.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 170px;" src="http://2.bp.blogspot.com/-2UmPigQszTE/Tvfuzy5doxI/AAAAAAAAAd8/-AEJtRnYvfU/s400/13.JPG" alt="" id="BLOGGER_PHOTO_ID_5690279227809440530" border="0" /&gt;&lt;/a&gt;3.2/On the primary-pfsense machine,we need  check Sync HAProxy configuration to backup CARP members via XMLRPC and setting for sync config HaProxy&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/-5vpwaFzGcuU/Tvfvgjs6_9I/AAAAAAAAAeI/Dwce0OiN8YQ/s1600/14.JPG"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 169px;" src="http://2.bp.blogspot.com/-5vpwaFzGcuU/Tvfvgjs6_9I/AAAAAAAAAeI/Dwce0OiN8YQ/s400/14.JPG" alt="" id="BLOGGER_PHOTO_ID_5690279996824420306" border="0" /&gt;&lt;/a&gt;Now we can config haproxy in primary-Pfsense and it auto sync to backup -Pfsense&lt;br /&gt;&lt;br /&gt;Thanks and Best Regards&lt;br /&gt;&lt;br /&gt;quan.hoa@conheotiensinh.co.cc&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-6353786859693954161?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/6353786859693954161/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2011/12/setting-up-high-availability-load.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/6353786859693954161'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/6353786859693954161'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2011/12/setting-up-high-availability-load.html' title='Setting Up A High-Availability Load Balancer With HAProxy/Pfsense 2.0.1'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-EZYh5ri9Ilk/TvfqA2Pfn7I/AAAAAAAAAdA/LNwukfC4upM/s72-c/8.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-686710776843142809</id><published>2011-12-23T11:02:00.028+07:00</published><updated>2011-12-23T21:43:53.200+07:00</updated><title type='text'>Config HAPROXY with PFSENSE version 2.0.1</title><content type='html'>&lt;div style="text-align: center; color: rgb(255, 0, 0);"&gt;&lt;span style="font-size:180%;"&gt;&lt;b style="font-family: arial; "&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center; color: rgb(255, 0, 0);"&gt;&lt;span style="font-size:180%;"&gt;&lt;span&gt;&lt;b&gt;&lt;i&gt;Merry Christmas and Happy New Year&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;i&gt;&lt;span&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://3.bp.blogspot.com/-wPxmOeg98ik/TvP-w-BKi1I/AAAAAAAAAaw/C6f4Q0iIqN0/s1600/christmas.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://3.bp.blogspot.com/-wPxmOeg98ik/TvP-w-BKi1I/AAAAAAAAAaw/C6f4Q0iIqN0/s400/christmas.jpg" alt="" id="BLOGGER_PHOTO_ID_5689170871534127954" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;b&gt;I/Intro&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;As the previous Document about Haproxy , &lt;/span&gt; &lt;span&gt;I have explained how to configure a command line&lt;/span&gt; &lt;span&gt;.Now with version 2.0.1 pfsense support config haproxy lastest version(1.4.8) via web interface(&lt;/span&gt; config easier).although it can not configure advanced features of haproxy through the web interface.&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;b&gt;II/Install&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;1/Install pfsense 2.0.1&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;2/Install haproxy (The package is available to install from System -&amp;gt; Packages)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;3/After Install done We configure Haproxy(Services -&amp;gt; Haproxy)click tab Setting and configure as image&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;a href="http://3.bp.blogspot.com/-LOEfhlbgBwA/TvQDFb9v1AI/AAAAAAAAAbU/nKDdBIP2lMM/s1600/1.JPG"&gt;&lt;img src="http://3.bp.blogspot.com/-LOEfhlbgBwA/TvQDFb9v1AI/AAAAAAAAAbU/nKDdBIP2lMM/s400/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5689175621216752642" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 286px; " border="0" /&gt;&lt;/a&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;4/Config with ip info:192.168.44.150(Haproxy),192.168.44.130(apache),192.168.44.131(nginx)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span&gt;III/Config Haproxy&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1/config Frontend for haproxy&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: center;"&gt;&lt;span&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;a href="http://2.bp.blogspot.com/-lsdAunwZJHU/TvQEE6fcU4I/AAAAAAAAAbg/CrRH4vYxt9A/s1600/2.JPG"&gt;&lt;img src="http://2.bp.blogspot.com/-lsdAunwZJHU/TvQEE6fcU4I/AAAAAAAAAbg/CrRH4vYxt9A/s400/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5689176711742903170" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 272px; " border="0" /&gt;&lt;/a&gt; &lt;a href="http://2.bp.blogspot.com/-7SCqh9STPvQ/TvQEegBV3_I/AAAAAAAAAbs/jSn-EjaXpBw/s1600/3.JPG"&gt;&lt;img src="http://2.bp.blogspot.com/-7SCqh9STPvQ/TvQEegBV3_I/AAAAAAAAAbs/jSn-EjaXpBw/s400/3.JPG" alt="" id="BLOGGER_PHOTO_ID_5689177151313928178" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 271px; " border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;a href="http://1.bp.blogspot.com/-hXXQ5f6ikI4/TvQEx2gH5QI/AAAAAAAAAb4/-VWo6D8lAiM/s1600/4.JPG"&gt;&lt;img src="http://1.bp.blogspot.com/-hXXQ5f6ikI4/TvQEx2gH5QI/AAAAAAAAAb4/-VWo6D8lAiM/s400/4.JPG" alt="" id="BLOGGER_PHOTO_ID_5689177483766129922" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 271px; " border="0" /&gt;&lt;/a&gt;2/Config Backend for haproxy&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;  a/config server A&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/-Dl5pV1a-FQs/TvQFwL7zj-I/AAAAAAAAAcE/bvh9xhE9SEo/s1600/5.JPG"&gt;&lt;img src="http://2.bp.blogspot.com/-Dl5pV1a-FQs/TvQFwL7zj-I/AAAAAAAAAcE/bvh9xhE9SEo/s400/5.JPG" alt="" id="BLOGGER_PHOTO_ID_5689178554671271906" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 289px; " border="0" /&gt;&lt;/a&gt; &lt;/div&gt;&lt;div&gt;&lt;div&gt;b/config server B&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a href="http://3.bp.blogspot.com/-VSGppWKbYLA/TvQF7iC66AI/AAAAAAAAAcQ/F02zJX05vgA/s1600/6.JPG"&gt;&lt;img src="http://3.bp.blogspot.com/-VSGppWKbYLA/TvQF7iC66AI/AAAAAAAAAcQ/F02zJX05vgA/s400/6.JPG" alt="" id="BLOGGER_PHOTO_ID_5689178749585254402" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 273px; " border="0" /&gt;&lt;/a&gt;3/Check status HAPROXY with URL:http://192.168.44.150/haproxy?stats&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/-gQUxadiTvAM/TvQG42Ev-BI/AAAAAAAAAcc/WcAlzfj_VeA/s1600/7.JPG"&gt;&lt;img src="http://1.bp.blogspot.com/-gQUxadiTvAM/TvQG42Ev-BI/AAAAAAAAAcc/WcAlzfj_VeA/s400/7.JPG" alt="" id="BLOGGER_PHOTO_ID_5689179802933655570" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 174px; " border="0" /&gt;&lt;/a&gt; &lt;/div&gt;&lt;div&gt;NOTE: You must add a firewall rule permitting access to frontend!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Thanks and Best Regards&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;quan.hoa@conheotiensinh.co.cc&lt;/div&gt;&lt;div&gt;&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/1767307989305526323-686710776843142809?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/686710776843142809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2011/12/config-haproxy-with-pfsense-version-201.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/686710776843142809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/686710776843142809'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2011/12/config-haproxy-with-pfsense-version-201.html' title='Config HAPROXY with PFSENSE version 2.0.1'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-wPxmOeg98ik/TvP-w-BKi1I/AAAAAAAAAaw/C6f4Q0iIqN0/s72-c/christmas.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-3543125077734151625</id><published>2010-08-23T09:14:00.005+07:00</published><updated>2010-08-23T09:57:38.557+07:00</updated><title type='text'>Query Recipient  Windows Active Directory directly</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;I/Intro&lt;/span&gt;&lt;div&gt;As Document &lt;a href="http://conheotiensinh.blogspot.com/2010/08/config-iredmail-as-mail-gatewayanti.html"&gt;http://conheotiensinh.blogspot.com/2010/08/config-iredmail-as-mail-gatewayanti.html&lt;/a&gt;.I intro to you how to query recipients use &lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;Perl&lt;/span&gt;&lt;/b&gt; and after discusses with  &lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;Zhang Huangbin&lt;/span&gt;&lt;/b&gt; and I promise with him.So today I will intro to you How to query recipient(real-time) Windows Active Directory directly.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;img src="http://2.bp.blogspot.com/_MzplYSbgF84/THHgmo_sikI/AAAAAAAAAaU/uXh4Zx88lF8/s400/11.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;II/Config &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;b&gt;Step 1:Create /etc/postfix/ldap_user.cf with info&lt;/b&gt;&lt;/span&gt;:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;server_host = 192.168.22.233 ##with 192.168.22.233 As Active Directory&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;search_base = dc=test, dc=vn&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;version = 3&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;query_filter = (&amp;amp;(objectclass=person)(mail=%s))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;result_attribute = samaccountname&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;bind = yes&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;bind_dn = test\admin # Account use query Recipient.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;bind_pw = 123 #pass use query Recipient&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;b&gt;Step 2: change config in /etc/postfix/main.cf&lt;/b&gt;&lt;/span&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="color:#3333FF;"&gt;relay_recipient_maps = hash:/etc/postfix/relay_recipients&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;To&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;relay_recipient_maps = ldap:/etc/postfix/ldap_user.cf&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;b&gt;Step 3:restart Postfix&lt;/b&gt;&lt;/span&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="color:#3333FF;"&gt;/etc/init.d/postfix restart&lt;/span&gt;&lt;/div&gt;&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;span class="Apple-style-span"  style="color:#FF0000;"&gt;Thanks Zhang Huangbin for suggest and Contribute&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Please let me know if you have question&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.blogger.com/quan.hoa@conheotiensinh.co.cc"&gt;quan.hoa@conheotiensinh.co.cc&lt;/a&gt;&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;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-3543125077734151625?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/3543125077734151625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2010/08/query-recipient-windows-active.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/3543125077734151625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/3543125077734151625'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2010/08/query-recipient-windows-active.html' title='Query Recipient  Windows Active Directory directly'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MzplYSbgF84/THHgmo_sikI/AAAAAAAAAaU/uXh4Zx88lF8/s72-c/11.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-5847161767378975909</id><published>2010-08-20T14:06:00.013+07:00</published><updated>2010-11-03T09:55:50.484+07:00</updated><title type='text'>Config Mail Gateway LINUX  less than 5 minutes (Anti-spam, Mail Anti-virus,Greylisting).</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;I/Intro&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As previous document I intro to you Iredmail as mail server in linux with full-featured (/Postfix/Dovecot/Amavisd/ClamAV/SpamAssassin/RoundCube/iRedAdmin/&lt;/div&gt;&lt;div&gt;postfixadmin).But With this document I will intro iredmail as mail gateway(because By default iredmail config /Amavisd/ClamAV/SpamAssassin/greylisting for anti spam and mail anti-virus).&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;II/Install Iredmail &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Install iredmail as normal But only choose phpmyadmin(for managed greylisting easier) and Awstats &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;III/Remove some services not use&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Because we setup iredmail as Mail gateway so We not use some services:dovecot,pysieved&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;IV/Change some config &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1/Edit /etc/postfix/main.cf&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;mydestination =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;local_recipient_maps =&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;local_transport =error:local mail delivery disabled&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;relay_recipient_maps = hash:/etc/postfix/relay_recipients&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;relay_domains = test.vn&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;transport_maps = hash:/etc/postfix/transport&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;comments all line with mysql_* or  ldap_*&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2/ edit /etc/postfix/master.cf&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;comment line&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;#local     unix  -       n       n       -       -       local&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3/edit /etc/postfix/transport&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;test.vn smtp:192.168.22.233 #with 192.168.22.233(IP mail server backend as exchange...)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;4/create  /etc/postfix/relay_recipients&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;u1@test.vn OK&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;u2@test.vn OK&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;ug@test.vn OK&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;u3@test.vn OK&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;u4@test.vn OK&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;5/hashing Databases&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;postmap /etc/postfix/transport&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;postmap /etc/postfix/relay_recipients&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;V/Populating relay_recipients from Active Directory&lt;/span&gt;&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;Note that this script requires perl and Net::LDAP(you need install perl-ldap by yum). However, this does NOT have to be on your email gateway.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Download &lt;a href="http://www-personal.umich.edu/%7Emalth/gaptuning/postfix/getadsmtp.pl"&gt;http://www-personal.umich.edu/~malth/gaptuning/postfix/getadsmtp.pl&lt;/a&gt;&lt;/div&gt;&lt;div&gt;Edit the script so that values below are correct:&lt;/div&gt;&lt;div&gt;$VALID = "/etc/postfix/relay_recipients";&lt;/div&gt;&lt;div&gt;$dc1="dc1.test.vn";&lt;/div&gt;&lt;div&gt;$dc2="dc2.test.vn";&lt;/div&gt;&lt;div&gt;$hqbase="cn=Users,dc=test,dc=vn";&lt;/div&gt;&lt;div&gt;$user="cn=user,cn=Users,dc=test,dc=vn";&lt;/div&gt;&lt;div&gt;$passwd="password";&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If You have any problem script perl please send mail to quan.hoa@conheotiensinh.co.cc.I will edit for you&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;VI/Create Bash shell automatic update relay_recipients from Active directory&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;create bash shell /opt/ad.sh with info:&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="color: rgb(255, 0, 0);"&gt;cd /etc/postfix  ; ./getadsmtp.pl &amp;amp;&amp;amp; &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;/usr/sbin/postmap relay_recipients&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;/usr/sbin/postfix reload&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;use crontab run as your schedule&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Beside you can use iredmail for multi domain(can get relay_recipients from Multi Active directory).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Thanks &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;quan.hoa@conheotiensinh.co.cc&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;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-5847161767378975909?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/5847161767378975909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2010/08/config-iredmail-as-mail-gatewayanti.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/5847161767378975909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/5847161767378975909'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2010/08/config-iredmail-as-mail-gatewayanti.html' title='Config Mail Gateway LINUX  less than 5 minutes (Anti-spam, Mail Anti-virus,Greylisting).'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-7743147120654198691</id><published>2010-08-13T10:10:00.019+07:00</published><updated>2010-08-13T11:23:29.475+07:00</updated><title type='text'>Config cluster Load balancer layer 7 support SSL with Heatbeat,Nginx and Haproxy</title><content type='html'>&lt;div style="text-align: left;"&gt;&lt;u&gt;&lt;div style="text-align: center; display: inline !important; "&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: none; "&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt;I/INTRO&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/u&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As Document &lt;a href="http://conheotiensinh.blogspot.com/2010/06/setting-up-high-availability-load.html"&gt;http://conheotiensinh.blogspot.com/2010/06/setting-up-high-availability-load.html&lt;/a&gt;.I config Haproxy load balance HTTPS with stunnel(It very easy for config and deploy).But with  stunnel you can't detech IP source access to haproxy and Performance can't same as Nginx.So I will intro to you 1 solution resove this problem with Nginx as SSL Reverse Proxy,Heartbeat as cluster and haproxy load balance.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Nginx [engine x] is a HTTP and reverse proxy server, as well as a mail proxy server written by Igor Sysoev. It has been running for more than five years on many heavily loaded Russian sites including Rambler (RamblerMedia.com). According to Netcraft nginx served or proxied 4.70% busiest sites in April 2010. Here are some of success stories: FastMail.FM, Wordpress.com,sourceforge.net....&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;span class="Apple-style-span"  style="font-size:x-large;"&gt;II/INSTALL&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Step 1:config IP As image&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://3.bp.blogspot.com/_MzplYSbgF84/TGS8l6zJxjI/AAAAAAAAAZs/1BzrOBaEyM4/s400/2.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Step 2:install haproxy by rpm packet(if you need install haproxy with last version 1.4.8.Please contact  me with email:quan.hoa@conheotiensinh.co.cc,I will give it to you) or you can download Haproxy  from  &lt;a href="http://rpm.pbone.net/"&gt;http://rpm.pbone.net/&lt;/a&gt; &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Step 3:install heartbeat as Document :&lt;a href="http://conheotiensinh.blogspot.com/2010/04/deploy-cluster-iptables-usefwbuider-and.html"&gt;http://conheotiensinh.blogspot.com/2010/04/deploy-cluster-iptables-usefwbuider-and.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Step 4:Install Nginx  by rpm packet(if you need install nginx with last version 0.7.67.Please contact me with email:quan.hoa@conheotiensinh.co.cc,I will give it to you) or you can download Nginx from  &lt;a href="http://rpm.pbone.net/"&gt;http://rpm.pbone.net/&lt;/a&gt; &lt;/div&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-large;"&gt;III/CONFIG&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Step 1:config haproxy on both Server .You config as image &lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://1.bp.blogspot.com/_MzplYSbgF84/TGTAw1K3S-I/AAAAAAAAAZ0/SjUz5uLn_C8/s400/4.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Step 2:Config heartbeat on both server as document &lt;a href="http://conheotiensinh.blogspot.com/2010/04/deploy-cluster-iptables-usefwbuider-and.html"&gt;http://conheotiensinh.blogspot.com/2010/04/deploy-cluster-iptables-usefwbuider-and.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Step 3:config Nginx on both serve as image&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://4.bp.blogspot.com/_MzplYSbgF84/TGTFIdXIYqI/AAAAAAAAAZ8/BKD7vCIXY5U/s400/6.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Step 4:access haproxy status pages with url &lt;a href="https://192.168.129.133/haproxy?stats"&gt;https://192.168.129.133/haproxy?stats&lt;/a&gt;&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;img src="http://3.bp.blogspot.com/_MzplYSbgF84/TGTHPl_yQMI/AAAAAAAAAaE/O8MMCP0Ujfw/s400/7.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Step 5:stop Server 1 and access haproxy status page:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://1.bp.blogspot.com/_MzplYSbgF84/TGTHv0jP9xI/AAAAAAAAAaM/RON_UDnt-Os/s400/8.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;if you have question.Please contact me with email quan.hoa@conheotiensinh.co.cc&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Thanks &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;quan.hoa@conheotiensinh.co.cc&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-7743147120654198691?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/7743147120654198691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2010/08/config-cluster-load-balancer-layer-7.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/7743147120654198691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/7743147120654198691'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2010/08/config-cluster-load-balancer-layer-7.html' title='Config cluster Load balancer layer 7 support SSL with Heatbeat,Nginx and Haproxy'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MzplYSbgF84/TGS8l6zJxjI/AAAAAAAAAZs/1BzrOBaEyM4/s72-c/2.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-8641169873163984589</id><published>2010-08-06T10:34:00.017+07:00</published><updated>2010-08-06T11:31:57.109+07:00</updated><title type='text'>LOADBALANCE WITH MULTI PPPoE INTERFACE IN PFSENSE 2.0</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;u&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;I/Intro&lt;/span&gt;&lt;/b&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now pfsense release version 1.2.3 .It only support 1 interface use PPPoE.But with pfsense 2.0(Beta 4)you can use multi interface use PPPoE and Version 2.0 change config load balance outbound.So  I will intro to you config multi interface use PPPoE.&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;b&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;II/Install Pfsense as previous Document&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;III/Config multi interface use PPPoE config as images&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://4.bp.blogspot.com/_MzplYSbgF84/TFuFJdYNNGI/AAAAAAAAAYc/znEK0bK-k50/s400/1.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://1.bp.blogspot.com/_MzplYSbgF84/TFuFPExDP-I/AAAAAAAAAYk/isQKU9ckOYE/s400/2.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note:you can create PPPoE Server for test this document with pfsense&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;IV/config load balance with pfsense&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As previous version (1.2.3)  you can config as &lt;a href="http://conheotiensinh.blogspot.com/2009/10/multi-wan-load-balancing-outbound-use.html"&gt; http://conheotiensinh.blogspot.com/2009/10/multi-wan-load-balancing-outbound-use.html&lt;/a&gt;.But with pfsense version 2.0 load balance outbound change config.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;   step1:config gateway (system -&gt;routing) config 2 gateway as images with 192.168.127.128 and 192.168.128.129  IP of PPPoe server (it will auto detect when connect via PPPoE)&lt;/div&gt;&lt;div&gt;  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://3.bp.blogspot.com/_MzplYSbgF84/TFuJGifPiUI/AAAAAAAAAY0/0Du41O-E0zg/s400/4.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://1.bp.blogspot.com/_MzplYSbgF84/TFuJBRV60kI/AAAAAAAAAYs/owqNGJg90LA/s400/3.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;step 2:config groups(system -&gt;routing)  change to Groups tab and create group as image &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;img src="http://3.bp.blogspot.com/_MzplYSbgF84/TFuMVqAjPkI/AAAAAAAAAY8/tbZ5Rq12V8w/s400/5.JPG" /&gt;&lt;/div&gt;&lt;div&gt;Step 3:view status of Gateway and Groups when 2 line connect&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://2.bp.blogspot.com/_MzplYSbgF84/TFuMxLksRxI/AAAAAAAAAZE/KCftnRkI6MY/s400/6.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://4.bp.blogspot.com/_MzplYSbgF84/TFuM1qSsaWI/AAAAAAAAAZM/eRiRhTMpJP0/s400/7.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Step 4:Test disconnect 1 interface and view status&lt;/div&gt;&lt;div&gt;&lt;img src="http://4.bp.blogspot.com/_MzplYSbgF84/TFuNuNDilOI/AAAAAAAAAZU/NE44xfKF1ac/s400/8.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://3.bp.blogspot.com/_MzplYSbgF84/TFuNwjdLL7I/AAAAAAAAAZc/OtoeEjWWgu4/s400/9.JPG" /&gt;&lt;/div&gt;&lt;div&gt;Step 5:create rule as image &lt;/div&gt;&lt;div&gt;&lt;img src="http://4.bp.blogspot.com/_MzplYSbgF84/TFuOd1GnC8I/AAAAAAAAAZk/mb4j1Gz_pZ4/s400/10.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Thanks&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Conheotiensinh(quan.hoa@conheotiensinh.co.cc)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-8641169873163984589?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/8641169873163984589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2010/08/loadbalance-with-multi-pppoe-interface.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/8641169873163984589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/8641169873163984589'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2010/08/loadbalance-with-multi-pppoe-interface.html' title='LOADBALANCE WITH MULTI PPPoE INTERFACE IN PFSENSE 2.0'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MzplYSbgF84/TFuFJdYNNGI/AAAAAAAAAYc/znEK0bK-k50/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-8498136278292169961</id><published>2010-06-01T09:28:00.010+07:00</published><updated>2010-06-01T13:17:31.493+07:00</updated><title type='text'>Setting Up A High-Availability Load Balancer HTTPS(With Failover and Session Support) With HAProxy/Keepalived/Stunnel</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/TAR5y0horEI/AAAAAAAAAYE/5mjBiKfHykw/s1600/diagram.JPG"&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/TAR5y0horEI/AAAAAAAAAYE/5mjBiKfHykw/s1600/diagram.JPG"&gt;&lt;span class="Apple-style-span" style="-webkit-text-decorations-in-effect: none; "&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt;&lt;b&gt;I/INTRO&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As this document &lt;a href="http://conheotiensinh.blogspot.com/2010/05/setting-up-high-availability-load_14.html"&gt;http://conheotiensinh.blogspot.com/2010/05/setting-up-high-availability-load_14.html&lt;/a&gt;.I setup load balancer for HTTP in Haproxy.But Haproxy not support SSL(HTTPS) directly So I will intro config haproxy support SSL use stunnel(As haproxy site require need install &lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;a href="http://www.stunnel.org/"&gt;Stunnel&lt;/a&gt;&lt;/span&gt;&lt;/b&gt; for support SSL(HTTPS...))&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;II/INSTALL&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://2.bp.blogspot.com/_MzplYSbgF84/TAR5y0horEI/AAAAAAAAAYE/5mjBiKfHykw/s400/diagram.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;1/Install haproxy and keepalived&lt;/span&gt;&lt;/b&gt; as document:&lt;a href="http://conheotiensinh.blogspot.com/2010/05/setting-up-high-availability-load_14.html"&gt;http://conheotiensinh.blogspot.com/2010/05/setting-up-high-availability-load_14.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;2/Install Stunnel&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;you need insert patch of haproxy to Stunnel packet(I build rpm packet with insert patch of haproxy.If you need it for install easy Please contact me with email:quan.hoa@conheotiensinh.co.cc)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;3/Config Keepalived&lt;/span&gt;&lt;/b&gt; as document:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;a href="http://conheotiensinh.blogspot.com/2010/05/setting-up-high-availability-load_14.html"&gt;http://conheotiensinh.blogspot.com/2010/05/setting-up-high-availability-load_14.html&lt;/a&gt;&lt;/div&gt;&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;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;4/config Haproxy in both loadbalance&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Edit /etc/haproxy/haproxy.cfg&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;stats enable&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;  stats auth test:123&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;listen domain_cluster_https 192.168.236.130:80&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;  mode http&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;  balance roundrobin&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;  cookie SERVERID insert nocache&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;  option forwardfor except 192.168.236.130&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;  option httpchk HEAD /check.txt HTTP/1.0&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;  server server1 192.168.127.131:80 cookie A check&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;  server server2 192.168.127.132:80 cookie B check&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;5/config Stunnel&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;Edit /etc/stunnel/stunnel.conf&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;cert = /etc/stunnel/monit.pem # you need install cert &lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;;key = /etc/stunnel/mail.key&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;; Some security enhancements for UNIX systems - comment them out on Win32&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;;chroot = /var/run/stunnel/&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;setuid = root&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;setgid = root&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;; PID is created inside chroot jail&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;;pid = /stunnel.pid&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;pid = /etc/stunnel/stunnel.pid&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;;debug = 3&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;;output = /etc/stunnel/stunnel.log&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;; Some performance tunings&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;socket = l:TCP_NODELAY=1&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;socket = r:TCP_NODELAY=1&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;[https]&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;    accept=192.168.236.130:443&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;    connect=192.168.236.130:80&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&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;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;6/Test You can access web mail with URL&lt;/span&gt;&lt;/b&gt;:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;https://192.168.236.130/mail&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;img src="http://2.bp.blogspot.com/_MzplYSbgF84/TAR59R6GdCI/AAAAAAAAAYM/I4A_dyNs_b8/s400/2.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Check status HAPROXY with URL:https://192.168.236.130/haproxy?stats&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;img src="http://2.bp.blogspot.com/_MzplYSbgF84/TAR6qW9aIFI/AAAAAAAAAYU/t6bqMYoYbRA/s400/3.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Beside You can use another solution for this problem:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Use Pound for Reverse Proxy( SSL )and Haproxy for load balancer&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Thanks&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-8498136278292169961?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/8498136278292169961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2010/06/setting-up-high-availability-load.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/8498136278292169961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/8498136278292169961'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2010/06/setting-up-high-availability-load.html' title='Setting Up A High-Availability Load Balancer HTTPS(With Failover and Session Support) With HAProxy/Keepalived/Stunnel'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MzplYSbgF84/TAR5y0horEI/AAAAAAAAAYE/5mjBiKfHykw/s72-c/diagram.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-6636708154814376209</id><published>2010-05-14T15:47:00.013+07:00</published><updated>2010-05-30T00:08:05.925+07:00</updated><title type='text'>Setting Up A High-Availability Load Balancer(With Failover and Session Support)  With HAProxy/Keepalived</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;I/INTRO&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;As you know,We any solution for load load blancer in Linux as:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Pfsense:&lt;a href="http://conheotiensinh.blogspot.com/2009/09/load-balance-and-cluster-failover.html"&gt;http://conheotiensinh.blogspot.com/2009/09/load-balance-and-cluster-failover.html&lt;/a&gt;Only support layer 4(can't deploy with system need Login)&lt;/div&gt;&lt;div&gt;PEN:&lt;a href="http://conheotiensinh.blogspot.com/2009/09/load-balance-web-server-use-pen.html"&gt;http://conheotiensinh.blogspot.com/2009/09/load-balance-web-server-use-pen.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Pen is a very simple load balancer for TCP protocols. It supports source IP-based persistence for up to 2048 clients. Supports IP-based ACLs. Uses select() and supports higher loads than Pound but will not scale very well to thousands of simultaneous connections.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;POUND:&lt;a href="http://conheotiensinh.blogspot.com/2009/08/load-balance-web-server-using-pound.html"&gt;http://conheotiensinh.blogspot.com/2009/08/load-balance-web-server-using-pound.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;Pound can be seen as a complement to HAProxy. It supports SSL, and can direct traffic according to the requested URL. Its code is very small and will stay small for easy auditing. Its configuration file is very small too. However, it does not support persistence, and the performance associated to its multi-threaded model limits its usage to medium sites only.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Beside We can use Linux Virtual Servers (LVS),Pure Load Balancer (PLB)But with load balance support layer 7 But with me HAproxy best choice.HAProxy is a free, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It is particularly suited for web sites crawling under very high loads while needing persistence or Layer 7 processing. Supporting tens of thousands of connections is clearly realistic with todays hardware. Its mode of operation makes its integration into existing architectures very easy and riskless, while still offering the possibility not to expose fragile web servers to the Net.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style=" ;font-size:x-large;"&gt;II/INSTALL&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style=" ;font-size:x-large;"&gt;&lt;img src="http://3.bp.blogspot.com/_MzplYSbgF84/S-0s59Q0BSI/AAAAAAAAAX8/SeKcWvN2jow/s400/1.JPG" /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style=" ;font-size:x-large;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  border-collapse: collapse; line-height: 18px; font-family:verdana, sans-serif;font-size:12px;"&gt;&lt;h3   style="padding-top: 0px; padding-right: 0px; padding-bottom: 0.2em; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(204, 204, 204);  font-weight: bold;  font-family:arial, verdana, sans-serif;font-size:14px;"&gt;&lt;span class="Apple-style-span" style=" font-weight: normal;  "&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt;For this howto I set up four Centos systems (minimal installation without gui etc.) with the following configuration:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; "&gt;&lt;span class="Apple-style-span" style=" font-weight: bold; "&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt; Load Balancer 1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; "&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt;IP: &lt;/span&gt;&lt;/span&gt;&lt;span class="system"  style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;    font-style: italic; font-family:'Courier New', Courier, mono;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt;192.168.236.128(eth0) and &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style=" font-style: italic; font-family:'Courier New', Courier, mono;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt;192.168.127.128(eth1)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt; Shared IP: &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style=" font-style: italic; font-family:'Courier New', Courier, mono;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt;192.168.236.130&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; "&gt; &lt;/p&gt;&lt;h4  style="padding-top: 0px; padding-right: 0px; padding-bottom: 0.1em; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.2em; margin-left: 0px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(204, 204, 204);  font-weight: bold; font-family:arial, verdana, sans-serif;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt; Load Balancer 2 &lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; "&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt;IP: &lt;/span&gt;&lt;/span&gt;&lt;span class="system"  style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;    font-style: italic; font-family:'Courier New', Courier, mono;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt;192.168.236.129 &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style=" font-style: italic; font-family:'Courier New', Courier, mono;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt;192.168.127.129(eth1)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt; Shared IP: &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style=" font-style: italic; font-family:'Courier New', Courier, mono;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt;192.168.236.130&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; "&gt; &lt;/p&gt;&lt;h4  style="padding-top: 0px; padding-right: 0px; padding-bottom: 0.1em; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.2em; margin-left: 0px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(204, 204, 204);  font-weight: bold; font-family:arial, verdana, sans-serif;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt; Web Server 1&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; "&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt;IP: &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style=" font-style: italic; font-family:'Courier New', Courier, mono;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt;192.168.127.130&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; "&gt; &lt;/p&gt;&lt;h4  style="padding-top: 0px; padding-right: 0px; padding-bottom: 0.1em; padding-left: 0px; margin-top: 1em; margin-right: 0px; margin-bottom: 0.2em; margin-left: 0px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(204, 204, 204);  font-weight: bold; font-family:arial, verdana, sans-serif;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt; Web Server 2&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; "&gt;&lt;span class="system"  style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;    font-style: italic; font-family:'Courier New', Courier, mono;"&gt;&lt;span class="Apple-style-span"  style=" font-style: normal; font-family:verdana, sans-serif;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0.8em; margin-left: 0px; "&gt;&lt;span class="system"  style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;    font-style: italic; font-family:'Courier New', Courier, mono;"&gt;&lt;span class="Apple-style-span"  style=" font-style: normal; font-family:verdana, sans-serif;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt;IP: &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style=" font-style: italic; font-family:'Courier New', Courier, mono;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="color:#FFFFFF;"&gt;192.168.127.132&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;1/Intall Haproxy and keepalived&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can install from source but for easier you need install rpm packet(if you need lastest rpm packet of HAPROXY(version 1.4.5) and Keepalived(version 1.1.20) .Please contact me with email:quan.hoa@conheotiensinh.co.cc.I will give it to you&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2/Edit /etc/haproxy/haproxy.cfg in both load balancer server as following:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;global&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;    log         127.0.0.1 local2&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;    chroot      /var/lib/haproxy&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;    pidfile     /var/run/haproxy.pid&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;    maxconn     4000&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;    user        haproxy&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;    group       haproxy&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;    daemon&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;defaults&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;    mode        http&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;    log         global&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;    option      dontlognull&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;    option      httpclose&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;    option      httplog&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;    option      forwardfor&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;    option      redispatch&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;    timeout connect 10000 # default 10 second time out if a backend is not found&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;    timeout client 300000&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;    timeout server 300000&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;    maxconn     60000&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;    retries     3&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;listen webfarm 192.168.236.130:80&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;mode http&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;       stats enable&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;       stats auth test:123&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;       #balance roundrobin&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;       balance source&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;       cookie JSESSIONID prefix&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;       #balance source&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;       #cookie SERVERID insert indirect&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;       option httpclose&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;       option forwardfor&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;       option httpchk HEAD /check.txt HTTP/1.0&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;       server web1 192.168.127.130:80 cookie A check&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;       server web2 192.168.127.132:80 cookie B check&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;3/Configure Keepalived&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As this Document I use keepalived for HA(beside you can use heartbeat and VRRP  for cluster)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;edit  /etc/keepalived/keepalived.conf in both load balance(only change priority 101 on master, 100 on backup)&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;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;vrrp_script chk_haproxy {           # Requires keepalived-1.1.13&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;        script "killall -0 haproxy"     # cheaper than pidof&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;        interval 2                      # check every 2 seconds&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;        weight 2                        # add 2 points of prio if OK&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;}&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;vrrp_instance VI_1 {&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;        interface eth0&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;        state MASTER&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;        virtual_router_id 51&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;        priority 101                    # 101 on master, 100 on backup&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;        virtual_ipaddress {&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;            192.168.236.130&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;        }&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;        track_script {&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;            chk_haproxy&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;        }&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;}&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4/Edit /etc/sysctl.conf in both load balance&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;# Allow HAProxy shared IP&lt;/div&gt;&lt;div&gt;net.ipv4.ip_nonlocal_bind = 1&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:'Courier New', Courier, mono;font-size:85%;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;5/Test&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I setup 2 webmail roundcube for test this haproxy&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; a/Login webmail and check log &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;img src="http://3.bp.blogspot.com/_MzplYSbgF84/S-0WHPp_FnI/AAAAAAAAAXk/2Lm7vOm0FGY/s400/3.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;b/Stop LB1 and check log in Load balance 2 &lt;/div&gt;&lt;div&gt;&lt;img src="http://3.bp.blogspot.com/_MzplYSbgF84/S-0W3RPS3cI/AAAAAAAAAXs/FrSQXWpUJjE/s400/4.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;c/Check status HAPROXY with URL:&lt;a href="http://192.168.236.130/haproxy?stats"&gt;http://192.168.236.130/haproxy?stats&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://1.bp.blogspot.com/_MzplYSbgF84/S-0Xgz1qiTI/AAAAAAAAAX0/6Jsmehz2P1k/s400/2.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Thanks&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/1767307989305526323-6636708154814376209?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/6636708154814376209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2010/05/setting-up-high-availability-load_14.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/6636708154814376209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/6636708154814376209'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2010/05/setting-up-high-availability-load_14.html' title='Setting Up A High-Availability Load Balancer(With Failover and Session Support)  With HAProxy/Keepalived'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MzplYSbgF84/S-0s59Q0BSI/AAAAAAAAAX8/SeKcWvN2jow/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-7533644465649295564</id><published>2010-04-06T13:24:00.023+07:00</published><updated>2010-04-09T11:51:30.637+07:00</updated><title type='text'>Deploy iptables Cluster using Fwbuilder and Heartbeat</title><content type='html'>&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;I/Intro&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As We know fwbuilder   is a GUI firewall configuration and       management tool that supports &lt;b&gt;iptables (netfilter), ipfilter,       pf, ipfw, Cisco PIX (FWSM, ASA) and Cisco routers extended       access lists&lt;/b&gt;. Both professional network administrators and       hobbyists managing firewalls with policies more complex that is       allowed by simple web based UI can simplify management tasks       with the application. The program runs on Linux, FreeBSD,       OpenBSD, Windows and Mac OS X and can manage both local and       remote firewalls.&lt;/div&gt;&lt;div&gt;    &lt;p&gt;     Firewall Builder is packaged with most Linux distributions. If the     package is not available in the base distribution, it usually can     be found in "extras". You need to install package that has     supporting API library &lt;b&gt;libfwbuilder&lt;/b&gt; and     package &lt;b&gt;fwbuilder&lt;/b&gt; that contains Firewall Builder GUI and     policy compilers. You can use your favorite package management     tool sucn as &lt;b&gt;yum&lt;/b&gt;, &lt;b&gt;apt-get&lt;/b&gt; or &lt;b&gt;aptitude&lt;/b&gt; to find     and install them. On FreeBSD and OpenBSD Firewall Builder is part     of ports, you can find it in &lt;b&gt;/usr/ports/security/fwbuilder&lt;/b&gt;. Now  The new version comes                       with support for &lt;strong&gt;high availability  firewall                       configurations&lt;/strong&gt;, including heartbeat,  vrrpd,                       keepalived, conntrackd on Linux, CARP and pfsync                       on OpenBSD and PIX failover configuration. It                       can generate configuration scripts to manage ip                       addresses, VLAN, bridge and bonding interfaces                       on the firewall.  Drop-in support for OpenWRT                       firewall script is now available, as well as                       experimental integration with IPCOP firewall                       appliances. The GUI has supports undo/redo of                       unlimited depth and was generally streamlined                       and has many other improvements.you can prefer:&lt;a href="http://www.fwbuilder.org/"&gt;http://www.fwbuilder.org/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-size:x-large;"&gt;2/Install &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;Step 1:config IP  for  2 firewall as image&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/S7rn2oV9NTI/AAAAAAAAAWk/m_CGexWFZGk/s1600/2.jpg"&gt;&lt;img style="text-align: left; display: block; margin: 0px auto 10px; cursor: pointer; width: 311px; height: 400px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/S7rn2oV9NTI/AAAAAAAAAWk/m_CGexWFZGk/s400/2.jpg" alt="" id="BLOGGER_PHOTO_ID_5456928824241239346" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;Step 2:install heartbeat &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;    yum -y install heartbeat&lt;/b&gt;&lt;/p&gt;&lt;div class="color1"&gt;&lt;b&gt;    yum -y install heartbeat#  run again becaus of errors&lt;/b&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;Step 3:copy file configure default.It's necessary to do this on both systems&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;cp  /usr/share/doc/heartbeat-2.1.3/authkeys  /etc/ha.d/authkeys &lt;/p&gt;&lt;p&gt;cp  /usr/share/doc/heartbeat-2.1.3/ ha.cf  etc/ha.d/ha.cf &lt;/p&gt;&lt;p&gt;cp  /usr/share/doc/heartbeat-2.1.3/haresources  etc/ha.d/haresources &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;Step 4 :Edit /etc/ha.d/authkeys It's necessary to do this on both systems&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;auth 3&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;b&gt;3 md5 123&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;Step 5:edit etc/ha.d/ha.cf.It's necessary to do this on both systems&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;keepalive 2 #line 52&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;deadtime 10 # line 60&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;mcast eth0 225.0.0.1 694 1 0 #line 117&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;mcast eth1 225.0.0.1 694 1 0 #line 118&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;node fw1.test.vn  #add it in  BOTTOM&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;node fw2.test.vn #add it in  BOTTOM&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;step 6:edit etc/ha.d/haresources &lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;fw1.test.vn             IPaddr::192.168.10.145/24/eth0/192.168.10.255&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;fw1.test.vn             IPaddr::172.16.1.3/16/eth1/172.16.255.255&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;Step 7:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="emphasis"&gt;&lt;em&gt;&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="emphasis"&gt;&lt;em&gt;authkeys&lt;/em&gt;&lt;/span&gt; should have permissions         "0600", other files can have permissions "0644"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;&lt;b&gt;Step 8:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;/etc/init.d/heartbeat start&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;Step 9:Install fwbuilder &lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;#rpm -Uvh  libfwbuilder*&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;#rpm -Uvh  fwbuilder*&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;Step 10:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Create 2 fw as image in Fwbuilder&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_MzplYSbgF84/S7rnzpBMpZI/AAAAAAAAAWc/FeUJ5O3Sr-Q/s1600/1.JPG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 316px;" src="http://3.bp.blogspot.com/_MzplYSbgF84/S7rnzpBMpZI/AAAAAAAAAWc/FeUJ5O3Sr-Q/s400/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5456928772882998674" border="0" /&gt;&lt;/a&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;Step 11:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_MzplYSbgF84/S7rn59_7IRI/AAAAAAAAAWs/B1-iXtjg8-g/s1600/3.JPG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 290px;" src="http://3.bp.blogspot.com/_MzplYSbgF84/S7rn59_7IRI/AAAAAAAAAWs/B1-iXtjg8-g/s400/3.JPG" alt="" id="BLOGGER_PHOTO_ID_5456928881594016018" border="0" /&gt;&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;Step 12:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;we can open udp port 694 and  udp port 3780 in both fw&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;Step 13:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Create  Nat and Policy  for cluster (it created as fwbuilder stand alone)&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_MzplYSbgF84/S7rn59_7IRI/AAAAAAAAAWs/B1-iXtjg8-g/s1600/3.JPG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 290px;" src="http://3.bp.blogspot.com/_MzplYSbgF84/S7rn59_7IRI/AAAAAAAAAWs/B1-iXtjg8-g/s400/3.JPG" alt="" id="BLOGGER_PHOTO_ID_5456928881594016018" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;Step 14:Test&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_MzplYSbgF84/S7rn8pOEQwI/AAAAAAAAAW0/lALjyNNGLvQ/s1600/4.JPG"&gt;&lt;img style="text-align: left; display: block; margin: 0px auto 10px; cursor: pointer; width: 400px; height: 320px;" src="http://3.bp.blogspot.com/_MzplYSbgF84/S7rn8pOEQwI/AAAAAAAAAW0/lALjyNNGLvQ/s400/4.JPG" alt="" id="BLOGGER_PHOTO_ID_5456928927555797762" border="0" /&gt;&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/S7rn_PdUw6I/AAAAAAAAAW8/vpluQ7Oat6Q/s1600/5.JPG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 320px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/S7rn_PdUw6I/AAAAAAAAAW8/vpluQ7Oat6Q/s400/5.JPG" alt="" id="BLOGGER_PHOTO_ID_5456928972180079522" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;shutdown fw1 test again&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/S7rp7HiUOnI/AAAAAAAAAXE/xEPHxvW1FNY/s1600/6.JPG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 320px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/S7rp7HiUOnI/AAAAAAAAAXE/xEPHxvW1FNY/s400/6.JPG" alt="" id="BLOGGER_PHOTO_ID_5456931100357311090" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/S7rp-RCIJDI/AAAAAAAAAXM/OApkjHW9qBI/s1600/7.JPG"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 320px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/S7rp-RCIJDI/AAAAAAAAAXM/OApkjHW9qBI/s400/7.JPG" alt="" id="BLOGGER_PHOTO_ID_5456931154446263346" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;start fw1 test again &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_MzplYSbgF84/S7rn8pOEQwI/AAAAAAAAAW0/lALjyNNGLvQ/s1600/4.JPG"&gt;&lt;img style="text-align: left; display: block; margin: 0px auto 10px; cursor: pointer; width: 400px; height: 320px;" src="http://3.bp.blogspot.com/_MzplYSbgF84/S7rn8pOEQwI/AAAAAAAAAW0/lALjyNNGLvQ/s400/4.JPG" alt="" id="BLOGGER_PHOTO_ID_5456928927555797762" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;beside you can use vrrp,carp.... for cluster.&lt;/p&gt;&lt;p&gt;if you need file template for config .Please send mail to quan.hoa@conheotiensinh.co.cc.I Will send it to you&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Thanks&lt;/p&gt;&lt;p&gt;&lt;a href="http://conheotiensinh.blogspot.com/"&gt;http://conheotiensinh.blogspot.com/&lt;/a&gt;&lt;/p&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/1767307989305526323-7533644465649295564?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/7533644465649295564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2010/04/deploy-cluster-iptables-usefwbuider-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/7533644465649295564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/7533644465649295564'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2010/04/deploy-cluster-iptables-usefwbuider-and.html' title='Deploy iptables Cluster using Fwbuilder and Heartbeat'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MzplYSbgF84/S7rn2oV9NTI/AAAAAAAAAWk/m_CGexWFZGk/s72-c/2.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-7441059893180820396</id><published>2009-12-31T13:34:00.007+07:00</published><updated>2009-12-31T15:29:10.145+07:00</updated><title type='text'>INSTALL IPS(SNORT) WITH EasyIDS and Guardian</title><content type='html'>I/Intro&lt;br /&gt;&lt;br /&gt;An Intrusion prevention system (IPS) is a network security device that monitors network and/or system activities for malicious or unwanted behavior and can react, in real-time, to block or prevent those activities. Network-based IPS, for example, will operate in-line to monitor all network traffic for malicious code or attacks . When an attack is detected, it can drop the offending packets while still allowing all other traffic to pass. Intrusion prevention technology is considered by some to be an extension of intrusion detection (IDS) technology&lt;br /&gt;&lt;br /&gt;II/INSTALL&lt;br /&gt;&lt;br /&gt;Step 1:Install IDS as &lt;a href="http://conheotiensinh.blogspot.com/2009/12/install-ids-in-centos-with-5-minutes.html"&gt;http://conheotiensinh.blogspot.com/2009/12/install-ids-in-centos-with-5-minutes.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 2:IPS – Guardian&lt;br /&gt;&lt;br /&gt;Guardian is a security program which works in conjunction with Snort to automaticly update firewall rules based on alerts generated by Snort.&lt;br /&gt;The updated firewall rules block all incoming data from the IP address of the attacking machine (the machine which caused Snort to generate an alert.&lt;br /&gt;There is also logic in place which pervents blocking important machines, such as DNS servers, gateways, and whatever else you want.&lt;br /&gt;&lt;br /&gt;Step 3:&lt;br /&gt;&lt;br /&gt;Go to &lt;a href="http://www.chaotic.org/guardian/"&gt;http://www.chaotic.org/guardian/&lt;/a&gt; to download Guardian. The current version as at this writing is version 1.7.&lt;br /&gt;#wget &lt;a href="http://www.chaotic.org/guardian/guardian-1.7.tar.gz"&gt;&lt;code&gt;http://www.chaotic.org/guardian/guardian-1.7.tar.gz&lt;/code&gt;&lt;/a&gt;&lt;br /&gt;#&lt;code&gt;tar -xzvf guardian-1.7.tar.gz&lt;br /&gt;#&lt;/code&gt;&lt;code&gt;cd guardian-1.7&lt;br /&gt;#cp guardian.pl /usr/local/bin/&lt;br /&gt;#cp scripts/iptables_block.sh /usr/local/bin/guardian_block.sh&lt;br /&gt;#cp scripts/iptables_unblock.sh /usr/local/bin/guardian_unblock.sh&lt;br /&gt;#cp guardian.conf /etc/snort/&lt;br /&gt;#touch /etc/snort/guardian.ignore&lt;br /&gt;#touch /etc/snort/guardian.target&lt;br /&gt;#touch /var/log/snort/guardian.log&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Step 4:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;edit /etc/snort/guardian.conf&lt;/code&gt;  change some variables&lt;br /&gt;&lt;br /&gt;&lt;code&gt;HostIpAddr xxx.xxx.xxx.xxx (IP snort monitor)&lt;br /&gt;Interface ETH01 (interface snort monitor)&lt;br /&gt;HostGatewayByte   75&lt;br /&gt;Logfile /var/log/snort/guardian.log&lt;br /&gt;AlertFile /var/log/messages&lt;br /&gt;IgnoreFile /etc/snort/guardian.ignore&lt;br /&gt;TargetFile /etc/snort/guardian.target&lt;br /&gt;TimeLimit 86400&lt;br /&gt;&lt;br /&gt;Step 5:&lt;br /&gt;&lt;/code&gt;&lt;code&gt;Edit /usr/local/bin/guardian_block.sh&lt;/code&gt; change some variables(this shell will block ip attacker and alert mail to &lt;code&gt;test@conheotiensinh.co.cc&lt;/code&gt; )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;source=$1&lt;br /&gt;interface=$2&lt;br /&gt;&lt;br /&gt;/sbin/iptables -I INPUT -s $source -i $interface -j DROP&lt;br /&gt;/sbin/iptables -I FORWARD -s $source -i $interface -j DROP&lt;br /&gt;&lt;code&gt;echo "$source is blocked!" | mail -s "Snort alert is blocked" test@conheotiensinh.co.cc&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;Step 6:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;Edit /usr/local/bin/guardian_unblock.sh&lt;/code&gt; change some variables(this shell will delete ip attaker from block ip and alert mail to &lt;code&gt;test@conheotiensinh.co.cc&lt;/code&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;source=$1&lt;br /&gt;interface=$2&lt;br /&gt;&lt;br /&gt;/sbin/iptables -D INPUT -s $source -i $interface -j DROP&lt;br /&gt;/sbin/iptables -D FORWARD -s $source -i $interface -j DROP&lt;br /&gt;&lt;br /&gt;&lt;code&gt;echo "$source is blocked for 24 hours!  It is released!" | mail -s "Snort alert is released" &lt;/code&gt;&lt;code&gt;test@conheotiensinh.co.cc&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Step 7:&lt;br /&gt;&lt;br /&gt;Edit &lt;code&gt;/etc/snort/guardian.target&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;add ip (snort monitor)&lt;br /&gt;&lt;br /&gt;Step 8:&lt;code&gt;&lt;br /&gt;Edit /etc/snort/guardian.ignore&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;add ip 127.0.0.1&lt;br /&gt;&lt;br /&gt;Step 9:&lt;code&gt;&lt;br /&gt;&lt;br /&gt;Edit /etc/snort/snort.conf&lt;/code&gt;&lt;br /&gt;uncomment “output alert_syslog: LOG_AUTH LOG_ALERT” &lt;p&gt;&lt;code&gt;service snort restart&lt;/code&gt;&lt;/p&gt;Step 10:create file shell &lt;code&gt;guardian.sh &lt;/code&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;#————— CUT HERE —————–#&lt;/span&gt; &lt;p style="color: rgb(255, 0, 0);"&gt; &lt;code&gt;#!/bin/bash&lt;/code&gt;&lt;/p&gt; &lt;p style="color: rgb(255, 0, 0);"&gt;&lt;code&gt;start()&lt;br /&gt;{&lt;br /&gt;export PATH=$PATH:/usr/local/bin&lt;br /&gt;/usr/local/bin/guardian.pl -c /etc/snort/guardian.conf&lt;br /&gt;}&lt;/code&gt;&lt;/p&gt; &lt;p style="color: rgb(255, 0, 0);"&gt;&lt;code&gt;stop()&lt;br /&gt;{&lt;br /&gt;ps aux | grep 'guardian.pl *-c' 2&gt;&amp;amp;1 &gt; /dev/null&lt;br /&gt;if [ $? -eq 0 ];&lt;br /&gt;then&lt;br /&gt;kill `ps aux | grep 'guardian.pl *-c' | awk '{print $2}'`&lt;br /&gt;else&lt;br /&gt;echo "Guardian is not running ....."&lt;br /&gt;fi&lt;br /&gt;}&lt;/code&gt;&lt;/p&gt; &lt;p style="color: rgb(255, 0, 0);"&gt;&lt;code&gt;status()&lt;br /&gt;{&lt;br /&gt;ps aux | grep 'guardian.pl *-c' 2&gt;&amp;amp;1 &gt; /dev/null&lt;br /&gt;if [ $? -eq 0 ];&lt;br /&gt;then&lt;br /&gt;echo "Guardian is Running ....."&lt;br /&gt;else&lt;br /&gt;echo "Guardian is not Running ...."&lt;br /&gt;fi&lt;br /&gt;}&lt;/code&gt;&lt;/p&gt; &lt;code style="color: rgb(255, 0, 0);"&gt;case "$1" in&lt;br /&gt;start)&lt;br /&gt;start&lt;br /&gt;;;&lt;br /&gt;stop)&lt;br /&gt;stop&lt;br /&gt;;;&lt;br /&gt;restart)&lt;br /&gt;stop&lt;br /&gt;start&lt;br /&gt;;;&lt;br /&gt;status)&lt;br /&gt;status;;&lt;br /&gt;*)&lt;br /&gt;echo $"Usage: $0 {start|stop|restart|status}"&lt;br /&gt;esac&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Step 11:&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;code&gt;chmod +x guardian.sh&lt;/code&gt;&lt;br /&gt;&lt;code&gt;cp guardian.sh /usr/local/bin/guardian.sh&lt;span style="font-family:Georgia,serif;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;/usr/local/bin/guardian.sh start&lt;/code&gt;&lt;/p&gt;&lt;p&gt;Step 12:test&lt;/p&gt;&lt;p&gt;&lt;code&gt;use nmap test&lt;br /&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;#nmap -v -sS xxx.xxx.xxx.xxx&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;&lt;code&gt;Beside you can use Easy IDS as IPS with other Firewall:&lt;/code&gt;FreeBSD using IPFW,Checkpoint, PIX....use SSH copy rule to firewall&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Please prefer:&lt;a href="http://www.chaotic.org/guardian/"&gt;http://www.chaotic.org/guardian/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-7441059893180820396?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/7441059893180820396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/12/install-ipssnort-with-easyids-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/7441059893180820396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/7441059893180820396'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/12/install-ipssnort-with-easyids-and.html' title='INSTALL IPS(SNORT) WITH EasyIDS and Guardian'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-6378889001749805574</id><published>2009-12-29T10:40:00.007+07:00</published><updated>2009-12-30T10:49:13.154+07:00</updated><title type='text'>Install IDS in Centos with 5 minutes</title><content type='html'>&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span"  style="color:#0000EE;"&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;I/Intro&lt;br /&gt;&lt;br /&gt;An Intrusion detection system (IDS) is a device (or application) that monitors network and/or system activities for malicious activities or policy violation.IDS install very hard (you need install Snort,HTTP,MYSQL and ......). But With EasyIDS you install IDS easier&lt;br /&gt;&lt;br /&gt;II/Install&lt;br /&gt;&lt;br /&gt;Step 1:you download ISO EasyIDS from http://sourceforge.net/projects/easyids/files/&lt;br /&gt;&lt;br /&gt;Step 2:install It as install Centos OS (EasyIDS 4.0 run with Centos 5.4)&lt;br /&gt;&lt;br /&gt;Step3:config Ip for Nic Card&lt;br /&gt;&lt;br /&gt;Setp 4: &lt;span style="font-size:85%;"&gt;To access the EasyIDS GUI browse to https://IPADDRESS from another computer and login with the username &lt;strong&gt;admin&lt;/strong&gt; and the password &lt;strong&gt;password&lt;/strong&gt;.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Step 5:atttack Easy IDS and check Status in Easy IDS&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://2.bp.blogspot.com/_MzplYSbgF84/SzrNDSA0plI/AAAAAAAAAWU/M1EFokQ6PsQ/s400/1.JPG" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Beside you can use Easey IDS as IPS(Intrusion Prevention System) with iptables and  Guardian.I will intro later&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Thanks&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-6378889001749805574?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/6378889001749805574/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/12/install-ids-in-centos-with-5-minutes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/6378889001749805574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/6378889001749805574'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/12/install-ids-in-centos-with-5-minutes.html' title='Install IDS in Centos with 5 minutes'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MzplYSbgF84/SzrNDSA0plI/AAAAAAAAAWU/M1EFokQ6PsQ/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-3284265701189097093</id><published>2009-12-04T11:20:00.004+07:00</published><updated>2009-12-04T13:05:35.975+07:00</updated><title type='text'>INSTALL  Monit for Monitor System</title><content type='html'>&lt;span style="font-weight: bold;font-size:180%;" &gt;I/INTRO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Monit is a free open source utility for managing and monitoring, processes, files, directories and filesystems on a UNIX system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold;"&gt;II/INSTALL&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Step 1:Install monit&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;#wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;#rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.i386.rpm&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;#yum install monit&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;#chkconfig --levels 235 monit on&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Step 2:Config Monit&lt;br /&gt;&lt;br /&gt;edit /etc/moni.d/monitrc&lt;br /&gt;&lt;pre&gt;set daemon  60&lt;br /&gt;set logfile syslog facility log_daemon&lt;br /&gt;set mailserver localhost #mail server&lt;br /&gt;set mail-format { from: monit@server1.example.com }&lt;br /&gt;set alert root@localhost #alert to admin with email adrress root@localhost&lt;br /&gt;set httpd port 2812 and&lt;br /&gt;  SSL ENABLE&lt;br /&gt;  PEMFILE  /var/certs/monit.pem&lt;br /&gt;  allow admin:test&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;some features example  of monit&lt;br /&gt;&lt;br /&gt;*check host CUIBAP with address 19.16.12.32&lt;br /&gt;     if failed icmp type echo with timeout 20 seconds then alert&lt;br /&gt;(check host if over 20 second it will alert mail to admin)&lt;br /&gt;&lt;br /&gt;*check host CONHEO with address 132.163.193.3&lt;br /&gt;    if failed port 25 with timeout 30 seconds then alert&lt;br /&gt;(check Service SMTP  if over 30 second it will alert mail to admin)&lt;br /&gt;&lt;br /&gt;*check process sshd with pidfile /var/run/sshd.pid&lt;br /&gt; start program  "/etc/init.d/sshd start"&lt;br /&gt; stop program  "/etc/init.d/sshd stop"&lt;br /&gt; if failed port 22 protocol ssh then restart&lt;br /&gt; if failed port 22 protocol ssh then alert&lt;br /&gt; if 5 restarts within 5 cycles then timeout&lt;br /&gt;(check Service SSH if it down monit auto start only run in localhost)&lt;br /&gt;&lt;br /&gt;Step 3:access monit via web mail port 2812&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SximOmsHkQI/AAAAAAAAAWM/GzPnlxVH1LQ/s1600-h/1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 284px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SximOmsHkQI/AAAAAAAAAWM/GzPnlxVH1LQ/s400/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5411257722119622914" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-3284265701189097093?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/3284265701189097093/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/12/install-monit-for-monitor-system.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/3284265701189097093'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/3284265701189097093'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/12/install-monit-for-monitor-system.html' title='INSTALL  Monit for Monitor System'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MzplYSbgF84/SximOmsHkQI/AAAAAAAAAWM/GzPnlxVH1LQ/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-128216010570236496</id><published>2009-12-03T16:22:00.027+07:00</published><updated>2010-08-13T08:49:58.566+07:00</updated><title type='text'>Install Iredmail use LDAP and Groupware Server use SOGO</title><content type='html'>&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold;"&gt;I/INTRO&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As document previous I intro to you how to install iredmail use Mysql as backend &lt;a href="http://conheotiensinh.blogspot.com/2009/08/install-linux-mail-server-with-5.html"&gt;http://conheotiensinh.blogspot.com/2009/08/install-linux-mail-server-with-5.html&lt;/a&gt;.Today I Will intro to you how to install iredmail use LDAP as backend(config &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;iredadmin&lt;/span&gt; for admin mailbox .If you use Mysql as backend(postfixadmin)).Beside I will intro install and config Groupware Server use &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;&lt;a href="http://www.sogo.nu/"&gt;SOGO&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;*&lt;b&gt;SOGo&lt;/b&gt; is groupware server with a focus on scalability and open standards.  &lt;p&gt;&lt;b&gt;   *SOGo&lt;/b&gt; provides a rich AJAX-based Web interface and supports multiple native clients through the use of standard protocols such as CalDAV, CardDAV and GroupDAV. &lt;/p&gt; &lt;p&gt;&lt;b&gt;   *SOGo&lt;/b&gt; is the missing component of your infrastructure; it sits in the middle of your servers to offer your users an uniform and complete interface to access their information. It has been deployed in production environments where &lt;b&gt;thousands of users&lt;/b&gt; are involved.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold;"&gt;II/INSTALL&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;  &lt;span style="color: rgb(51, 51, 255);font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;1/Install iredmail&lt;/span&gt;&lt;/span&gt; as normal but attention ! you choose ldap as backend password of account postmaster&lt;br /&gt;&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SxeHqM-YRjI/AAAAAAAAAVU/bV9rt8behv8/s1600-h/1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 229px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SxeHqM-YRjI/AAAAAAAAAVU/bV9rt8behv8/s400/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5410942636416058930" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SxeHvv2qpWI/AAAAAAAAAVc/harE-F1yDno/s1600-h/8.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 185px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SxeHvv2qpWI/AAAAAAAAAVc/harE-F1yDno/s400/8.JPG" alt="" id="BLOGGER_PHOTO_ID_5410942731678295394" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;2/Install and config Iredadmin&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Default after install finish you can use phpldapadmin for admin mailbox but It very hard for config&lt;br /&gt;&lt;br /&gt;Step 1:install package need for install iredadmin&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code style="font-weight: bold; color: rgb(255, 0, 0);"&gt;#yum install python-setuptools.noarch MySQL-python.i386 \&lt;br /&gt;gcc.i386 gcc-c++.i386 openssl-devel.i386 python-devel.i386 \&lt;br /&gt;openldap-devel.i386&lt;/code&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);font-family:Georgia,serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;#easy_install web.py Jinja2 python-ldap==2.3.8 netifaces&lt;/span&gt;&lt;code style="font-weight: bold; color: rgb(255, 0, 0);"&gt;&lt;br /&gt;#&lt;/code&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;rpm -ivh http://www.iredmail.org/yum/rpms/5/mod_wsgi-2.5-2.ired.i386.rpm&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Step 2:download Iredadmin(you need buy liscense because open source version only fearture create mailbox not create maillist but you can use phpldapadmin  create mailist ) from &lt;a href="http://iredmail.googlecode.com/files/iRedAdmin-0.1.1.tar.bz2"&gt;http://iredmail.googlecode.com/files/iRedAdmin-0.1.1.tar.bz2 &lt;/a&gt;&lt;br /&gt;Step 3:&lt;span&gt;Copy iRedAdmin to &lt;strong&gt;/var/www/&lt;/strong&gt;, set correct file permissions&lt;br /&gt;Step 4:&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: left;"&gt;&lt;pre&gt;&lt;code&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;$ tar xjf iRedAdmin-0.1.1.tar.bz2 -C /var/www/&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;&lt;br /&gt;$ cd /var/www/&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;$ chown -R root:root iRedAdmin-0.1.1&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;&lt;br /&gt;$ chmod -R 0755 iRedAdmin-0.1.1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;$ ln -s iRedAdmin-0.1.1 iredadmin &lt;/span&gt;  &lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;    Step 5:&lt;span&gt;&lt;/span&gt;&lt;span&gt;Add apache configure file: &lt;strong&gt;/etc/httpd/conf.d/iredadmin.conf&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; AddType text/html .py&lt;/span&gt;  &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;                    &lt;directory var="" www="" iredadmin=""&gt;&lt;/directory&gt;&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;                    Order deny,allow&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;                      Allow from all&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;                      &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Step 6:&lt;/span&gt;&lt;span&gt;&lt;/span&gt;Edit /etc/httpd/conf.d/ssl.conf, make iredadmin accessable via HTTPS. Add below lines before :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;   WSGIScriptAlias /iredadmin /var/www/iredadmin/iredadmin.py/&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;                   Alias /iredadmin/static /var/www/iredadmin/static/&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;     Step 7:restart apache&lt;br /&gt;&lt;br /&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;/etc/init.d/httpd restart&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Step 8:&lt;/span&gt;&lt;span&gt;Create MySQL database: iredadmin and grant privileges&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; $ mysql -uroot -p&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;mysql&gt; CREATE DATABASE iredadmin DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;                mysql&gt; USE iredadmin;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;&lt;br /&gt;mysql&gt; SOURCE /var/www/iredadmin/docs/samples/iredadmin.sql;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;GRANT SELECT,INSERT,UPDATE,DELETE ON iredadmin.* TO&lt;br /&gt;iredadmin@localhost IDENTIFIED BY '123' ;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;FLUSH PRIVILEGES;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Step 9:Configure iRedAdmin&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;        $ cd /var/www/iredadmin/&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;                   $ cp settings.ini.sample settings.ini&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;Edit settings.ini and set several variables&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_MzplYSbgF84/SxeROYn4rZI/AAAAAAAAAVk/_lxCjEjrfTo/s1600-h/2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 320px;" src="http://3.bp.blogspot.com/_MzplYSbgF84/SxeROYn4rZI/AAAAAAAAAVk/_lxCjEjrfTo/s400/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5410953153622879634" border="0" /&gt;&lt;/a&gt;               &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;        $ &lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; chmod -w settings.ini&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Step 10:access iredamin:https://your_server_ip_address/iredadmin/&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_MzplYSbgF84/SxeSh-5uVRI/AAAAAAAAAVs/bi41X7gUReI/s1600-h/3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 177px;" src="http://3.bp.blogspot.com/_MzplYSbgF84/SxeSh-5uVRI/AAAAAAAAAVs/bi41X7gUReI/s400/3.JPG" alt="" id="BLOGGER_PHOTO_ID_5410954589827388690" border="0" /&gt;&lt;/a&gt;&lt;span style="color: rgb(51, 102, 255);font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;3/Install and config SOGO&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Step 1:create repo for install SOGO by yum&lt;br /&gt;create file /etc/yum.repos.d/inverse.repo with info&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; [RHEL5]&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;              name=Inverse SOGo Repository&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;              baseurl=http://inverse.ca/downloads/SOGo/RHEL5/$basearch&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;              gpgcheck=0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Step 2:install sogo&lt;br /&gt;&lt;br /&gt;#yum install sogo&lt;br /&gt;#yum install sope49-gdl1-postgresql(you can use mysql or oracle)&lt;br /&gt;&lt;br /&gt;Step 3:Because SOGo requires a relational database system in order to store appointments, tasks and contacts  information. It also uses the database system to store personal preferences of SOGo users.You need create DB and Grand permission&lt;br /&gt;&lt;br /&gt;Step 4:Edit /home/sogo/GNUstep/Defaults/.GNUstepDefaults as image&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SxeVq-Snu7I/AAAAAAAAAV0/qyXodkzmqoA/s1600-h/4.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 344px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SxeVq-Snu7I/AAAAAAAAAV0/qyXodkzmqoA/s400/4.JPG" alt="" id="BLOGGER_PHOTO_ID_5410958042817084338" border="0" /&gt;&lt;/a&gt;Step 5:you need install add-on for thurderbird&lt;div&gt;&lt;a href="http://www.sogo.nu/fr/downloads/frontends.html"&gt;http://www.sogo.nu/fr/downloads/frontends.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 6:config thunderbird&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you only use the SOGo Connector plug in, you can still easily access your data.&lt;br /&gt;To access your personal address book:&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Choose Go &gt; Address Book.&lt;/span&gt;  &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Choose File &gt; New &gt; Remote Address Book.&lt;/span&gt;  &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;&lt;br /&gt;Enter a signifcant name for your calendar in the Name feld.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Type the following URL in the URL feld:&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;http://localhost/SOGo/dav/u1/Contacts/personal/&lt;/span&gt;  &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Click on OK.&lt;/span&gt;  &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;&lt;br /&gt;To access your personal calendar:&lt;/span&gt;  &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Choose Go &gt; Calendar.&lt;/span&gt;  &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;&lt;br /&gt;Choose Calendar &gt; New Calendar.&lt;/span&gt;  &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Select On the Network and click on Continue.&lt;/span&gt;  &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Select CalDAV.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Type the following URL in the URL feld:&lt;/span&gt;  &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;http://localhost/SOGo/dav/u1/Calendar/personal/&lt;/span&gt;  &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Click on Continue.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;STep 7:Test create 1 calendar in web it will auto sync to thunderbird&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SxeYVIQfBWI/AAAAAAAAAV8/2E0LGZF5MMI/s1600-h/5.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 271px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SxeYVIQfBWI/AAAAAAAAAV8/2E0LGZF5MMI/s400/5.JPG" alt="" id="BLOGGER_PHOTO_ID_5410960966070240610" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SxeYdqN6_8I/AAAAAAAAAWE/ROPioWQ-Dgg/s1600-h/6.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 319px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SxeYdqN6_8I/AAAAAAAAAWE/ROPioWQ-Dgg/s400/6.JPG" alt="" id="BLOGGER_PHOTO_ID_5410961112625250242" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-128216010570236496?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/128216010570236496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/12/install-iredmail-use-ldap-and-groupware.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/128216010570236496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/128216010570236496'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/12/install-iredmail-use-ldap-and-groupware.html' title='Install Iredmail use LDAP and Groupware Server use SOGO'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MzplYSbgF84/SxeHqM-YRjI/AAAAAAAAAVU/bV9rt8behv8/s72-c/1.JPG' height='72' width='72'/><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-8179452295406105205</id><published>2009-12-02T13:40:00.008+07:00</published><updated>2009-12-03T15:08:11.966+07:00</updated><title type='text'>Monitor bandwidth with Netflow and PRTG(PFSENSE)</title><content type='html'>&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold;"&gt;I/Intro&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;*NetFlow Analyzer is a, web based (no hardware probes), bandwidth monitoring,  network forensics and network traffic analysis tool that has been optimizing thousands of networks across varied industries for peak performance and helping them to put their bandwidth for a better use. NetFlow Analyzer is a NetFlow, sFlow, JFLow (and more) collector, analyzer and reporting engine integrated together. With close to 4000 enterprises using NetFlow Analyzer for an in-depth visibility into their network traffic and its patterns, NetFlow Analyzer continues to earn trust of more users by giving business knowledge of real-time network behavior and how traffic impacts the network's overall health.&lt;br /&gt;&lt;br /&gt;*PRTG Traffic Grapher is an easy to use Windows software for monitoring and classifying bandwidth traffic usage. It provides system administrators with live readings and long-term usage trends for their network devices. The most common usage is bandwidth management, but you can also monitor many other aspects of your network like memory and CPU utilizations.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold;"&gt;II/Install&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Step 1:install pfsense as normal&lt;br /&gt;&lt;br /&gt;Step 2:install Service &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;pfflowd(system-&gt;Packages chose pffflow click icon "+")&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Step 3:Config Service pfflowd in pfsense (services -&gt; pfflowd) and config as image with Host(address of machine install netflow) and click save&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SxYZ644dAQI/AAAAAAAAAUw/N5WQHbzIOiU/s1600-h/1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 253px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SxYZ644dAQI/AAAAAAAAAUw/N5WQHbzIOiU/s400/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5410540501824504066" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 4:config Service SNMP for PRTG(Services -&gt; SNMP check enable as image )&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SxYZ-rv932I/AAAAAAAAAU4/9iYAD0q7wGc/s1600-h/2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 285px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SxYZ-rv932I/AAAAAAAAAU4/9iYAD0q7wGc/s400/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5410540567018725218" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 5 :install PRTG and Netflow .&lt;br /&gt;&lt;br /&gt;Download PRTG:&lt;a href="http://www.paessler.com/prtg6/download"&gt;http://www.paessler.com/prtg6/download&lt;/a&gt;&lt;br /&gt;Netflow:&lt;a href="http://www.manageengine.com/products/netflow/download.html"&gt;http://www.manageengine.com/products/netflow/download.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;install PRTG and Netflow auto&lt;br /&gt;&lt;br /&gt;Step 6:restart pfsense&lt;br /&gt;&lt;br /&gt;Step 7:Test&lt;br /&gt;from 172.16.1.3 download check status prtg and netflow&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SxYaD4kGx5I/AAAAAAAAAVA/--PibACBHkw/s1600-h/3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 272px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SxYaD4kGx5I/AAAAAAAAAVA/--PibACBHkw/s400/3.JPG" alt="" id="BLOGGER_PHOTO_ID_5410540656357984146" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SxYaIemTnII/AAAAAAAAAVI/WsUkhZOa7oc/s1600-h/4.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 222px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SxYaIemTnII/AAAAAAAAAVI/WsUkhZOa7oc/s400/4.JPG" alt="" id="BLOGGER_PHOTO_ID_5410540735287237762" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-8179452295406105205?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/8179452295406105205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/12/monitor-bandwidth-with-netflow-and.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/8179452295406105205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/8179452295406105205'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/12/monitor-bandwidth-with-netflow-and.html' title='Monitor bandwidth with Netflow and PRTG(PFSENSE)'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_MzplYSbgF84/SxYZ644dAQI/AAAAAAAAAUw/N5WQHbzIOiU/s72-c/1.JPG' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-3146931304108092762</id><published>2009-11-26T13:49:00.004+07:00</published><updated>2009-11-26T15:02:03.076+07:00</updated><title type='text'>INSTALL MOD SECURITY ModSecurity (Web Application Firewall)</title><content type='html'>&lt;p&gt;I/INTRO&lt;/p&gt;&lt;p&gt;ModSecurity is an open source intrusion detection and prevention engine for web applications. It operates embedded into the web server, acting as a powerful umbrella – shielding applications from attacks. ModSecurity supports both branches of the Apache web server.&lt;/p&gt; &lt;p&gt;The module filters, and optionally rejects, incoming requests based on a number of different criteria like CGI variables, HTTP headers, environment variables, and even individual script parameters. &lt;em&gt;mod_security&lt;/em&gt; can also create an audit log, storing full request details in a separate file, including POST payloads (the audit feature can be turned on or off on a per-server or per-directory basis).&lt;/p&gt;&lt;p&gt;II/INSTALL&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Step 1:You need install &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&amp;amp;displaylang=en" target="_blank"&gt;Microsoft Visual C++ 2008 Redistributable Package (x86)&lt;/a&gt;  (if you use Apache in window).&lt;/p&gt;&lt;p&gt;If you use LINUX.you can install from source as:&lt;/p&gt;&lt;p&gt;         #wget http://www.modsecurity.org/download/modsecurity-apache_2.5.11.tar.gz&lt;/p&gt;&lt;p&gt;         #tar -xvzf modsecurity-apache_2.5.11.tar.gz&lt;/p&gt;&lt;p&gt;         #cd modsecurity-apache_2.5.11&lt;/p&gt;&lt;p&gt;         #./configure;make;make install&lt;/p&gt;&lt;p&gt;you can install It by yum if you use RHEL or CENTOS&lt;br /&gt;&lt;/p&gt;&lt;p&gt;prefer:&lt;a href="http://www.jasonlitka.com/yum-repository/"&gt;http://www.jasonlitka.com/yum-repository/&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Step 2:Configure&lt;/p&gt;&lt;p&gt;copy  &lt;span style="font-family:monospace;"&gt;&lt;/span&gt;libxml2.dll to folder bin in folder Apache(/etc/httpd/)if you use window&lt;/p&gt;&lt;p&gt;Step 3:edit file httpd.conf&lt;/p&gt;&lt;p&gt;     uncommend&lt;/p&gt;&lt;pre&gt;  &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;LoadModule unique_id_module modules/mod_unique_id.so &lt;/span&gt;&lt;/pre&gt;&lt;p&gt;    Add this line at the bottom of Load Modules section:              &lt;br /&gt;     &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;LoadModule security2_module modules/mod_security2.so&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Step 4:Test you change signature"&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;SecServerSignature "IIS/7.5&lt;/span&gt;" " of webserver to IIS/7.5 and access to apache&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/Sw4zrhnX-cI/AAAAAAAAAUo/Ebdgdy4ha1o/s1600/1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 282px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/Sw4zrhnX-cI/AAAAAAAAAUo/Ebdgdy4ha1o/s400/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5408317025369455042" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-3146931304108092762?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/3146931304108092762/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/11/install-mod-security-modsecurity-web.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/3146931304108092762'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/3146931304108092762'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/11/install-mod-security-modsecurity-web.html' title='INSTALL MOD SECURITY ModSecurity (Web Application Firewall)'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MzplYSbgF84/Sw4zrhnX-cI/AAAAAAAAAUo/Ebdgdy4ha1o/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-7601086987080336178</id><published>2009-11-19T14:55:00.012+07:00</published><updated>2009-11-24T13:23:20.755+07:00</updated><title type='text'>INSTALL hMailServer</title><content type='html'>&lt;span style="font-weight: bold;"&gt;&lt;span style="font-size:130%;"&gt;I/INTRO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;hMailServer is a free e-mail server for Microsoft Windows. It's used by Internet service providers, companies, governments, schools and enthusiasts in all parts of the world.&lt;br /&gt;&lt;br /&gt;It supports the common e-mail protocols (IMAP, SMTP and POP3) and can easily be integrated with many existing web mail systems. It has flexible score-based spam protection and can attach to your virus scanner to scan all incoming and outgoing email.&lt;br /&gt;&lt;br /&gt;prefer:&lt;a href="http://www.hmailserver.com/"&gt;http://www.hmailserver.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;II/Functionality&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1/Services(POP3,STMP,IMAP)&lt;br /&gt;2/database support(&lt;i&gt;Microsoft SQL Server&lt;/i&gt;, &lt;i&gt;PostgreSQL&lt;/i&gt; and &lt;i&gt;MySQL)&lt;br /&gt;3/&lt;/i&gt;webmail(you can use Roundcube,SquirrelMail ,AfterLogic WebMail Pro)&lt;br /&gt;4/Security(hMailServer is pre-configured to have high security when it comes to relaying and authentication so that no one can use your server to send spam messages. It also supports the very popular open source virus scanner ClamAV. Configuring hMailServer to use ClamAV only takes a single click! The server also supports black list servers and other spam-stopping mechanisms such as SPF and MX lookups).&lt;br /&gt;5/feature&lt;br /&gt;*  POP3, SMTP, IMAP&lt;br /&gt;* Virtual domains&lt;br /&gt;* Built-in backup&lt;br /&gt;* SSL encryption&lt;br /&gt;* Anti-spam&lt;br /&gt;* Anti-virus&lt;br /&gt;* Scripting&lt;br /&gt;* Server-side rules&lt;br /&gt;* Multilingual&lt;br /&gt;* Routing&lt;br /&gt;* MX backup&lt;br /&gt;* Multihoming&lt;br /&gt;* SQL backend&lt;br /&gt;* Web administration&lt;br /&gt;* ClamWin&lt;br /&gt;* SpamAssassin&lt;br /&gt;6/other(hMailServer can use account of Active directory)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;III/INSTALL &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Step 1:download hmail server from&lt;br /&gt;&lt;br /&gt;http://www.hmailserver.com/index.php?page=download&lt;br /&gt;&lt;br /&gt;Step 2:Install hmail server (it auto install)&lt;br /&gt;&lt;br /&gt;Step 3: After install add domain(conheotiensinh.co.cc)&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_MzplYSbgF84/SwUXKzH8ZrI/AAAAAAAAAUA/wo4gBX8ImUA/s1600/1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 301px;" src="http://3.bp.blogspot.com/_MzplYSbgF84/SwUXKzH8ZrI/AAAAAAAAAUA/wo4gBX8ImUA/s400/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5405752402017806002" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 4:Add Account you can use account of AD&lt;br /&gt;&lt;br /&gt;Step 5:install web admin and Web mail&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For easier install you can use xampp(http://www.apachefriends.org/en/xampp.html)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1/Web admin&lt;br /&gt;- Copy folder PHPWebAdmin from in folder install hmailServer to folder htdocs of xampp&lt;br /&gt; -Set the value of rooturl to the URL where the WebAdmin will be   accessed.&lt;br /&gt;&lt;br /&gt;           Example:&lt;span class="Code"&gt;&lt;br /&gt;       $hmail_config['rooturl'] =  "http://localhost/PHWebAdmin/"; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SwUXdB_2yzI/AAAAAAAAAUg/MFialfAVW8M/s1600/5.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 273px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SwUXdB_2yzI/AAAAAAAAAUg/MFialfAVW8M/s400/5.JPG" alt="" id="BLOGGER_PHOTO_ID_5405752715248061234" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;2/Webmail&lt;br /&gt;      a/use SquirrelMail&lt;br /&gt;            Download It from (http://www.squirrelmail.org/download.php).In your mail folder, you will found a &lt;strong&gt;config&lt;/strong&gt; folder with a file named &lt;span style="font-family:Courier New;"&gt;&lt;strong&gt;config_default.php&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;. &lt;/strong&gt;Rename the &lt;span style="font-family:Courier New;"&gt;&lt;strong&gt;config_default.php&lt;/strong&gt;&lt;/span&gt; to &lt;span style="font-family:Courier New;"&gt;&lt;strong&gt;config.php.Edit it&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="re1"&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;$domain&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;            &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="sy0"&gt;=&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="st0"&gt;"localhost"&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="sy0"&gt;;&lt;/span&gt;  &lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="re1"&gt;$smtpServerAddress&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="sy0"&gt;=&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="st0"&gt;"localhost"&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="sy0"&gt;;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="co1"&gt;// your hMailServer address&lt;/span&gt;  &lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="re1"&gt;$imapServerAddress&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="sy0"&gt;=&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="st0"&gt;"localhost"&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="sy0"&gt;;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="co1"&gt;// your hMailServer address&lt;/span&gt;  &lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="re1"&gt;$imap_server_type&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;  &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="sy0"&gt;=&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="st0"&gt;"hmailserver"&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="sy0"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="re1"&gt;$data_dir&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;          &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="sy0"&gt;=&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="st0"&gt;"C:/xampp/htdocs/mail/data/"&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="sy0"&gt;;&lt;/span&gt;  &lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="re1"&gt;&lt;br /&gt;$attachment_dir&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;    &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="sy0"&gt;=&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);" class="st0"&gt;"C:/xampp/htdocs/mail/attach/"&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SwUXP-oxMCI/AAAAAAAAAUI/SkvhbI0dAmU/s1600/2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 260px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SwUXP-oxMCI/AAAAAAAAAUI/SkvhbI0dAmU/s400/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5405752491007619106" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;       b/Use roundcube(recommend)&lt;br /&gt;          -Download from &lt;a href="http://roundcube.net/"&gt;http://roundcube.net/&lt;/a&gt;&lt;br /&gt;          -Create database roundcubemail from phpmyadmin&lt;br /&gt;          -Rename your “&lt;strong&gt;db.inc.php.dist”&lt;/strong&gt; to “&lt;strong&gt;db.inc.php”&lt;/strong&gt; and “&lt;strong&gt;main.inc.php.dist&lt;/strong&gt;” to &lt;strong&gt;“main.inc.php”&lt;/strong&gt; in folder config of roundcube&lt;br /&gt;           -Edit your “&lt;strong&gt;db.inc.php”&lt;/strong&gt; and change this line&lt;strong&gt; “$rcmail_config['db_dsnw'] = ‘mysql://roundcube:pass@localhost/roundcubemail’;&lt;/strong&gt;” with this “&lt;strong&gt;$rcmail_config['db_dsnw'] = ‘mysql://root:@localhost/roundcubemail’;&lt;/strong&gt;”&lt;br /&gt;            -access &lt;strong&gt;http://localhost/roundcubemail/installer&lt;/strong&gt; and configure it&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SwUXS_2TyBI/AAAAAAAAAUQ/A2b86WSX6o0/s1600/3.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 260px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SwUXS_2TyBI/AAAAAAAAAUQ/A2b86WSX6o0/s400/3.jpg" alt="" id="BLOGGER_PHOTO_ID_5405752542872455186" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;         c/use AfterLogic WebMail Pro(not recommend Buy Liscense)&lt;br /&gt;&lt;br /&gt;              - Download from http://www.afterlogic.com/&lt;br /&gt;&lt;br /&gt;               -Access  http://your_webmail_web_address/adminpanel/install.htm you will install it auto&lt;br /&gt;     &lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SwUXY1qRk7I/AAAAAAAAAUY/L6KLf2WqodQ/s1600/4.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SwUXY1qRk7I/AAAAAAAAAUY/L6KLf2WqodQ/s400/4.JPG" alt="" id="BLOGGER_PHOTO_ID_5405752643216839602" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-7601086987080336178?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/7601086987080336178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/11/install-hmailserver.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/7601086987080336178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/7601086987080336178'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/11/install-hmailserver.html' title='INSTALL hMailServer'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MzplYSbgF84/SwUXKzH8ZrI/AAAAAAAAAUA/wo4gBX8ImUA/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-4573945803848858863</id><published>2009-11-13T15:20:00.005+07:00</published><updated>2009-11-13T15:30:39.928+07:00</updated><title type='text'>VPN IPSEC SITE TO SITE WITH PFSENSE</title><content type='html'>&lt;p style="font-weight: bold; color: rgb(255, 0, 0);"&gt;&lt;span style="font-size:180%;"&gt;I/INSTALL&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;you need install pfsense with info:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Site 1:  Outside IP: 192.168.20.203/24&lt;br /&gt;        Outside Gateway:  192.168.20.254 &lt;br /&gt;        Inside IP: 172.16.1.0/16&lt;/p&gt;  &lt;p&gt;Site 2:  Outside IP: 192.168.20.83/24&lt;br /&gt;        Outside Gateway:  192.168.20.254 &lt;br /&gt;        Inside IP: 172.16.10.0/24&lt;/p&gt;  &lt;p&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&lt;br /&gt;Step 1: Install pfsense and set local IP’s on both firewalls.&lt;/p&gt;  &lt;p&gt;Step 2: Logon to the web interface for pfsense on each box and assign the WAN addresses.&lt;/p&gt;  &lt;p&gt;Step 3: Enable IPSEC (VPN-&gt;IPSEC-&gt;Enable IPSec). Do this on both firewalls.&lt;/p&gt;  &lt;p&gt;Step 4: Add a tunnel on Site 1’s firewall to Site 2 by adding a tunnel and changing only the following items:&lt;br /&gt;* Remote Subnet:  172.16.10.0/24 &lt;br /&gt;* Remote Gateway: 192.168.20.83&lt;br /&gt;* Phase 1 Lifetime: 28800 &lt;br /&gt;* PreShared Key:  conheotiensinh&lt;br /&gt;* PFS Key Group: 2 &lt;br /&gt;* Phase 2 Lifetime: 3600&lt;/p&gt;    &lt;p&gt;Step 5: Add a tunnel on Site 2’s firewall to Site 1 by adding a tunnel and changing only the following items:&lt;br /&gt;* Remote Subnet:  172.16.1.0/16&lt;br /&gt;* Remote Gateway: 192.168.20.203&lt;br /&gt;* Phase 1 Lifetime: 28800 &lt;br /&gt;* PreShared Key:  conheotiensinh&lt;br /&gt;* PFS Key Group: 2 &lt;br /&gt;* Phase 2 Lifetime: 3600&lt;/p&gt;    &lt;p&gt;Step 6: "Apply Changes”&lt;br /&gt;&lt;/p&gt;    &lt;p&gt;Step 7: Allow Authenticated Headers (TCP/51) and ISAKMP (UPD/500) with Firewall rules so that IPSEC can pass.  Firewall-&gt;Rules: WAN Tab.&lt;br /&gt;Rule 1 &lt;br /&gt;* Source IP: Any &lt;br /&gt;* Destination IP: WAN Address &lt;br /&gt;* Protocol: TCP &lt;br /&gt;* Port: 51&lt;br /&gt;&lt;br /&gt;Rule 2 &lt;br /&gt;* Source IP: Any &lt;br /&gt;* Destination IP: WAN Address &lt;br /&gt;* Protocol: UDP &lt;br /&gt;* Port:500&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Do this on both firewalls and Apply Changes when prompted&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Step 8: Allow all traffic to pass through the IPSEC tunnel.  Firewall-&gt;Rules : IPSEC Tab&lt;br /&gt;Rule&lt;br /&gt;* Source IP: Any &lt;br /&gt;* Destination IP: Any &lt;br /&gt;* Protocol: Any &lt;br /&gt;* Port Range: Any &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;II/TEST&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;ping test connection from local in site 1 to site 2 and site 2 to site 1&lt;br /&gt;&lt;/p&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-4573945803848858863?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/4573945803848858863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/11/vpn-ip-sec-site-to-site-with-pfsense.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/4573945803848858863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/4573945803848858863'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/11/vpn-ip-sec-site-to-site-with-pfsense.html' title='VPN IPSEC SITE TO SITE WITH PFSENSE'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-865313661660197913</id><published>2009-11-10T11:22:00.008+07:00</published><updated>2009-11-12T16:16:55.338+07:00</updated><title type='text'>SETUP VPN(PPTP SERVER) WITH PFSENSE</title><content type='html'>I/INTRO&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PPTP works by sending a regular PPP session to the peer with the Generic Routing Encapsulation (GRE) protocol. A second session on TCP port 1723 is used to initiate and manage the GRE session. PPTP is difficult to forward past a network firewall because it requires two network sessions. As such, firewalls are unable to let pass this traffic flawlessly, resulting in an inability to connect.&lt;br /&gt;&lt;br /&gt;II/ INSTALL&lt;br /&gt;&lt;br /&gt;We need install pfsense with 2 interface&lt;br /&gt;&lt;br /&gt;Wan interface:192.168.20.203&lt;br /&gt;Lan interface:172.16.1.1&lt;br /&gt;&lt;br /&gt;Step 1: Enable PPTP Server (VPN &gt; PPTP).Setup as Image&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SvvSGheOJGI/AAAAAAAAANo/A1qHVIzO1RI/s1600-h/1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 367px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SvvSGheOJGI/AAAAAAAAANo/A1qHVIzO1RI/s400/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5403143187467215970" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;*Redirect incoming PPTP connections to:If check you will redirect to other PPTP Server(Example Window PPTP)&lt;br /&gt;*&lt;strong&gt;Use a RADIUS server for authentication:used Account of Radius(AD,FreeRadius...)&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;Step 2: create Account for access VPN (click tab users)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_MzplYSbgF84/SvvSJhb3OKI/AAAAAAAAANw/LDKaSNkeXSQ/s1600-h/2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 254px;" src="http://3.bp.blogspot.com/_MzplYSbgF84/SvvSJhb3OKI/AAAAAAAAANw/LDKaSNkeXSQ/s400/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5403143238996932770" border="0" /&gt;&lt;/a&gt;Step 3:create Rule for VPN Zone access internet&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SvvSMC0fAYI/AAAAAAAAAN4/R4XySoXtZUc/s1600-h/3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 289px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SvvSMC0fAYI/AAAAAAAAAN4/R4XySoXtZUc/s400/3.JPG" alt="" id="BLOGGER_PHOTO_ID_5403143282318311810" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 4: connect to PPTP with ip:192.168.20.203 and test connection&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SvvSO98TRhI/AAAAAAAAAOA/rRMsQIxTyYA/s1600-h/4.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 393px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SvvSO98TRhI/AAAAAAAAAOA/rRMsQIxTyYA/s400/4.JPG" alt="" id="BLOGGER_PHOTO_ID_5403143332548527634" border="0" /&gt;&lt;/a&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-865313661660197913?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/865313661660197913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/11/setup-vpnpptp-server-with-pfsense.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/865313661660197913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/865313661660197913'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/11/setup-vpnpptp-server-with-pfsense.html' title='SETUP VPN(PPTP SERVER) WITH PFSENSE'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MzplYSbgF84/SvvSGheOJGI/AAAAAAAAANo/A1qHVIzO1RI/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-8875156664090765928</id><published>2009-11-09T15:21:00.010+07:00</published><updated>2009-11-12T16:11:56.159+07:00</updated><title type='text'>INSTALL IPS(SNORT) WITH PFSENSE</title><content type='html'>I/INTRO&lt;br /&gt;&lt;br /&gt;Pfsense use snort as IPS( Snort Used by fortune 500 companies and goverments Snort is the most widely deployed IDS/IPS technology worldwide. It features rules based logging and  can perform content searching/matching in addition to being used to detect a variety of other attacks and probes, such as buffer overflows, stealth port  scans, CGI attacks, SMB probes, and much more. )&lt;br /&gt;&lt;br /&gt;II/INSTALL&lt;br /&gt;&lt;br /&gt;In This lab we need setup network with info:&lt;br /&gt;&lt;br /&gt;Wan Interface:192.168.20.203&lt;br /&gt;Lan Interface:172.16.1.1&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;STEP 1:Install pfsense as ip&lt;br /&gt;STEP 2:Install snort(The package is available to install from &lt;b&gt;System &gt; Packages&lt;/b&gt; and you must only install &lt;b&gt;SNORT&lt;/b&gt; or &lt;b&gt;SNORT_DEV&lt;/b&gt; never both. It is strongly suggested you get a paid subscription form www.snort.org in order for you to download the latest rules. )&lt;br /&gt;STEP 3:After Install done We configure snort(Services &gt; Snort)click tab Setting and configure as image&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SvvQuq74msI/AAAAAAAAAMo/yarHog1hVXQ/s1600-h/1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 323px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SvvQuq74msI/AAAAAAAAAMo/yarHog1hVXQ/s400/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5403141678179064514" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Notes:&lt;br /&gt;&lt;br /&gt;Block offenders:Pfsense will  automatically block hosts that generate a snort alert&lt;br /&gt;Remove blocked hosts every: It Will auto remove hosts from tab blocked&lt;br /&gt;Oinkmaster code:you need register 1 Account in Snort or buy (&lt;a href="http://www.snort.org/vrt/buy-a-subscription/"&gt;http://www.snort.org/vrt/buy-a-subscription/&lt;/a&gt; will get the the latest rule updates 30 days faster than registered users)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 4:click tab update rules(please waith about 4-10 minutes)&lt;br /&gt;&lt;br /&gt;Step 5:Test before attack(ping external ip)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SvvQyQVXMRI/AAAAAAAAAMw/LRsteomKWZg/s1600-h/2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 192px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SvvQyQVXMRI/AAAAAAAAAMw/LRsteomKWZg/s400/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5403141739757646098" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 6:user super scan tool scan ip external and check tab blocked&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SvvQ1dsWbuI/AAAAAAAAAM4/gXNNXTMV8p0/s1600-h/3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 291px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SvvQ1dsWbuI/AAAAAAAAAM4/gXNNXTMV8p0/s400/3.JPG" alt="" id="BLOGGER_PHOTO_ID_5403141794883333858" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 7 :access agian ip external&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SvvQ31d7ijI/AAAAAAAAANA/NKymbujyZFo/s1600-h/4.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 200px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SvvQ31d7ijI/AAAAAAAAANA/NKymbujyZFo/s400/4.JPG" alt="" id="BLOGGER_PHOTO_ID_5403141835625040434" border="0" /&gt;&lt;/a&gt;Step 8:Delete ip attacker in tab blocked and test again&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SvvQyQVXMRI/AAAAAAAAAMw/LRsteomKWZg/s1600-h/2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 192px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SvvQyQVXMRI/AAAAAAAAAMw/LRsteomKWZg/s400/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5403141739757646098" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Beside You can use Blocking Skype ,Yahoo ,P2P.... with pfSense and Snort.I will intro later&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-8875156664090765928?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/8875156664090765928/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/11/install-ips-in-pfsense.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/8875156664090765928'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/8875156664090765928'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/11/install-ips-in-pfsense.html' title='INSTALL IPS(SNORT) WITH PFSENSE'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MzplYSbgF84/SvvQuq74msI/AAAAAAAAAMo/yarHog1hVXQ/s72-c/1.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-6845359381133406273</id><published>2009-10-13T16:57:00.010+07:00</published><updated>2009-11-12T16:23:09.818+07:00</updated><title type='text'>Install Firewall Cluster Failover(HA) With 5 minutes</title><content type='html'>I/ Intro&lt;br /&gt;&lt;br /&gt;Setup Firewall Cluster Failover(HA)  with 5 minutes&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SvvTdcPH9VI/AAAAAAAAAOI/1Ae80GMzUs4/s1600-h/1.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 227px; height: 400px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SvvTdcPH9VI/AAAAAAAAAOI/1Ae80GMzUs4/s400/1.gif" alt="" id="BLOGGER_PHOTO_ID_5403144680710337874" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;II/INSTALL&lt;br /&gt;&lt;br /&gt;Step 1:You setup 2 firewall with info&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; firewall 1(MASTER):   LAN:172.16.1.1&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;                                         SYNC:192.168.188.1(cable Cross)&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;                                         WAN&lt;/span&gt;  &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;&lt;br /&gt;&lt;br /&gt;firewall 2(SLAVE):       LAN:172.16.1.2&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;                                          SYNC:192.168.188.2(Cable Cross)&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;                                          WAN&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 2 :Create virtual IP in fw1 and fw 2(Firewall &gt; Virtual IP)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SvvThZ8OfFI/AAAAAAAAAOQ/esYUM2_yWK0/s1600-h/2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 210px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SvvThZ8OfFI/AAAAAAAAAOQ/esYUM2_yWK0/s400/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5403144748813679698" border="0" /&gt;&lt;/a&gt;Step 3: config sync for fw (rule,Nat ......)&lt;br /&gt;&lt;br /&gt;In Master (&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Firewall &gt; Virtual IP go to tab CARP Settings&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;+check all box&lt;br /&gt;+Synchronize Interface:SYNC&lt;br /&gt;+Synchronize to IP:192.168.188.2&lt;br /&gt;+Remote System Password:your password access admin pfsense&lt;br /&gt;&lt;br /&gt;In SLAVE(&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Firewall &gt; Virtual IP go to tab CARP Settings&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;+only check Synchronize Enabled&lt;br /&gt;+Synchronize Interface:SYNC&lt;br /&gt;&lt;br /&gt;Step 4: don't forget add rule in interface SYNC for master connect to SLAVE and SLAVE connect to MASTER&lt;br /&gt;&lt;br /&gt;Step 5 :Check status In  MASTER and SLAVE&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SvvTkM8EsPI/AAAAAAAAAOY/yPUrPW0EryM/s1600-h/3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 254px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SvvTkM8EsPI/AAAAAAAAAOY/yPUrPW0EryM/s400/3.JPG" alt="" id="BLOGGER_PHOTO_ID_5403144796862984434" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SvvTmq7xZaI/AAAAAAAAAOg/9JJp6An_G-s/s1600-h/4.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 253px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SvvTmq7xZaI/AAAAAAAAAOg/9JJp6An_G-s/s400/4.JPG" alt="" id="BLOGGER_PHOTO_ID_5403144839274522018" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 6:Test create rule in MASTER it Auto update to SLAVE&lt;br /&gt;&lt;br /&gt;Step 7 :Test Connection shutdown MASTER.SLAVE to MASTER (it will delay 1 ms)&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-6845359381133406273?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/6845359381133406273/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/10/install-firewall-cluster-failoverha.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/6845359381133406273'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/6845359381133406273'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/10/install-firewall-cluster-failoverha.html' title='Install Firewall Cluster Failover(HA) With 5 minutes'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MzplYSbgF84/SvvTdcPH9VI/AAAAAAAAAOI/1Ae80GMzUs4/s72-c/1.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-6150310365710804448</id><published>2009-10-13T10:30:00.016+07:00</published><updated>2009-11-12T16:31:41.359+07:00</updated><title type='text'>Multi WAN / Load Balancing OUTBOUND Use PFSENSE</title><content type='html'>&lt;h2&gt;1/Overview&lt;/h2&gt; &lt;p&gt;This setup enables pfSense to load balance traffic from your LAN to multiple internet connections (WANs). Traffic from the LAN is shared out on a round robin basis across the available WANs. pfSense monitors each WAN connection, using an IP address you provide, and if the monitor fails, a failover configuration is used, this typically just feeds all traffic down the other connection(s). This example sets up 2 WANs, but 3 or more can be used. &lt;/p&gt;&lt;p&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold;"&gt;2/Intro &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;You can use other device load balance but it very expensive for your Company (Include My company).Pfsense can deploy all company from small -&gt; big company( &lt;500users)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="font-weight: bold;"&gt;&lt;span style="font-size:180%;"&gt;3/Install&lt;/span&gt;&lt;/p&gt;&lt;p&gt;you can Setup  pfsense with 3 interface&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Lan:172.16.1.1&lt;/p&gt;&lt;p&gt;Wan1:                                    192.168.20.204&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Wan2:172.16.10.1&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;table border="0" cellpadding="0" cellspacing="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="listr" width="78%"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SvvUgVh5cBI/AAAAAAAAAOw/hSvB90nlOC0/s1600-h/1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 317px; height: 400px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SvvUgVh5cBI/AAAAAAAAAOw/hSvB90nlOC0/s400/1.jpg" alt="" id="BLOGGER_PHOTO_ID_5403145829961265170" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/StP930hQ7PI/AAAAAAAAAKQ/U8PfF0FEnf4/s1600-h/1.jpg"&gt;&lt;/a&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;   Step 1: Create App pool &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;wan1&amp;amp;wan2(services&gt;load balancer)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SvvUkrFYsBI/AAAAAAAAAO4/iWSexF8aCuI/s1600-h/2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 312px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SvvUkrFYsBI/AAAAAAAAAO4/iWSexF8aCuI/s400/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5403145904466735122" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;Step 2:Create rule for Local access internet via pool&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;wan1&amp;amp;wan2&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SvvUucL1jxI/AAAAAAAAAPA/gZlBRMXsoyg/s1600-h/3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 142px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SvvUucL1jxI/AAAAAAAAAPA/gZlBRMXsoyg/s400/3.JPG" alt="" id="BLOGGER_PHOTO_ID_5403146072265953042" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 3:Check status pool (Status &gt; Load Balancer)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SvvUySSz-RI/AAAAAAAAAPI/JWLmIyt9ihk/s1600-h/4.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 142px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SvvUySSz-RI/AAAAAAAAAPI/JWLmIyt9ihk/s400/4.JPG" alt="" id="BLOGGER_PHOTO_ID_5403146138330331410" border="0" /&gt;&lt;/a&gt;Step 4:Disconnect  line 1 check internet va status pool&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SvvVB1QHmuI/AAAAAAAAAPY/ynE8CnYsZD8/s1600-h/6.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 150px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SvvVB1QHmuI/AAAAAAAAAPY/ynE8CnYsZD8/s400/6.JPG" alt="" id="BLOGGER_PHOTO_ID_5403146405412313826" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SvvU2BavTpI/AAAAAAAAAPQ/8b1Gu2wMRxU/s1600-h/5.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 363px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SvvU2BavTpI/AAAAAAAAAPQ/8b1Gu2wMRxU/s400/5.JPG" alt="" id="BLOGGER_PHOTO_ID_5403146202519654034" border="0" /&gt;&lt;/a&gt;Step 4:Connect Line 1 Disconnect  line 2 check internet va status pool&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SvvV1jd5siI/AAAAAAAAAPo/DaECKKAgr7A/s1600-h/7.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 138px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SvvV1jd5siI/AAAAAAAAAPo/DaECKKAgr7A/s400/7.JPG" alt="" id="BLOGGER_PHOTO_ID_5403147293991481890" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SvvU2BavTpI/AAAAAAAAAPQ/8b1Gu2wMRxU/s1600-h/5.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 363px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SvvU2BavTpI/AAAAAAAAAPQ/8b1Gu2wMRxU/s400/5.JPG" alt="" id="BLOGGER_PHOTO_ID_5403146202519654034" border="0" /&gt;&lt;/a&gt;other you can setup Pfsense  cluster failover .I will intro later&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-6150310365710804448?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/6150310365710804448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/10/multi-wan-load-balancing-outbound-use.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/6150310365710804448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/6150310365710804448'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/10/multi-wan-load-balancing-outbound-use.html' title='Multi WAN / Load Balancing OUTBOUND Use PFSENSE'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MzplYSbgF84/SvvUgVh5cBI/AAAAAAAAAOw/hSvB90nlOC0/s72-c/1.jpg' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-1675628246150397317</id><published>2009-10-07T16:21:00.000+07:00</published><updated>2009-10-07T17:24:04.935+07:00</updated><title type='text'>SMTP Gateway for Multiple Domain Email Gateway with Postfix</title><content type='html'>&lt;div id="toctitle"&gt;             &lt;h3&gt;Contents&lt;/h3&gt;             &lt;span class="toctoggle"&gt;&lt;/span&gt;&lt;/div&gt;             &lt;ul&gt;&lt;li class="toclevel-1"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://conheotiensinh.blogspot.com/2009/10/smtp-gateway-for-multiple-domain-email.html#scope"&gt;&lt;span class="tocnumber"&gt;1&lt;/span&gt; &lt;span class="toctext"&gt;Scope / Purpose&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="toclevel-1"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://conheotiensinh.blogspot.com/2009/10/smtp-gateway-for-multiple-domain-email.html#overview"&gt;&lt;span class="tocnumber"&gt;2&lt;/span&gt; &lt;span class="toctext"&gt;Overview&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="toclevel-1"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://conheotiensinh.blogspot.com/2009/10/smtp-gateway-for-multiple-domain-email.html#reference"&gt;&lt;span class="tocnumber"&gt;3&lt;/span&gt; &lt;span class="toctext"&gt;References / Links&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="toclevel-1"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://conheotiensinh.blogspot.com/2009/10/smtp-gateway-for-multiple-domain-email.html#configuration"&gt;&lt;span class="tocnumber"&gt;4&lt;/span&gt; &lt;span class="toctext"&gt;Configuration&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;                 &lt;ul&gt;&lt;li class="toclevel-2"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://conheotiensinh.blogspot.com/2009/10/smtp-gateway-for-multiple-domain-email.html#main.cf"&gt;&lt;span class="tocnumber"&gt;4.1&lt;/span&gt; &lt;span class="toctext"&gt;/etc/postfix/main.cf&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="toclevel-2"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://conheotiensinh.blogspot.com/2009/10/smtp-gateway-for-multiple-domain-email.html#master.cf"&gt;&lt;span class="tocnumber"&gt;4.2&lt;/span&gt; &lt;span class="toctext"&gt;/etc/postfix/master.cf&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="toclevel-2"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://conheotiensinh.blogspot.com/2009/10/smtp-gateway-for-multiple-domain-email.html#virtual"&gt;&lt;span class="tocnumber"&gt;4.3&lt;/span&gt; &lt;span class="toctext"&gt;/etc/postfix/virtual&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="toclevel-2"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://conheotiensinh.blogspot.com/2009/10/smtp-gateway-for-multiple-domain-email.html#transport"&gt;&lt;span class="tocnumber"&gt;4.4&lt;/span&gt; &lt;span class="toctext"&gt;/etc/postfix/transport&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="toclevel-2"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://conheotiensinh.blogspot.com/2009/10/smtp-gateway-for-multiple-domain-email.html#relay_recipients"&gt;&lt;span class="tocnumber"&gt;4.5&lt;/span&gt; &lt;span class="toctext"&gt;/etc/postfix/relay_recipients&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;                 &lt;/li&gt;&lt;li class="toclevel-1"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://conheotiensinh.blogspot.com/2009/10/smtp-gateway-for-multiple-domain-email.html#miscellany"&gt;&lt;span class="tocnumber"&gt;5&lt;/span&gt; &lt;span class="toctext"&gt;Miscellany&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;                 &lt;ul&gt;&lt;li class="toclevel-2"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://conheotiensinh.blogspot.com/2009/10/smtp-gateway-for-multiple-domain-email.html#populate"&gt;&lt;span class="tocnumber"&gt;5.1&lt;/span&gt; &lt;span class="toctext"&gt;Populating relay_recipients from Active Directory&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="toclevel-2"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://conheotiensinh.blogspot.com/2009/10/smtp-gateway-for-multiple-domain-email.html#hash"&gt;&lt;span class="tocnumber"&gt;5.2&lt;/span&gt; &lt;span class="toctext"&gt;Hashing Databases&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="toclevel-2"&gt;&lt;span style="font-size:85%;"&gt;&lt;a href="http://conheotiensinh.blogspot.com/2009/10/smtp-gateway-for-multiple-domain-email.html#restart"&gt;&lt;span class="tocnumber"&gt;5.3&lt;/span&gt; &lt;span class="toctext"&gt;Restarting Postfix&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h2&gt;Scope / Purpose &lt;/h2&gt; &lt;p&gt;This article walks through the setup for a email gateway for multiple domains, rejects unknown email addresses, and uses a script to query valid email addresses via Active Directory. &lt;/p&gt; &lt;div style="float: right; margin-left: 5px;" class="editsection"&gt;&lt;br /&gt;&lt;/div&gt; &lt;h2&gt;&lt;br /&gt;&lt;a name="overview"&gt;&lt;/a&gt; Overview &lt;/h2&gt; &lt;p&gt;This article describes the rationale and the setup of an external email firewall/gateway server with &lt;a rel="nofollow" title="http://www.postfix.org/" class="external text" href="http://www.postfix.org/"&gt;Postfix&lt;/a&gt;, a secure, high performance, and easily configurable alternative SMTP server to &lt;a rel="nofollow" title="http://www.sendmail.org/" class="external text" href="http://www.sendmail.org/"&gt;Sendmail&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;The most common reason for this is to improve security (this applies even if you're not running Exchange). Since the email gateway theoretically only exposes its SMTP port, and will not store any emails, so even in the (ideally unlikely) event that it is compromised, any sensitive or valuable data is held elsewhere. The worst that could happen is that the attacker obtains a list of vaild email addresses for your domain(s). It can also be used for offloading services from your main email server, tasks like rejecting and filtering spam, greylisting, scanning viruses, avoiding unnecessary bandwidth, etc. &lt;/p&gt; &lt;p&gt;There are "articles" on the Internet that make references to simplying using the "relayhost = internalsmtp.test.vn" directive. The problem with this setup is that since the external email gateway knows nothing about the internal addresses (even when configured to only accept email to @test.vn), that it has to accept and forward everything and depend on the internal host to handle rejecting and bouncing messages. This might be acceptable, except if/when your domain becomes the target of a flood of spam or viruses to invalid/generated email addresses. Especially since the source and reply-to addresses of these emails are typically spoofed, each message ends up being accepted at the email gateway, forwarded to your internal server, rejected and relayed back to your email gateway, queued by the email gateway for delivery, retried repeatedly until it exceeds the nominal timeout, then bounced back to the email admin account on your internal email server. Lather, rinse and repeat that for every single message and it should be clear why you should never just use the "relayhost" directive to do this. &lt;/p&gt; &lt;p&gt;The "correct(tm)" way to do this, is to set up the email gateway so that it has knowledge of valid email addresses. That way, any address that doesn't exist is immediately rejected before the email gateway even gets to accept the data. This is important enough to worth being redudant. Rejecting unknown addresses not only avoids the whole loop described above, but avoids tying up your bandwidth receiving whatever data that would have been sent.&lt;br /&gt;&lt;/p&gt;&lt;h2&gt;References / Links &lt;/h2&gt; &lt;p&gt;Basically, this article is a restatement of &lt;a rel="nofollow" title="http://www.postfix.org/STANDARD CONFIGURATION README.html#firewall" class="external text" href="http://www.postfix.org/STANDARD_CONFIGURATION_README.html#firewall"&gt;Postfix email firewall/gateway&lt;/a&gt; found on Postfix.org's online configuration examples&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2&gt;Configuration &lt;/h2&gt; &lt;p&gt;This article will not cover the compiling or installation of Postfix as it's generally available or easily installed for most distributions. &lt;/p&gt;&lt;br /&gt;&lt;h3&gt;&lt;a name="main.cf"&gt;&lt;/a&gt; /etc/postfix/main.cf &lt;/h3&gt; &lt;p&gt;As the name implies, this is the main configuration file for Postfix. One main attribute with Postfix is that the defaults generally default to something sensible, so that for the most part, outside of the parameters that need to be customized to your setup, they can be completely omitted in main.cf. &lt;/p&gt; &lt;p&gt;Hint: The command below will show the configuration directives that have been altered from default. &lt;/p&gt; &lt;pre&gt; postconf -n&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Since this is an email gateway only meant to forward email, disable local mail delivery by (Note: setting a configuration directive to empty disables it): &lt;/p&gt; &lt;pre&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; mydestination =&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;local_recipient_maps =&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;local_transport = error:local mail delivery is disabled&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Normally, emails that originate from a host will have a from address in the form of &lt;code&gt;username@hostname.test.vn&lt;/code&gt;. However, since the email gateway cannot receive mail for local users (as disabled above), you need to set the originating domain to something sensible: &lt;/p&gt; &lt;pre&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; myorigin = test.vn&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;&lt;code&gt;mynetworks = &lt;/code&gt; define which networks are allowed to relay mail through this host. Although it's meant for internal networks to be able to relay mail without having to authenticate, it can be used (abused) to include external IP addresses or networks. However, the proper solution is to set up your Postfix installation to do SASL authentication: &lt;/p&gt; &lt;pre&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; mynetworks =&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;127.0.0.0/8,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;192.168.20.0/24&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;This section below prevents addresses such as &lt;code&gt;usernexame@subdomain.test.vn&lt;/code&gt; to match.  Explicitly define domains you wish to accept using &lt;code&gt;relay_domains&lt;/code&gt; below. &lt;/p&gt; &lt;pre&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; parent_domain_matches_subdomains =&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;debug_peer_list,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;smtpd_access_maps&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;&lt;code&gt;relay_domains = &lt;/code&gt; define domains for which the email gateway will accept emails. &lt;/p&gt; &lt;pre&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; relay_domains =&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;test1.vn,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;test2.vn,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;subdomain.test.vn&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;&lt;code&gt;smtpd_recipient_restrictions = &lt;/code&gt; controls what the Postfix server will accept during the &lt;code&gt;RCPT TO&lt;/code&gt; command. &lt;/p&gt; &lt;pre&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;smtpd_recipient_restrictions =&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;permit_mynetworks,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;reject_unauth_destination&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;&lt;code&gt;transport_maps = &lt;/code&gt; holds the mappings between domains and the SMTP server where the mail gets forwarded.  See &lt;a href="http://conheotiensinh.blogspot.com/2009/10/smtp-gateway-for-multiple-domain-email.html#transport"&gt;/etc/postfix/transport&lt;/a&gt; for details. &lt;/p&gt; &lt;pre&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; transport_maps = hash:/etc/postfix/transport&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;&lt;code&gt;relay_recipient_maps = &lt;/code&gt; points to a file that lists all of the email addresses for which the email gateway will accept mail.  See &lt;a href="http://conheotiensinh.blogspot.com/2009/10/smtp-gateway-for-multiple-domain-email.html#relay_recipients"&gt;/etc/postfix/relay_recipients&lt;/a&gt;. &lt;/p&gt; &lt;pre&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; relay_recipient_maps = hash:/etc/postfix/relay_recipients&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;&lt;code&gt;show_user_unknown_table_name = &lt;/code&gt;controls whether Postfix returns "User unknown in relay recipient table" (default - useful for debugging only) or "User unknown" (when set to no).  This configuration directive is only used in conjunction with &lt;code&gt;relay_recipient_maps&lt;/code&gt;.&lt;/p&gt; &lt;pre style="font-weight: bold; color: rgb(255, 0, 0);"&gt; show_user_unknown_table_name = no&lt;/pre&gt; &lt;p&gt;ven though local mail delivery is disabled, the email gateway is still supposed to accept emails to &lt;code&gt;postmaster&lt;/code&gt; and &lt;code&gt;abuse&lt;/code&gt;.  To do so, define a virtual alias map (we'll populate the values later).  See &lt;a href="http://conheotiensinh.blogspot.com/2009/10/smtp-gateway-for-multiple-domain-email.html#virtual"&gt;/etc/postfix/virtual&lt;/a&gt; for details. &lt;/p&gt; &lt;pre&gt; virtual_alias_maps = hash:/etc/postfix/virtual&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;&lt;a name="master.cf"&gt;&lt;/a&gt; /etc/postfix/master.cf &lt;/h3&gt; &lt;p&gt;This file basically defines services that Postfix will provide. To completely disable local mail delivery, edit /etc/postfix/master.cf and insert a &lt;code&gt;#&lt;/code&gt; symbol in front of the local service definition: &lt;/p&gt; &lt;pre&gt; #local     unix  -       n       n       -       -       local&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;&lt;a name="virtual"&gt;&lt;/a&gt; /etc/postfix/virtual &lt;/h3&gt; &lt;p&gt;In a typical setup, /etc/aliases is used  to forward mail to other account or external addresses.  However, since local mail delivery is disabled, modifying /etc/aliases has no effect. This file holds the alias mappings between local addresses and actual email addresses. Note: this is only necessary because there is no local mail delivery, and that some "local" addresses ought to exist for technical correctness.  &lt;/p&gt; &lt;pre&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; postmaster      postmaster@test.vn&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;abuse           abuse@test.vn&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;root  guru@test.vn&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt; Actually, you can use this file for more than local addresses.  You can forward emails from ex-users to their new emails addresses, create simple distribution lists, or copy an email to another user, etc.&lt;br /&gt;&lt;pre style="font-weight: bold; color: rgb(255, 0, 0);"&gt; virtualuser@test.vn     actualuser@test1.vn&lt;br /&gt;distribution@test.vn    user1@test.vn,user2@test.vn,user3@test.vn&lt;br /&gt;ex_user@test2.vn         forwarding_address@dom.ain&lt;br /&gt;user@test.vn             user@test.vn,spy@test.vn&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;&lt;a name="transport"&gt;&lt;/a&gt; /etc/postfix/transport &lt;/h3&gt; &lt;p&gt;This file defines the relationship between domains and the server(s) where mail is forwarded. &lt;/p&gt; &lt;pre&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; test1.vn              smtp:insidesmtp.test.vn&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;test2.vn              smtp:insidesmtp.test.vn&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;subdomain.test.vn    smtp:insidesmtp.test.vn&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h3&gt;&lt;a name="relay_recipients"&gt;&lt;/a&gt; /etc/postfix/relay_recipients &lt;/h3&gt; &lt;p&gt;This file folds a complete list of email address for which the email gateway will accept mail. Even though you have to enter the values as a pair (key &amp;amp; value), the second part (the value) doesn't actually matter as long as the email addresses are correct. &lt;/p&gt; &lt;pre&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; user1@test1.vn OK&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;user2@test1.vn OK&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;user1@test2.vn OK&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;user2@test2.vn OK&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;user1@subdomain.test.vn OK&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;user2@subdomain.test.vn OK&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;h3&gt;Populating relay_recipients from Active Directory &lt;/h3&gt; &lt;p&gt;Note that this script requires perl and Net::LDAP(you need install perl-ldap by yum).  However, this does NOT have to be on your email gateway. &lt;/p&gt; &lt;ul&gt;&lt;li&gt; Download &lt;a rel="nofollow" title="http://www-personal.umich.edu/~malth/gaptuning/postfix/getadsmtp.pl" class="external free" href="http://www-personal.umich.edu/%7Emalth/gaptuning/postfix/getadsmtp.pl"&gt;http://www-personal.umich.edu/~malth/gaptuning/postfix/getadsmtp.pl&lt;/a&gt; &lt;/li&gt;&lt;li&gt; Edit the script so that values below are correct: &lt;/li&gt;&lt;/ul&gt;  $VALID = "/etc/postfix/relay_recipients";&lt;br /&gt;$dc1="dc1.test.vn";&lt;br /&gt;$dc2="dc2.test.vn";&lt;br /&gt;$hqbase="cn=Users,dc=test,dc=vn";&lt;br /&gt;$user="cn=user,cn=Users,dc=test,dc=vn";&lt;br /&gt;$passwd="password";&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Note that if you have email distribution lists that need to be externally accesible, that you will also need the contents of:&lt;/li&gt;&lt;/ul&gt;  $hqbase="ou=Exchange Distribution Lists,dc=test,dc=vn";&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;&lt;a name="hash"&gt;&lt;/a&gt; Hashing Databases &lt;/h3&gt; &lt;p&gt;Postfix uses the db hash format by default.  For this setup, we need to create the hashed db files by executing: &lt;/p&gt;  postmap hash:/etc/postfix/virtual&lt;br /&gt;postmap hash:/etc/postfix/transport&lt;br /&gt;postmap hash:/etc/postfix/relay_recipients&lt;br /&gt;&lt;p&gt;Note: remember to rerun the above commands every time the contents of those files change. &lt;/p&gt;&lt;br /&gt;&lt;h3&gt;&lt;a name="restart"&gt;&lt;/a&gt; Restarting Postfix &lt;/h3&gt; &lt;p&gt;The preferred way of getting Postfix to reload its configuration files is simply execute: &lt;/p&gt;  postfix reload&lt;pre&gt;You can create script run every hours&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;#!/bin/sh&lt;/p&gt; &lt;p&gt;cd /etc/postfix ; ./getadsmtp.pl &amp;amp;&amp;amp; postmap relay_recipients  &lt;/p&gt;&lt;pre&gt;&lt;br /&gt;If You have any problem script perl please send mail to:&lt;br /&gt;conheotiensinh@yahoo.com.&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-1675628246150397317?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/1675628246150397317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/10/smtp-gateway-for-multiple-domain-email.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/1675628246150397317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/1675628246150397317'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/10/smtp-gateway-for-multiple-domain-email.html' title='SMTP Gateway for Multiple Domain Email Gateway with Postfix'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-6721231577750686580</id><published>2009-09-29T16:30:00.001+07:00</published><updated>2009-11-12T16:33:56.678+07:00</updated><title type='text'>INSTALL SHOREWALL(Configure Iptables easier )</title><content type='html'>&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;I/INTRO&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;Shorewall&lt;/b&gt; (more appropriately the &lt;b&gt;Shoreline Firewall&lt;/b&gt;) is an &lt;a href="http://en.wikipedia.org/wiki/Open-source_software" title="Open-source software" class="mw-redirect"&gt;open source&lt;/a&gt; &lt;a href="http://en.wikipedia.org/wiki/Firewall_%28networking%29" title="Firewall (networking)" class="mw-redirect"&gt;firewall&lt;/a&gt; tool for &lt;a href="http://en.wikipedia.org/wiki/Linux" title="Linux"&gt;Linux&lt;/a&gt; that builds upon the &lt;a href="http://en.wikipedia.org/wiki/Netfilter" title="Netfilter"&gt;Netfilter&lt;/a&gt; (iptables/ipchains) system built into the &lt;a href="http://en.wikipedia.org/wiki/Linux_kernel" title="Linux kernel"&gt;Linux kernel&lt;/a&gt;, making it easier to manage more complex configuration schemes.&lt;/p&gt; &lt;p&gt;Using an analogy understandable to programmers: Shorewall is to iptables, what C is to assembly language. It provides a higher level of abstraction for describing rules using text files.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;II/INSTALL&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;span style="color: rgb(153, 51, 153); font-weight: bold;"&gt;1/ download all packages&lt;/span&gt; *.rpm of shorewall(http://rpm.pbone.net/ if You use&lt;span style="font-weight: bold;"&gt; Fedora can use yum &lt;/span&gt;) and install with command &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;rpm -ivh *.rpm&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b style="color: rgb(153, 51, 153);"&gt;2/Configure Shorewall&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I Configure shorewall with 3 interface and 3 zone:&lt;b&gt;net,DMZ,Local&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2.1/in file /etc/shorewall/zone add all lines&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;b&gt;&lt;span style="color:Red;"&gt;      fw firewall&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color:Red;"&gt; &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color:Red;"&gt;      net ipv4    #&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color:Red;"&gt; &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color:Red;"&gt;       loc ipv4    #&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color:Red;"&gt;      dmz ipv4    #&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;      &lt;span style="font-weight: bold;"&gt;2.2/ In file /etc/shorewall/interfaces add all lines&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color:Red;"&gt;net eth1    #interface of zone net&lt;br /&gt;&lt;br /&gt;loc eth0    # interface of Zone loc&lt;br /&gt;&lt;br /&gt;dmz eth2  #interface of Zone dmz&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; 2.3/In File  /etc/shorewall/masq add all lines (This file use for NAT outbound)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:Red;"&gt;&lt;b&gt;eth1 192.168.100.0/24 172.21.1.16&lt;br /&gt;eth1 192.168.111.0/24 172.21.1.16&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;192.168.100.0/24 subnet zone local.&lt;br /&gt;192.168.111.0/24 subnet zone DMZ and  ip:172.21.1.16 external address of firewall&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2.4/In file etc/shorewall/policy add all lines&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:Red;"&gt;&lt;b&gt;loc        net        REJECT      info&lt;br /&gt;&lt;br /&gt;net        all         DROP        info&lt;br /&gt;&lt;br /&gt;all        all         REJECT      info&lt;br /&gt;&lt;br /&gt;$FW        net         REJECT      info&lt;br /&gt;&lt;br /&gt;dmz        net         REJECT      info&lt;br /&gt;&lt;br /&gt;dmz        loc         REJECT      info&lt;br /&gt;&lt;br /&gt;loc        dmz         REJECT      info&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt; 2.5/In file /etc/shorewall/rule add all lines&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:Red;"&gt;&lt;b&gt;ACCEPT loc net tcp 80,443,25,110,53//(Permit access local-&gt;internet with protocol HTTP,HTTPS,SMTP,POP3,DNS)&lt;br /&gt;&lt;br /&gt;ACCEPT loc net udp 53&lt;br /&gt;&lt;br /&gt;ACCEPT loc net icmp    echo-request //(&lt;/b&gt;&lt;/span&gt;&lt;span style="color:Red;"&gt;&lt;b&gt;Permit&lt;/b&gt;&lt;/span&gt;&lt;span style="color:Red;"&gt;&lt;b&gt; ping  local-&gt;internet)&lt;br /&gt;&lt;br /&gt;ACCEPT loc fw tcp 2822 //(permit access SSH to firewall for Security I change port of SSH)&lt;br /&gt;&lt;br /&gt;DNAT net dmz:192.168.111.2 tcp 80,443,110,25,995,465//(Nat INBOUND from internet can access  protocols: HTTP,HTTPS,POP3,SMTP,POP3S,SMTPS)&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Change&lt;br /&gt;&lt;br /&gt;&lt;span style="color:Red;"&gt;&lt;b&gt;STARTUP_ENABLED=No -&gt; STARTUP_ENABLED=Yes trong /etc/shorewall/shorewall.conf&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;start shorewall by command :&lt;span style="color:Red;"&gt;&lt;b&gt;shorewall start&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;For configure easier you can use webmin for configure shorewall with web interface.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SvvWdLMD7QI/AAAAAAAAAP4/MZq2GCGoVYM/s1600-h/1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 215px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SvvWdLMD7QI/AAAAAAAAAP4/MZq2GCGoVYM/s400/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5403147974668971266" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-6721231577750686580?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/6721231577750686580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/09/install-shorewalleasy-iptables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/6721231577750686580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/6721231577750686580'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/09/install-shorewalleasy-iptables.html' title='INSTALL SHOREWALL(Configure Iptables easier )'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_MzplYSbgF84/SvvWdLMD7QI/AAAAAAAAAP4/MZq2GCGoVYM/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-7196010772601272490</id><published>2009-09-17T15:27:00.000+07:00</published><updated>2009-09-17T17:08:09.475+07:00</updated><title type='text'>Active Directory/LDAP Virtual Users for RHEL/CentOS 5</title><content type='html'>This guide will show you how to integrate Active Directory/LDAP into Postfix and Dovecot. In this page, you will learn how to enable Postfix to lookup email addresses in LDAP and how to enable Dovecot to authenticate to an LDAP server.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;We will be using the following attributes&lt;/p&gt; &lt;ul class="spaced"&gt;&lt;li&gt;&lt;em&gt;samaccountname&lt;/em&gt; or &lt;em&gt;uid&lt;/em&gt; – User Name for Active Directory or OpenLDAP respectively.&lt;/li&gt;&lt;li&gt;&lt;em&gt;mail&lt;/em&gt; – Email Address. For Active Directory users, you need to fill-up the &lt;strong&gt;E-mail&lt;/strong&gt; field of the User.&lt;/li&gt;&lt;li&gt;&lt;em&gt;othermailbox&lt;/em&gt; – For Active Directory only. We will use this field to store email aliases. Use &lt;a href="http://www.linuxmail.info/adsi-edit-ldap-attributes/"&gt;&lt;/a&gt;ADSI Edit to update this field.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h2&gt;Create the Virtual Mail User Account&lt;/h2&gt; &lt;p&gt;Since the Active Directory/OpenLDAP user names are not part of the Linux system, we will have to create a user that will be the owner for all the files belonging to the LDAP user names. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. Create a new user, we will call it &lt;em&gt;vmail.&lt;/em&gt; Change the &lt;em&gt;Login Shell&lt;/em&gt; to &lt;em&gt;/sbin/nologin&lt;/em&gt;, this user account should not be used for logging in.&lt;/p&gt;&lt;p&gt;2. Take note of the User ID and Home Directory of vmail(example 502).&lt;/p&gt;&lt;p&gt;3. Now note down the &lt;em&gt;Group ID&lt;/em&gt;  of vmail. We’ll be needing all of them later.&lt;/p&gt;&lt;h2&gt;Postfix Active Directory/LDAP Integration&lt;/h2&gt;&lt;br /&gt;1. Create the file &lt;em&gt;/etc/postfix/ldap-users.cf&lt;/em&gt; containing the lines below &lt;pre class="steps"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;server_host = dc.test.vn&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;search_base = &lt;/span&gt;&lt;em style="font-weight: bold; color: rgb(255, 0, 0);"&gt;dc=test,dc=vn&lt;/em&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;version = 3&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;query_filter = (&amp;amp;(objectclass=person)(mail=%s))&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;result_attribute = samaccountname #Account from DC&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;result_format = %s/Maildir/&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;If you are connecting to an Active Directory server and would like to have email alias capability, change the query filter to &lt;tt&gt;(&amp;amp;(objectclass=person)(|(mail=%s)(othermailbox=%s)))&lt;/tt&gt; to include the &lt;em&gt;othermailbox&lt;/em&gt; field in the search.&lt;/p&gt; &lt;p&gt;Change &lt;em&gt;samaccountname&lt;/em&gt; to &lt;em&gt;uid&lt;/em&gt; if you will be connecting to an Active Directory server. If your server requires authentication, add the lines below&lt;/p&gt; &lt;pre class="steps"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;bind = yes&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;bind_dn = cn=mailuser,dc=test,dc=vn&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;bind_dn = mailuser@test.vn&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;2. Test your postfix configuration file by typing in the command&lt;br /&gt;&lt;br /&gt;&lt;pre class="steps"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;postmap -q cuibap@test.vn ldap:/etc/postfix/ldap-users.cf&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If you are querying a Windows 2003 Server and postmap does&lt;br /&gt;not seem to work,try&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/326690"&gt;enabling the Windows 2003 Active Directory&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;3. Edit the postfix configuration file &lt;em&gt;/etc/postfix/main.cf&lt;/em&gt; and edit the line below &lt;pre class="steps"&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;mydestination = $myhostname, localhost.$mydomain, localhost&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;and add the lines below&lt;/p&gt; &lt;pre class="steps"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;virtual_mailbox_domains = $mydomain&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;virtual_mailbox_base = /home/vmail/&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;virtual_mailbox_maps = ldap:/etc/postfix/ldap-users.cf&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;virtual_uid_maps = static:502&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;virtual_gid_maps = static:502&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;em&gt;virtual_mailbox_base&lt;/em&gt;, &lt;em&gt;virtual_uid_maps&lt;/em&gt; and &lt;em&gt;virtual_gid_maps&lt;/em&gt; should contain the home directory, user id and group id of vmail respectively.&lt;br /&gt;&lt;br /&gt;Make sure &lt;em&gt;$mydomain&lt;/em&gt; in &lt;em&gt;mydestination&lt;/em&gt; has been removed, otherwise the lookup will not work and you will get a “User unknown in local recipient table” error.&lt;br /&gt;&lt;br /&gt;4. Restart the Postfix&lt;br /&gt;&lt;br /&gt;5. You should now be able to send email to addresses found in your LDAP server. sing LDAP email addresses instead of the system user names.&lt;br /&gt;&lt;br /&gt;&lt;h2 id="dovecot-ldap"&gt;Dovecot Active Directory/LDAP Integration&lt;/h2&gt;1. Create the file &lt;em&gt;/etc/dovecot-ldap.conf&lt;/em&gt; containing the lines below &lt;div class="m"&gt; &lt;div&gt; &lt;pre class="steps"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;server_host = dc.test.vn&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;search_base = &lt;/span&gt;&lt;em style="font-weight: bold; color: rgb(255, 0, 0);"&gt;dc=test,dc=vn&lt;/em&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;ldap_version = 3&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;auth_bind_userdn = test\%u&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt; &lt;/div&gt; &lt;/div&gt; &lt;p&gt;2. Edit the file &lt;em&gt;/etc/dovecot.conf&lt;/em&gt; and change the value of the following keys below &lt;/p&gt;&lt;pre class="steps"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;auth_username_format = %Lu&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;passdb ldap {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;  args = /etc/dovecot-ldap.conf&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;userdb static {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;  args = uid=502 gid=502 home=/home/vmail/%u&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;&lt;em&gt;uid&lt;/em&gt;, &lt;em&gt;gid&lt;/em&gt; and &lt;em&gt;home&lt;/em&gt; should contain the user id, group id and home directory respectively of the vmail user account.&lt;/p&gt;&lt;p&gt;3. Restart the dovecot service&lt;/p&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-7196010772601272490?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/7196010772601272490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/09/active-directoryldap-virtual-users-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/7196010772601272490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/7196010772601272490'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/09/active-directoryldap-virtual-users-for.html' title='Active Directory/LDAP Virtual Users for RHEL/CentOS 5'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-364312310278210264</id><published>2009-09-11T16:06:00.003+07:00</published><updated>2009-11-12T17:42:23.270+07:00</updated><title type='text'>LOAD BALANCE AND CLUSTER FAILOVER WEBSERVER(INBOUND)USE PFSENSE</title><content type='html'>&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;I/Intro&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;br /&gt;&lt;br /&gt;pfSense&lt;/b&gt; is a FreeBSD-based firewall&lt;a href="http://en.wikipedia.org/wiki/Firewall_%28networking%29" title="Firewall (networking)" class="mw-redirect"&gt;&lt;/a&gt; tailored for use as a firewall and router. The project started in 2004 as a fork of the &lt;span style="text-decoration: underline;"&gt;m0n0wall&lt;/span&gt; project, but focused towards full PC installations rather than the embedded hardware focus of m0n0wall.&lt;br /&gt;&lt;h2&gt;&lt;span class="mw-headline"&gt;Common Deployments&lt;/span&gt;&lt;/h2&gt;&lt;br /&gt;&lt;p&gt;Although mainly deployed as a perimeter firewall, pfSense is versatile enough to fill many types of deployments. Here is a short list of common deployments:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;Perimeter Firewall - As discused earlier, this is by far the most common deployment for pfSense.&lt;/li&gt;&lt;li&gt;Router - Due to the ability to load balance connections and provide failover capabilities, pfSense makes for an ideal choice for a DIY Router for the SMB market.&lt;/li&gt;&lt;li&gt;Wireless Access Point - With the ability of &lt;a href="http://en.wikipedia.org/wiki/Captive_Portal" title="Captive Portal" class="mw-redirect"&gt;&lt;/a&gt;&lt;span style="text-decoration: underline;"&gt;Captive Portal&lt;/span&gt; within it, pfSense can easily be deployed as a wireless hotspot solution.&lt;/li&gt;&lt;li&gt;Special purpose appliance - Some users have decided to utilize pfSense in a unique way to helpfulfill their unique needs. &lt;ul&gt;&lt;li&gt;VPN Appliance&lt;/li&gt;&lt;li&gt;Sniffer Appliance&lt;/li&gt;&lt;li&gt;Dedicated DHCP server&lt;/li&gt;&lt;li&gt;Dedicated DNS server&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h2&gt;&lt;span class="editsection"&gt;&lt;/span&gt; &lt;span class="mw-headline"&gt;Features&lt;/span&gt;&lt;/h2&gt; &lt;p&gt;pfSense includes almost all the features in expensive commercial firewalls, and more in many cases. Here is a list of features taken from the &lt;a href="http://www.pfsense.org/index.php?option=com_content&amp;amp;task=view&amp;amp;id=40&amp;amp;Itemid=43" class="external text" title="http://www.pfsense.org/index.php?option=com_content&amp;amp;task=view&amp;amp;id=40&amp;amp;Itemid=43" rel="nofollow"&gt;pfSense Features page&lt;/a&gt;.&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;span style="text-decoration: underline;"&gt;Firewall&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;State Table&lt;/li&gt;&lt;li&gt;&lt;span style="text-decoration: underline;"&gt;NAT&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Redundancy &lt;ul&gt;&lt;li&gt;&lt;span style="text-decoration: underline;"&gt;CARP&lt;/span&gt;- CARP from OpenBSD allows for hardware failover. Two or more firewalls can be configured as a failover group. If one interface fails on the primary or the primary goes offline entirely, the secondary becomes active. pfSense also includes configuration synchronization capabilities, so you make your configuration changes on the primary and they automatically synchronize to the secondary firewall.&lt;/li&gt;&lt;li&gt;pfsync - pfsync ensures the firewall's state table is replicated to all failover configured firewalls. This means your existing connections will be maintained in the case of failure, which is important to prevent network disruptions.&lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li&gt;Outbound and Inbound load balancing&lt;span style="text-decoration: underline;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="text-decoration: underline;"&gt;VPN - IPsec, OpenVPN, PPTP&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="text-decoration: underline;"&gt; PPPoE Server&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="text-decoration: underline;"&gt; RRD Graphs Reporting&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="text-decoration: underline;"&gt; Real Time Information - Using AJAX&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="text-decoration: underline;"&gt; Dynamic DNS&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="text-decoration: underline;"&gt; Captive portal&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="text-decoration: underline;"&gt; DHCP Server and Relay&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="text-decoration: underline;"&gt; Live CD Version Available&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;II/INSTALL&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SvvmI9tpTBI/AAAAAAAAAT4/9pSIq9HB0s4/s1600-h/5.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 317px; height: 399px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SvvmI9tpTBI/AAAAAAAAAT4/9pSIq9HB0s4/s400/5.jpg" alt="" id="BLOGGER_PHOTO_ID_5403165219640396818" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 1:Install Pfsense from CD&lt;br /&gt;&lt;br /&gt;Step 2:enable vlan or no(I choose "no")&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SvvW63TUCRI/AAAAAAAAAQA/nFPyfjiCh5E/s1600-h/1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 187px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SvvW63TUCRI/AAAAAAAAAQA/nFPyfjiCh5E/s400/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5403148484726753554" border="0" /&gt;&lt;/a&gt;Step 3:enter the lan interface name&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SvvW-ABXXTI/AAAAAAAAAQI/kMNTYJml-o4/s1600-h/2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 193px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SvvW-ABXXTI/AAAAAAAAAQI/kMNTYJml-o4/s400/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5403148538607000882" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 4:enter the wan interface name&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SvvXCVy6TBI/AAAAAAAAAQQ/tR9VmOLFFKM/s1600-h/3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 200px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SvvXCVy6TBI/AAAAAAAAAQQ/tR9VmOLFFKM/s400/3.JPG" alt="" id="BLOGGER_PHOTO_ID_5403148613171432466" border="0" /&gt;&lt;/a&gt;Step 5: enter&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SvvXGCNqc-I/AAAAAAAAAQY/h1BSmmfXSEA/s1600-h/4.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 226px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SvvXGCNqc-I/AAAAAAAAAQY/h1BSmmfXSEA/s400/4.JPG" alt="" id="BLOGGER_PHOTO_ID_5403148676634407906" border="0" /&gt;&lt;/a&gt;Step 6 type "y"&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SvvXI5TwAbI/AAAAAAAAAQg/kYbxw3QmdHw/s1600-h/5.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 227px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SvvXI5TwAbI/AAAAAAAAAQg/kYbxw3QmdHw/s400/5.JPG" alt="" id="BLOGGER_PHOTO_ID_5403148725783626162" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 7: setup ip adrress as Diagram&lt;br /&gt;&lt;span style="font-size:180%;"&gt; &lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;III/LOAD BALANCE WEB&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Step 8:Set up Load Balancing Pool&lt;br /&gt;&lt;br /&gt;The first thing to do is create a pool (&lt;b&gt;Services&lt;/b&gt; &gt; &lt;b&gt;Load Balancer&lt;/b&gt; &gt; &lt;b&gt;Add&lt;/b&gt;).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SvvXTK4GlBI/AAAAAAAAAQo/wKodSzOAyWU/s1600-h/6.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 245px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SvvXTK4GlBI/AAAAAAAAAQo/wKodSzOAyWU/s400/6.JPG" alt="" id="BLOGGER_PHOTO_ID_5403148902298194962" border="0" /&gt;&lt;/a&gt;Step 9:Set up virtual server&lt;br /&gt;&lt;br /&gt;Adding a new Virtual Server (&lt;span style="font-weight: bold;"&gt;Services &gt; Load balancer &gt; Virtual Servers &gt; Add &lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SvvXWD60M7I/AAAAAAAAAQw/ynEtQuccRiQ/s1600-h/7.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 162px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SvvXWD60M7I/AAAAAAAAAQw/ynEtQuccRiQ/s400/7.JPG" alt="" id="BLOGGER_PHOTO_ID_5403148951970132914" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 10: Set up virtual ip address&lt;br /&gt;&lt;br /&gt;Adding a new Virtual IP (Firewall &gt; Virtual IPs &gt;  Add )&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SvvXZUX37KI/AAAAAAAAAQ4/72vZ2M0qGio/s1600-h/8.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 176px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SvvXZUX37KI/AAAAAAAAAQ4/72vZ2M0qGio/s400/8.JPG" alt="" id="BLOGGER_PHOTO_ID_5403149007926586530" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step 11:Create Nat(Firewall &gt; Nat &gt; Add)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_MzplYSbgF84/SvvXfqHLvFI/AAAAAAAAARA/fa8xMazbSY4/s1600-h/9.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 263px;" src="http://3.bp.blogspot.com/_MzplYSbgF84/SvvXfqHLvFI/AAAAAAAAARA/fa8xMazbSY4/s400/9.JPG" alt="" id="BLOGGER_PHOTO_ID_5403149116841376850" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Note: open port 80 from Internet access to 192.168.0.5 and 192.168.0.6&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Step 12:Access to &lt;img src="file:///C:/DOCUME%7E1/quan.hoa/LOCALS%7E1/Temp/moz-screenshot-1.png" alt="" /&gt;http://192.168.20.204/ and check status load balance&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SvvXiAEXO6I/AAAAAAAAARI/fImhcMOxyTM/s1600-h/10.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 148px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SvvXiAEXO6I/AAAAAAAAARI/fImhcMOxyTM/s400/10.JPG" alt="" id="BLOGGER_PHOTO_ID_5403149157094865826" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_MzplYSbgF84/SvvXlH_91PI/AAAAAAAAARQ/5KZ-mJg1bvo/s1600-h/11.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 102px;" src="http://3.bp.blogspot.com/_MzplYSbgF84/SvvXlH_91PI/AAAAAAAAARQ/5KZ-mJg1bvo/s400/11.JPG" alt="" id="BLOGGER_PHOTO_ID_5403149210763515122" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Step 13:Disconnect 192.168.0.5 Access to http://192.168.20.204/ and check status load balance&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SvvXti58sTI/AAAAAAAAARY/-_v0nDtzmfE/s1600-h/12.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 137px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SvvXti58sTI/AAAAAAAAARY/-_v0nDtzmfE/s400/12.JPG" alt="" id="BLOGGER_PHOTO_ID_5403149355424985394" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SvvXwOvK3iI/AAAAAAAAARg/OUYsemOkIao/s1600-h/13.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 127px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SvvXwOvK3iI/AAAAAAAAARg/OUYsemOkIao/s400/13.JPG" alt="" id="BLOGGER_PHOTO_ID_5403149401550675490" border="0" /&gt;&lt;/a&gt;IV/CLUSTER FAILOVER&lt;br /&gt;&lt;br /&gt;As LOAD balance but choose Failover&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SvvXy2KRXiI/AAAAAAAAARo/6UPJCFawrfQ/s1600-h/14.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 273px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SvvXy2KRXiI/AAAAAAAAARo/6UPJCFawrfQ/s400/14.JPG" alt="" id="BLOGGER_PHOTO_ID_5403149446493068834" border="0" /&gt;&lt;/a&gt;Besides pfsense can create cluster fail over  firewall and load balance outbound&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-364312310278210264?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/364312310278210264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/09/load-balance-and-cluster-failover.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/364312310278210264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/364312310278210264'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/09/load-balance-and-cluster-failover.html' title='LOAD BALANCE AND CLUSTER FAILOVER WEBSERVER(INBOUND)USE PFSENSE'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MzplYSbgF84/SvvmI9tpTBI/AAAAAAAAAT4/9pSIq9HB0s4/s72-c/5.jpg' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-2657122808770386626</id><published>2009-09-10T17:44:00.001+07:00</published><updated>2009-11-12T17:42:31.634+07:00</updated><title type='text'>Redundant Load Balancers Using VRRP</title><content type='html'>&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;I/INTRO&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Pen offers fault tolerance by automatically rerouting traffic from servers that are offline. But what if the load balancer goes down?  Using VRRP, it is possible to run two load balancers in an active-passive failover configuration&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SvvluC7XWKI/AAAAAAAAATY/fXiR8k-kIKY/s1600-h/1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 335px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SvvluC7XWKI/AAAAAAAAATY/fXiR8k-kIKY/s400/1.jpg" alt="" id="BLOGGER_PHOTO_ID_5403164757183649954" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-size:180%;" &gt;&lt;span style="font-weight: bold;"&gt;II/INSTALL VRRP&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;[root@ ~]wget http://downloads.sourceforge.net/project/vrrpd/vrrpd/1.0/vrrpd-1.0.tar.gz?use_mirror=biznetnetworks&lt;br /&gt;&lt;pre&gt;1. uncompress the source&lt;br /&gt;2. cd in the directory&lt;br /&gt;3. type 'make'(Please install gcc* before type make by "yum -y install gcc*")&lt;br /&gt;[root@ ~] cp vrrpd /usr/sbin/vrrpd&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt; Install pen and vrrpd on the two load balancer hosts. Start pen on both load balancers and check that both work by surfing to http://102.168.0.1/ and http://102.168.0.2/. &lt;/p&gt;&lt;p&gt; Now start vrrpd like this on both load balancers: &lt;/p&gt;&lt;p&gt; &lt;/p&gt; [root@ ~]vrrpd -i eth1 -v 1 192.168.0.3&lt;br /&gt;&lt;br /&gt;Now try surfing to http://192.168.0.3/. One of the load balancers will be active and respond at that address&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_MzplYSbgF84/SvvmGVQo0qI/AAAAAAAAATw/DfcaoetLkBM/s1600-h/4.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 172px;" src="http://3.bp.blogspot.com/_MzplYSbgF84/SvvmGVQo0qI/AAAAAAAAATw/DfcaoetLkBM/s400/4.JPG" alt="" id="BLOGGER_PHOTO_ID_5403165174421574306" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Disconnect &lt;span style="font-weight: bold;"&gt;"MASTER"&lt;/span&gt; .Now &lt;span style="font-weight: bold;"&gt;"SLAVE"&lt;/span&gt; restoring functionality.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SvvlxIJLrfI/AAAAAAAAATg/3rYIrnwFD-g/s1600-h/2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 199px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SvvlxIJLrfI/AAAAAAAAATg/3rYIrnwFD-g/s400/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5403164810123390450" border="0" /&gt;&lt;/a&gt;Connect &lt;span style="font-weight: bold;"&gt;"MASTER"&lt;/span&gt; .Disconnect &lt;span style="font-weight: bold;"&gt;"SLAVE"&lt;/span&gt; ,&lt;span style="font-weight: bold;"&gt;"MASTER" &lt;/span&gt; restoring functionality&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SvvlzzgkVlI/AAAAAAAAATo/nxZ8E3Fg05I/s1600-h/3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 201px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SvvlzzgkVlI/AAAAAAAAATo/nxZ8E3Fg05I/s400/3.JPG" alt="" id="BLOGGER_PHOTO_ID_5403164856123938386" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-2657122808770386626?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/2657122808770386626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/09/redundant-load-balancers-using-vrrp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/2657122808770386626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/2657122808770386626'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/09/redundant-load-balancers-using-vrrp.html' title='Redundant Load Balancers Using VRRP'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_MzplYSbgF84/SvvluC7XWKI/AAAAAAAAATY/fXiR8k-kIKY/s72-c/1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-2299065411355483494</id><published>2009-09-08T16:52:00.001+07:00</published><updated>2009-11-12T17:27:15.042+07:00</updated><title type='text'>LOAD BALANCE WEB SERVER USE PEN</title><content type='html'>&lt;span style="font-weight: bold;font-size:180%;" &gt;&lt;span style="color: rgb(0, 0, 153);"&gt;I/Intro&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is pen, a load balancer for "simple" tcp based protocols such as http or smtp. It allows several servers to appear as one to the outside and automatically detects servers that are down and distributes clients among the available servers. This gives high availability and scalable performance. &lt;p&gt; &lt;/p&gt; &lt;p&gt; The load balancing algorithm keeps track of clients and will try to send them back to the server they visited the last time. The client table has a number of slots (default 2048, settable through command-line arguments). When the table is full, the least recently used one will be thrown out to make room for the new one. &lt;/p&gt;&lt;p&gt; This is superior to a simple round-robin algorithm, which sends a client that connects repeatedly to different servers. Doing so breaks applications that maintain state between connections in the server, including most modern web applications. &lt;/p&gt;&lt;p&gt; When pen detects that a server is unavailable, it scans for another starting with the server after the most recently used one. That way we get load balancing and "fair" failover for free. &lt;/p&gt; Correctly configured, pen can ensure that a server farm is always available, even when individual servers are brought down for maintenance or reconfiguration. The final single point of failure, pen itself, can be eliminated by running pen on several servers, using vrrp to decide which is active.&lt;br /&gt;&lt;br /&gt;Refer:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://siag.nu/pen/"&gt;http://siag.nu/pen/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt; &lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;II/Install&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This example is based on follwing environmet.&lt;br /&gt;&lt;br /&gt;(1) cluster.test.vn  [192.168.20.101] Pen Server&lt;br /&gt;(2) www1.test.vn   [192.168.20.203]  Web Server #1&lt;br /&gt;(3) www2.test.vn   [192.168.20.83]  Web Server #2&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;1/Install and configure Pen &lt;/span&gt;&lt;br /&gt;[root@ ~]# wget http://dag.wieers.com/rpm/packages/pen/pen-0.17.2-1.el5.rf.i386.rpm&lt;br /&gt;[root@ ~]#rpm -Uvh pen-0.17.2-1.el5.rf.i386.rpm&lt;br /&gt;[root@ ~]#vim /etc/rc.d/init.d/pen&lt;div style="font-weight: bold; color: rgb(255, 0, 0);" class="pos12"&gt;&lt;div class="color2"&gt;# make scripts&lt;/div&gt;&lt;/div&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; &lt;/span&gt;  &lt;div style="font-weight: bold; color: rgb(255, 0, 0);" class="color2"&gt;# an example&lt;/div&gt;  &lt;div style="font-weight: bold; color: rgb(255, 0, 0);" class="color1"&gt; #!/bin/bash&lt;br /&gt;#&lt;br /&gt;# Pen: Starting Pen&lt;br /&gt;#&lt;br /&gt;# chkconfig: 345 93 92&lt;br /&gt;# description:Simple load-balancer&lt;br /&gt;# processname: pen&lt;br /&gt;&lt;br /&gt;. /etc/rc.d/init.d/functions&lt;br /&gt;&lt;br /&gt;pen="/usr/local/bin/pen"&lt;br /&gt;lockfile="/var/lock/subsys/pen"&lt;br /&gt;prog="pen"&lt;br /&gt;RETVAL=0&lt;br /&gt;&lt;br /&gt;&lt;div class="color2"&gt;# PID file&lt;/div&gt;&lt;br /&gt;PID=/var/run/pen.pid-80&lt;br /&gt;&lt;div class="color2"&gt;# log file&lt;/div&gt;&lt;br /&gt;LOGFILE=/var/log/pen.log&lt;br /&gt;&lt;div class="color2"&gt;# control port&lt;/div&gt;&lt;br /&gt;CONTROL=localhost:10080&lt;br /&gt;&lt;div class="color2"&gt;# max connections&lt;/div&gt;&lt;br /&gt;MAX_CONNECTIONS=500&lt;br /&gt;&lt;div class="color2"&gt;# port&lt;/div&gt;&lt;br /&gt;PORT=80&lt;br /&gt;&lt;div class="color2"&gt;# number of servers&lt;/div&gt;&lt;br /&gt;SERVERS=2&lt;br /&gt;&lt;div class="color2"&gt;# IP of a server #1&lt;/div&gt;&lt;br /&gt;SERVER1=192.168.20.203:80&lt;br /&gt;&lt;div class="color2"&gt;# IP of a server #2&lt;/div&gt;&lt;br /&gt;SERVER2=192.168.20.83:80&lt;br /&gt;&lt;br /&gt;start() {&lt;br /&gt;echo -n $"Starting $prog: "&lt;br /&gt;daemon $pen -x $MAX_CONNECTIONS -S $SERVERS -p $PID -l $LOGFILE -C $CONTROL -r $PORT $SERVER1 $SERVER2&lt;br /&gt;RETVAL=$?&lt;br /&gt;echo&lt;br /&gt;[ $RETVAL = 0 ] &amp;amp;&amp;amp; touch $lockfile&lt;br /&gt;return $RETVAL&lt;br /&gt;}&lt;br /&gt;stop() {&lt;br /&gt;echo -n $"Stopping $prog: "&lt;br /&gt;killproc $pen&lt;br /&gt;RETVAL=$?&lt;br /&gt;echo&lt;br /&gt;[ $RETVAL = 0 ] &amp;amp;&amp;amp; rm -f $lockfile&lt;br /&gt;return $RETVAL&lt;br /&gt;}&lt;br /&gt;case "$1" in&lt;br /&gt;start)&lt;br /&gt;start&lt;br /&gt;;;&lt;br /&gt;stop)&lt;br /&gt;stop&lt;br /&gt;;;&lt;br /&gt;restart)&lt;br /&gt;stop&lt;br /&gt;start&lt;br /&gt;;;&lt;br /&gt;status)&lt;br /&gt;status $pen&lt;br /&gt;;;&lt;br /&gt;*)&lt;br /&gt;echo "Usage: $prog {start|stop|restart|status}"&lt;br /&gt;exit 1&lt;br /&gt;esac&lt;br /&gt;&lt;br /&gt;exit $?&lt;/div&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; &lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;&lt;br /&gt;[root@lan ~]#&lt;/span&gt;vi /etc/logrotate.d/pen &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; &lt;/span&gt;  &lt;div style="font-weight: bold; color: rgb(255, 0, 0);" class="color2"&gt;# an example&lt;/div&gt;  &lt;div class="color1"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; /var/log/pen.log {&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;    daily&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;    copytruncate&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;    compress&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;    notifempty&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;    missingok&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;    postrotate&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;      /etc/rc.d/init.d/pen restart 2&gt;&amp;amp;1 &gt; /dev/null || true&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;    endscript&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[root@lan ~]#chmod 755 /etc/rc.d/init.d/pen&lt;br /&gt;[root@lan ~]#/etc/rc.d/init.d/pen startStarting pen:      [   OK   ]&lt;br /&gt;[root@lan ~]#chkconfig --add pen&lt;br /&gt;[root@lan ~]#chkconfig pen on&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-size:130%;" &gt;&lt;span style="font-weight: bold;"&gt;2/Configure a tool that shows status of Pen from web browser. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[root@lan ~]#vi /etc/rc.d/init.d/pen&lt;br /&gt;&lt;br /&gt;&lt;div style="color: rgb(255, 0, 0); font-weight: bold;" class="color2"&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;# line 16: specify html file&lt;/span&gt;  &lt;div style="color: rgb(255, 0, 0); font-weight: bold;" class="color1"&gt;WEBFILE=/var/www/html/pen/index.html&lt;/div&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; PID=/var/run/pen.pid-80&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; LOGFILE=/var/log/pen.log&lt;/span&gt;&lt;br /&gt;&lt;div class="color2"&gt;# add options&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;daemon $pen &lt;span style="color: rgb(153, 51, 153);"&gt;-w $WEBFILE&lt;/span&gt; -x $MAX_CONNECTIONS -S $SERVERS -p $PID -l $LOGFILE -C $CONTROL -r $PORT $SERVER1 $SERVER2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[root@lan ~]#cp /usr/local/doc/pen/penstats /usr/local/bin/&lt;br /&gt;[root@lan ~]#vi /usr/local/bin/penstats&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; #!/bin/sh&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; &lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; PENHOME=/home/ulric/Projekt/pen&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; PIDFILE=/var/run/pen.pid-80&lt;/span&gt;&lt;div style="font-weight: bold; color: rgb(255, 0, 0);" class="pos12"&gt;&lt;div class="color2"&gt;# change&lt;/div&gt;&lt;/div&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; WEBFILE=/var/www/html/pen/index.html&lt;/span&gt;&lt;div style="font-weight: bold; color: rgb(255, 0, 0);" class="pos12"&gt;&lt;div class="color2"&gt;# change&lt;/div&gt;&lt;/div&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; &lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; # This will make pen save its stats&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; kill -USR1 `cat $PIDFILE`&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; &lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; # We don't know how long it will take; wait a few seconds&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; sleep 2&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; &lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; # And display the results&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; echo "Content-type: text/html"&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; echo&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; cat $WEBFILE&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[root@lan ~]#/etc/rc.d/init.d/pen restart&lt;br /&gt;Stopping pen:[  OK  ]&lt;br /&gt;Starting pen:[  OK  ]&lt;br /&gt;[root@lan ~]#chmod 755 /usr/local/bin/penstats&lt;br /&gt;[root@lan ~]#/usr/local/bin/penstats# run&lt;br /&gt;[root@lan ~]#crontab -e&lt;br /&gt;&lt;br /&gt;&lt;div class="color1"&gt;*/1 * * * * /usr/local/bin/penstats&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;3/Access to Pen server with web browser. A backend server answers normally like below.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 102, 0);"&gt;   a/First Request&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SvviBUjNW8I/AAAAAAAAASw/2iehay0n9OU/s1600-h/1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 115px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SvviBUjNW8I/AAAAAAAAASw/2iehay0n9OU/s400/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5403160690285173698" border="0" /&gt;&lt;/a&gt; &lt;span style="font-weight: bold; color: rgb(0, 102, 0);"&gt;b/Second request&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/Svvh-dFjlUI/AAAAAAAAASo/kcJpHbZ43Zs/s1600-h/2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 169px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/Svvh-dFjlUI/AAAAAAAAASo/kcJpHbZ43Zs/s400/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5403160641037112642" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SvviVFrsoCI/AAAAAAAAAS4/IbgdGo30HE4/s1600-h/3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 357px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SvviVFrsoCI/AAAAAAAAAS4/IbgdGo30HE4/s400/3.JPG" alt="" id="BLOGGER_PHOTO_ID_5403161029891629090" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;4/ Stop httpd on a server  now and access to pen server again. Another backend server answers normally like below.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-size:100%;" &gt;a/ Stop http in 192.168.20.203&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/Svvh-dFjlUI/AAAAAAAAASo/kcJpHbZ43Zs/s1600-h/2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 169px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/Svvh-dFjlUI/AAAAAAAAASo/kcJpHbZ43Zs/s400/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5403160641037112642" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/Svvia-Dxn-I/AAAAAAAAATA/SvSqWlYOoTQ/s1600-h/4.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 344px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/Svvia-Dxn-I/AAAAAAAAATA/SvSqWlYOoTQ/s400/4.JPG" alt="" id="BLOGGER_PHOTO_ID_5403161130924351458" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;     &lt;span style="color: rgb(0, 102, 0);font-size:100%;" &gt;b/ Stop http in 192.168.20.83&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SvviBUjNW8I/AAAAAAAAASw/2iehay0n9OU/s1600-h/1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 115px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SvviBUjNW8I/AAAAAAAAASw/2iehay0n9OU/s400/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5403160690285173698" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SvvidgGU9YI/AAAAAAAAATI/uiosr3-5LVk/s1600-h/5.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 377px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SvvidgGU9YI/AAAAAAAAATI/uiosr3-5LVk/s400/5.JPG" alt="" id="BLOGGER_PHOTO_ID_5403161174421599618" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Note:you need configure Apache listen port 81:&lt;br /&gt;&lt;br /&gt;change listen  port 80 to 81&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/Svvigl9WTeI/AAAAAAAAATQ/x28UNSp9wAI/s1600-h/6.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 253px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/Svvigl9WTeI/AAAAAAAAATQ/x28UNSp9wAI/s400/6.JPG" alt="" id="BLOGGER_PHOTO_ID_5403161227534159330" border="0" /&gt;&lt;/a&gt;&lt;span style=";font-family:times new roman;font-size:180%;"  &gt;&lt;span style="color: rgb(51, 204, 255); font-weight: bold;"&gt;Besides Pen can loadbalance other service (FTP,HTTPS,SMTP,POP3...)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;pen -l pen443.log -p pen443.pid 192.168.20.101:443&lt;br /&gt;192.168.20.203:443 192.168.20.83:443&lt;br /&gt;(LOAD BALANCE HHTPS)&lt;br /&gt;&lt;br /&gt;pen -l pen110.log -p pen110.pid 192.168.20.101:110&lt;br /&gt;192.168.20.203:110 192.168.20.83:110&lt;br /&gt;(LOAD BALANCE POP3)&lt;br /&gt;&lt;br /&gt;pen -l pen25.log -p pen25.pid 192.168.20.101:25&lt;br /&gt;192.168.20.203:25 192.168.20.83:25&lt;br /&gt;(LOAD BALANCE SMTP)&lt;br /&gt;&lt;br /&gt;pen -l pen21.log -p pen21.pid 192.168.20.101:21&lt;br /&gt;192.168.20.203:21 192.168.20.83:21&lt;br /&gt;(LOAD BALANCE FTP)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-2299065411355483494?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/2299065411355483494/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/09/load-balance-web-server-use-pen.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/2299065411355483494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/2299065411355483494'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/09/load-balance-web-server-use-pen.html' title='LOAD BALANCE WEB SERVER USE PEN'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MzplYSbgF84/SvviBUjNW8I/AAAAAAAAASw/2iehay0n9OU/s72-c/1.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-3270063184193626388</id><published>2009-09-04T17:49:00.000+07:00</published><updated>2009-09-04T17:54:00.210+07:00</updated><title type='text'>Install ClamAV</title><content type='html'>[root@lan ~]#yum  -y install clamav  // (or download clamav and clam-db for install manual)&lt;br /&gt;[root@lan ~]#vim /etc/freshclam.conf&lt;br /&gt;&lt;br /&gt;&lt;div class="color1"&gt;&lt;div style="font-weight: bold; color: rgb(255, 0, 0);" class="color1"&gt;#NotifyClamd /etc/clamd.conf&lt;/div&gt;&lt;br /&gt;[root@lan ~]#freshclam // update policy file&lt;br /&gt;&lt;div class="pos5"&gt;&lt;div class="color2"&gt;&lt;br /&gt;[root@lan ~]#clamscan --infected --remove --recursive /home&lt;br /&gt;&lt;div class="color1"&gt;[root@lan ~]#wget http://www.eicar.org/download/eicar.com&lt;br /&gt;&lt;div class="color2"&gt;[root@lan ~]#clamscan --infected --remove --recursive .&lt;br /&gt;&lt;br /&gt;You will detect and delete virus&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-3270063184193626388?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/3270063184193626388/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/09/install-clamav.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/3270063184193626388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/3270063184193626388'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/09/install-clamav.html' title='Install ClamAV'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-2634660129118785535</id><published>2009-09-04T17:02:00.000+07:00</published><updated>2009-09-04T18:00:15.354+07:00</updated><title type='text'>INSTALL PROXY WITH ANTIVIRUS AND DB BLACKLIST</title><content type='html'>&lt;span style="font-weight: bold; color: rgb(0, 0, 153);font-size:180%;" &gt;I/INSTAL SQUID PROXY&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;1/Install and configure squid &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[root@lan ~]#yum -y install squid&lt;br /&gt;[root@lan ~]#vi /etc/squid/squid.conf&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;http_port 8080 &lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt; acl CONNECT method CONNECT&lt;/span&gt;  &lt;div style="font-weight: bold; color: rgb(102, 0, 204);" class="color1"&gt;acl lan src 192.168.0.0/255.255.255.0&lt;/div&gt;&lt;div style="font-weight: bold; color: rgb(102, 0, 204);" class="pos12"&gt;&lt;div class="color2"&gt;// (permit only LAN)&lt;/div&gt;&lt;/div&gt; &lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt; &lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt; http_access allow localhost&lt;/span&gt;  &lt;div style="font-weight: bold; color: rgb(102, 0, 204);" class="color1"&gt;http_access allow lan&lt;/div&gt;&lt;div style="font-weight: bold; color: rgb(102, 0, 204);" class="pos12"&gt;&lt;div class="color2"&gt;//  add (permit only LAN)&lt;/div&gt;&lt;/div&gt; &lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt; http_access deny all&lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt; &lt;/span&gt;  &lt;div style="font-weight: bold; color: rgb(102, 0, 204);" class="color1"&gt;visible_hostname test.vn&lt;br /&gt;&lt;/div&gt;&lt;div style="font-weight: bold; color: rgb(102, 0, 204);" class="pos12"&gt;&lt;div class="color2"&gt;//  add (specify hostname)&lt;/div&gt;&lt;/div&gt; &lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt; &lt;/span&gt; &lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt; # forwarded_for on&lt;/span&gt;  &lt;div style="font-weight: bold; color: rgb(102, 0, 204);" class="color1"&gt;forwarded_for off&lt;/div&gt;&lt;div style="font-weight: bold; color: rgb(102, 0, 204);" class="pos12"&gt;&lt;div class="color2"&gt;//  add (hide IP address)&lt;/div&gt;&lt;/div&gt; &lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt; &lt;/span&gt;  &lt;div style="font-weight: bold; color: rgb(102, 0, 204);" class="color1"&gt; header_access Referer deny all&lt;div class="pos12"&gt;&lt;div class="color2"&gt;//  add&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;header_access X-Forwarded-For deny all&lt;br /&gt;header_access Via deny all&lt;br /&gt;header_access Cache-Control deny all &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;[root@lan ~]#/etc/rc.d/init.d/squid start&lt;br /&gt;init_cache_dir /var/spool/squid... Starting squid:[  OK  ]&lt;br /&gt;[root@lan ~]#chkconfig squid on&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-size:180%;" &gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;II/PROXY WITH ANTI VIRUS&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Configure Proxy in order to scan download files to protect from virus. Install &lt;a href="http://conheotiensinh.blogspot.com/2009/09/install-clamav.html"&gt;&lt;span style="text-decoration: underline;"&gt;clamav&lt;/span&gt;&lt;/a&gt; first&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;1/Install clamd&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="color1"&gt;[root@lan ~]#yum -y install clamd ( Or download from http://rpm.pbone.net/)&lt;br /&gt;[root@lan ~]#vim /etc/clamd.conf&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 51, 255);"&gt; LocalSocket /var/run/clamav/clamd.sock //change&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;[2] Install squidclamav&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[root@lan ~]# wget http://www.darold.net/projects/squidclamav/squidclamav-4.0.tar.gz&lt;br /&gt;root@lan ~]#tar zxvf squidclamav-4.0.tar.gz&lt;br /&gt;[root@lan ~]#cd squidclamav-4.0&lt;br /&gt;[root@lan squidclamav-4.0]#./configure&lt;br /&gt;[root@lan squidclamav-4.0]#make&lt;br /&gt;[root@lan squidclamav-4.0]#make install&lt;br /&gt;[root@lan squidclamav-4.0]#cp squidclamav.conf.dist /etc/squidclamav.conf&lt;br /&gt;[root@lan squidclamav-4.0]#cd&lt;br /&gt;[root@lan ~]#vim /etc/squidclamav.conf&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;proxy http://127.0.0.1:8080/// change ( proxy address )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;logfile /var/log/squid/squidclamav.log// change ( log file )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;redirect http://www.yahoo.com/// change ( redirect URL )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;# squidguard /usr/local/squidGuard/bin/squidGuard&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;debug 0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;force 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;stat 1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;clamd_local /var/run/clamav/clamd.sock// change&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;clamd_ip 127.0.0.1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;clamd_port 3310&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;timeout 60&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;abort ^.*\.gz$&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;abort ^.*\.bz2$&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;abort ^.*\.pdf$&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;abort ^.*\.js$&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;abort ^.*\.html$&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;abort ^.*\.css$&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;abort ^.*\.xml$&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;abort ^.*\.xsl$&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;abort ^.*\.js$&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;abort ^.*\.ico$&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;aborti ^.*\.gif$&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;aborti ^.*\.png$&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;aborti ^.*\.jpg$&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;aborti ^.*\.swf$&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;content ^.*application\/.*$&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(102, 0, 204);"&gt;whitelist .*yahoo\.com&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);font-size:180%;" &gt;[3] Configurarion of squid&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[root@lan ~]#vim /etc/squid/squid.conf&lt;br /&gt;&lt;br /&gt;&lt;div style="font-weight: bold; color: rgb(102, 0, 204);" class="color2"&gt;add these 3 lines at the bottom&lt;/div&gt;&lt;br /&gt;&lt;div style="font-weight: bold; color: rgb(102, 0, 204);" class="color1"&gt;url_rewrite_access deny localhost&lt;br /&gt;redirect_program /usr/local/bin/squidclamav&lt;br /&gt;redirect_children 15&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;[root@lan ~]#touch /var/log/squid/squidclamav.log&lt;br /&gt;[root@lan ~]#chown squid. /var/log/squid/squidclamav.log&lt;br /&gt;[root@lan ~]#vim /etc/logrotate.d/squid&lt;br /&gt;&lt;br /&gt;&lt;div style="color: rgb(102, 0, 204); font-weight: bold;" class="color2"&gt;add at the bottom&lt;/div&gt;&lt;br /&gt;&lt;div class="color1"&gt;&lt;span style="color: rgb(102, 0, 204); font-weight: bold;"&gt; /var/log/squid/squidclamav.log {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 204); font-weight: bold;"&gt;    weekly&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 204); font-weight: bold;"&gt;    rotate 5&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 204); font-weight: bold;"&gt;    copytruncate&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 204); font-weight: bold;"&gt;    compress&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 204); font-weight: bold;"&gt;    notifempty&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 204); font-weight: bold;"&gt;    missingok&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 204); font-weight: bold;"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;[root@lan ~]#/etc/rc.d/init.d/squid restart&lt;br /&gt;Stopping squid: .............[  OK  ]&lt;br /&gt;Starting squid: .[  OK  ]          &lt;table class="t4" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="ko"&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style="color: rgb(0, 0, 153);font-size:180%;" &gt;&lt;span style="font-weight: bold;"&gt;III/PROXY WITH SQUIDGRARD&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;[1] Install squidguard &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[root@lan ~]#yum  -y install squidguard    [root@lan ~]#mv /etc/squid/squidguard.conf /etc/squid/squidguard.conf.bk&lt;br /&gt;[root@lan ~]#vi /etc/squid/squidguard.conf&lt;br /&gt;&lt;br /&gt;&lt;div class="color2"&gt;// configure like following example&lt;/div&gt;&lt;br /&gt;&lt;div class="color1"&gt; #&lt;br /&gt;# CONFIG FILE FOR SQUIDGUARD&lt;br /&gt;#&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;dbhome /var/lib/squidguard&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; logdir /var/log/squidguard&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt; &lt;/span&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;/div&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;dest dame {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;div style="font-weight: bold; color: rgb(255, 0, 0);" class="pos11"&gt;domainlist dame/domains   &lt;/div&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;urllist dame/urls &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;  &lt;/span&gt;&lt;div style="font-weight: bold; color: rgb(255, 0, 0);" class="pos11"&gt;}&lt;br /&gt;acl {&lt;br /&gt;&lt;div class="pos11"&gt;default {&lt;/div&gt; &lt;div class="pos7"&gt;pass !dame all&lt;/div&gt; &lt;div class="pos7"&gt;redirect http://www.yahoo.com/   &lt;/div&gt;&lt;br /&gt;&lt;div class="pos11"&gt;}&lt;/div&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: normal; color: rgb(255, 255, 255);"&gt;[root@lan ~]#mkdir /var/lib/squidguard/dame&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal; color: rgb(255, 255, 255);"&gt; [root@lan ~]#vi /var/lib/squidguard/dame/domains&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="color2"&gt;// write domains you'd like to prohibit to access&lt;/div&gt;&lt;br /&gt;&lt;div class="color1"&gt; yahoo.com&lt;br /&gt;conheotiensinh.blogspot.com&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: normal; color: rgb(255, 255, 255);"&gt;[root@lan ~]#vi /var/lib/squidguard/dame/urls&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="color2"&gt;// writeURLs you'd like to prohibit to access&lt;/div&gt;&lt;br /&gt;&lt;div class="color1"&gt; www.yahoo.com/deny/&lt;br /&gt;conheotiensinh.blogspot.com /&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;[root@lan ~]#squidGuard -C all// create DB&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt; [root@lan ~]#chown -R squid. /var/lib/squidguard/dame&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt; [root@lan ~]#vim /etc/squidclamav.conf&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;squidguard /usr/bin/squidguard&lt;div class="pos5"&gt;&lt;div class="color2"&gt;// line 42: make valid and change PASS&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: normal; color: rgb(255, 255, 255);"&gt;[root@lan ~]#/etc/rc.d/init.d/squid restart&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal; color: rgb(255, 255, 255);"&gt; Stopping squid: .............[  OK  ]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: normal; color: rgb(255, 255, 255);"&gt; Starting squid: .[  OK  ]&lt;/span&gt;          &lt;table class="t4" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="ko"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt; &lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;span style="color: rgb(255, 255, 255);font-size:130%;" &gt;&lt;span style="font-weight: normal;"&gt;2/Try to access to Yahoo set as prohibited domain in . Anyway, this redirect setting is an example to show action of this squidGuard,  but please make your own original redirect page because it's meaningless to redirect to google like this example.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-2634660129118785535?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/2634660129118785535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/09/install-proxy-with-antivirus-and-db.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/2634660129118785535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/2634660129118785535'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/09/install-proxy-with-antivirus-and-db.html' title='INSTALL PROXY WITH ANTIVIRUS AND DB BLACKLIST'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-9140617553700782899</id><published>2009-09-01T16:54:00.007+07:00</published><updated>2010-08-06T08:48:09.673+07:00</updated><title type='text'>Cluster Linux Mail Server</title><content type='html'>&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold;"&gt;1/Install heart beart for Cluster&lt;/span&gt;&lt;/span&gt;&lt;h4&gt;Please refer:&lt;/h4&gt;&lt;h4&gt;&lt;a href="http://conheotiensinh.blogspot.com/2009/08/high-availability-http-use-heartbeat.html"&gt;http://conheotiensinh.blogspot.com/2009/08/high-availability-http-use-heartbeat.html&lt;/a&gt;&lt;/h4&gt;&lt;span style="visibility: visible; font-weight: bold;" id="main"&gt;&lt;span style="visibility: visible;" id="search"&gt;&lt;cite&gt;&lt;a href="http://www.linux-ha.org/"&gt;http://www.linux-ha.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/cite&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="visibility: visible; color: rgb(51, 255, 255);font-family:times new roman;font-size:180%;" id="main"&gt;&lt;span style="visibility: visible;" id="search"&gt;&lt;cite&gt;&lt;span style=""&gt;&lt;span style="font-weight: bold;"&gt;USE Pfsense for load balance or Cluster FailOver&lt;/span&gt;&lt;/span&gt;&lt;/cite&gt;&lt;/span&gt;&lt;/span&gt;(&lt;span style="font-weight: bold;"&gt;&lt;a href="http://conheotiensinh.blogspot.com/2009/09/load-balance-and-cluster-failover.htm"&gt;http://conheotiensinh.blogspot.com/2009/09/load-balance-and-cluster-failover.htm&lt;/a&gt;l&lt;/span&gt;&lt;span style="visibility: visible; color: rgb(51, 255, 255);font-family:times new roman;font-size:180%;" id="main"&gt;&lt;span style="visibility: visible;" id="search"&gt;&lt;cite&gt;&lt;span style=""&gt;)&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0); font-weight: bold;"&gt;Use Pen for Loadbalance(&lt;/span&gt;&lt;a href="http://conheotiensinh.blogspot.com/2009/09/load-balance-web-server-use-pen.html"&gt;http://conheotiensinh.blogspot.com/2009/09/load-balance-web-server-use-pen.html&lt;/a&gt;&lt;span style="font-weight: bold; color: rgb(0, 153, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/cite&gt;&lt;/span&gt;&lt;/span&gt;&lt;h1  style="font-weight: normal;font-family:arial;" id="title"&gt;&lt;span style="font-size:78%;"&gt;2/Master-Master Replication With MySQL&lt;/span&gt;&lt;/h1&gt;&lt;br /&gt;&lt;h4&gt;1.1 System 1&lt;/h4&gt; &lt;p&gt;Hostname: &lt;span class="system"&gt;mail.test.vn&lt;/span&gt;&lt;br /&gt;IP: &lt;span class="system"&gt;192.168.20.203&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1.2 System 2&lt;/p&gt;  &lt;p&gt;Hostname: &lt;span class="system"&gt;mail1.test.vn&lt;/span&gt;&lt;br /&gt;IP: &lt;span class="system"&gt;192.168.20.83&lt;/span&gt;&lt;/p&gt;&lt;h4 style="font-weight: bold; color: rgb(51, 51, 255);"&gt;&lt;span class="system"&gt;Step 1:&lt;/span&gt; MySQL Root Password&lt;/h4&gt; &lt;h4&gt;Both Systems&lt;/h4&gt; &lt;p&gt;Set a password for the MySQL root-user on localhost.&lt;/p&gt; &lt;p class="command"&gt;mysqladmin -u root password 123&lt;br /&gt;&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;h4&gt; System 1&lt;/h4&gt; &lt;p&gt;Set a password for the MySQL root-user on mail.test.vn.&lt;/p&gt; &lt;p class="command"&gt;mysqladmin -u root -h 192.168.20.203 password 123&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;h4&gt; System 2&lt;/h4&gt; &lt;p&gt;Set a password for the MySQL root-user on mail1.test.vn.&lt;/p&gt; &lt;p class="command"&gt;mysqladmin -u root -h 192.168.20.83 password 123&lt;/p&gt;&lt;p&gt;&lt;span class="system"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="font-weight: bold; color: rgb(0, 0, 153);"&gt;&lt;span class="system"&gt;Step2:&lt;/span&gt;MySQL Replication User&lt;/p&gt;&lt;h4&gt;System 1&lt;/h4&gt; &lt;p&gt;Create the replication user &lt;span class="system"&gt;&lt;/span&gt;that System 2 will use&lt;span class="system"&gt;&lt;/span&gt; to access the MySQL database on System 1.&lt;/p&gt;&lt;p style="color: rgb(255, 0, 0); font-weight: bold;"&gt;mysql -u root -p                                                                           &lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(255, 0, 0); font-weight: bold;"&gt;GRANT REPLICATION SLAVE ON *.* TO 'system'@'%' IDENTIFIED BY '123';&lt;br /&gt;FLUSH PRIVILEGES;&lt;br /&gt;quit;&lt;/p&gt;&lt;h4&gt;System 2&lt;/h4&gt; &lt;p&gt;Create the replication user &lt;span class="system"&gt;&lt;/span&gt;that System 1 will use&lt;span class="system"&gt;&lt;/span&gt; to access the MySQL database on System 2.&lt;/p&gt;&lt;p style="color: rgb(255, 0, 0); font-weight: bold;"&gt;mysql -u root -p                                                                           &lt;br /&gt;&lt;/p&gt; &lt;p style="color: rgb(255, 0, 0); font-weight: bold;"&gt;GRANT REPLICATION SLAVE ON *.* TO 'system'@'%' IDENTIFIED BY '123';&lt;br /&gt;FLUSH PRIVILEGES;&lt;br /&gt;quit;&lt;/p&gt;&lt;p style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;Step 3: Open port 3306 for connect&lt;/span&gt;&lt;/p&gt;&lt;h4 style="font-weight: bold; color: rgb(0, 0, 153);"&gt;Step 4:MySQL Configuration&lt;/h4&gt; &lt;p&gt;In the next two steps we adjust the MySQL configuration on both systems for master-master replication.&lt;/p&gt;&lt;h4&gt;System 1&lt;/h4&gt;&lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="command"&gt;vi /etc/my.cnf&lt;/p&gt; &lt;p&gt;Add the following lines to the section [mysqld]:&lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="system"&gt;server-id = 1&lt;br /&gt;replicate-same-server-id = 0&lt;br /&gt;auto-increment-increment = 2&lt;br /&gt;auto-increment-offset = 1&lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="system"&gt;master-host = 192.168.20.83&lt;br /&gt;master-user = system&lt;br /&gt;master-password = 123&lt;br /&gt;master-connect-retry = 60&lt;br /&gt;replicate-do-db =vmail&lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="system"&gt;log-bin = /var/log/mysql/mysql-bin.log&lt;br /&gt;binlog-do-db = vmail&lt;br /&gt;&lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="system"&gt;relay-log = /var/lib/mysql/slave-relay.log&lt;br /&gt;relay-log-index = /var/lib/mysql/slave-relay-log.index&lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="system"&gt;expire_logs_days        = 10&lt;br /&gt;max_binlog_size         = 500M&lt;/p&gt; &lt;p&gt;Afterwards restart the MySQL server.&lt;/p&gt; &lt;p style="color: rgb(255, 0, 0); font-weight: bold;" class="command"&gt;/etc/init.d/mysqld restart&lt;/p&gt;&lt;h4&gt; System 2&lt;/h4&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="command"&gt;vi /etc/my.cnf&lt;/p&gt; &lt;p&gt;Add the following lines to the section [mysqld]:&lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="system"&gt;server-id = 2&lt;br /&gt;replicate-same-server-id = 0&lt;br /&gt;auto-increment-increment = 2&lt;br /&gt;auto-increment-offset = 2&lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="system"&gt;master-host = 192.168.20.203&lt;br /&gt;master-user = system&lt;br /&gt;master-password = 123&lt;br /&gt;master-connect-retry = 60&lt;br /&gt;replicate-do-db =vmail&lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="system"&gt;log-bin= /var/log/mysql/mysql-bin.log&lt;br /&gt;binlog-do-db =vmail&lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="system"&gt;relay-log = /var/lib/mysql/slave-relay.log&lt;br /&gt;relay-log-index = /var/lib/mysql/slave-relay-log.index&lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="system"&gt;expire_logs_days        = 10&lt;br /&gt;max_binlog_size         = 500M&lt;/p&gt; &lt;p&gt;Afterwards restart the MySQL server.&lt;/p&gt; &lt;p style="color: rgb(255, 0, 0); font-weight: bold;" class="command"&gt;/etc/init.d/mysqld restart&lt;/p&gt;&lt;h4 style="color: rgb(0, 0, 153);"&gt;Step 5:Export MySQL Dump On System 1&lt;/h4&gt;Now we create a dump of the existing database and transfer it to system 2. &lt;p style="color: rgb(255, 0, 0); font-weight: bold;" class="command"&gt;mysql -u root -p&lt;/p&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;USE vmail;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;FLUSH TABLES WITH READ LOCK;&lt;br /&gt;SHOW MASTER STATUS;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;+------------------+----------+--------------+------------------+&lt;/span&gt; &lt;span style="color: rgb(204, 51, 204);"&gt;| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |&lt;/span&gt; &lt;span style="color: rgb(204, 51, 204);"&gt;+------------------+----------+--------------+------------------+&lt;/span&gt; &lt;span style="color: rgb(204, 51, 204);"&gt;| mysql-bin.000007 |    30330 | vmail,vmail  |                  |&lt;/span&gt; &lt;span style="color: rgb(204, 51, 204);"&gt;+------------------+----------+--------------+------------------+&lt;/span&gt; &lt;span style="color: rgb(204, 51, 204);"&gt;1 row in set (0.00 sec)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Open a second terminal for system 1, create the dump and transfer it to system 2. &lt;span class="highlight"&gt;Don't leave the MySQL-shell at this point - otherwise you'll loose the read-lock.&lt;/span&gt;&lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="command"&gt;cd /tmp/&lt;br /&gt;mysqldump -u root -p123 --opt vmail &gt; sqldump.sql&lt;br /&gt;scp sqldump.sql root@192.168.20.83:/tmp/&lt;/p&gt; &lt;p&gt; Afterwards close the second terminal and switch back to the first. Remove the read-lock and leave the MySQL-shell.&lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="command"&gt;UNLOCK TABLES;&lt;br /&gt;quit;&lt;/p&gt;&lt;h4 style="color: rgb(0, 0, 153);"&gt;Step 6: Import MySQL Dump On System 2&lt;/h4&gt; &lt;p&gt;Time to import the database dump on system 2.&lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="command"&gt;mysqladmin --user=root --password=123 stop-slave&lt;br /&gt;cd /tmp/&lt;br /&gt;mysql -u root -p123 vmail &lt;&gt;&lt;h4 style="color: rgb(0, 0, 153);"&gt;Step 7:System 2 As Master&lt;/h4&gt; &lt;p&gt;Now we need information about the master status on system 2.&lt;/p&gt; &lt;p style="color: rgb(255, 0, 0); font-weight: bold;" class="command"&gt;mysql -u root -p&lt;br /&gt;USE vmail;&lt;br /&gt;FLUSH TABLES WITH READ LOCK;&lt;br /&gt;SHOW MASTER STATUS;&lt;/p&gt;&lt;p&gt;The output should look like this. Note down the file and the position - you'll need both later.&lt;/p&gt; &lt;p style="color: rgb(204, 51, 204);" class="system"&gt;+------------------+----------+---------------------+------------------+&lt;br /&gt;| File             | Position | Binlog_Do_DB        | Binlog_Ignore_DB |&lt;br /&gt;+------------------+----------+---------------------+------------------+&lt;br /&gt;| mysql-bin.000009 | 28816 | vmail,vmail |                  |&lt;br /&gt;+------------------+----------+---------------------+------------------+&lt;br /&gt;1 row in set (0.00 sec)&lt;/p&gt; &lt;p&gt;Afterwards remove the read-lock.&lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="command"&gt;UNLOCK TABLES;&lt;/p&gt;&lt;p&gt;At this point we're ready to become the master for system 1. &lt;span class="highlight"&gt;Replace %mysql_slaveuser_password% with the password you choose and be sure that you replace the values for MASTER_LOG_FILE and MASTER_LOG_POS with the values that you noted down at step 5!&lt;/span&gt;&lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="command"&gt;CHANGE MASTER TO MASTER_HOST='192.168.20.203', MASTER_USER='system', MASTER_PASSWORD='123', MASTER_LOG_FILE='mysql-bin.000007', MASTER_LOG_POS=30330;&lt;/p&gt; &lt;p&gt;Now start the slave ...&lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="command"&gt;START SLAVE;&lt;/p&gt;&lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="command"&gt;quit;&lt;/p&gt;&lt;h4 style="color: rgb(0, 0, 153);"&gt;Step 8:System 1 As Master&lt;/h4&gt; &lt;p&gt;Open a MySQL-shell on system 1 ...&lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="command"&gt;mysql -u root -p&lt;/p&gt; &lt;p&gt;... and stop the slave.&lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="command"&gt;STOP SLAVE;&lt;/p&gt; &lt;p&gt;At this point we're ready to become the master for system 2. &lt;span class="highlight"&gt;Replace %mysql_slaveuser_password% with the password you choose and be sure that you replace the values for MASTER_LOG_FILE and MASTER_LOG_POS with the values that you noted down at step 7!&lt;/span&gt;&lt;/p&gt; &lt;p style="font-weight: bold; color: rgb(255, 0, 0);" class="command"&gt;CHANGE MASTER TO MASTER_HOST='192.168.20.83', MASTER_USER='system', MASTER_PASSWORD='123', MASTER_LOG_FILE='mysql-bin.000009', MASTER_LOG_POS=28816;&lt;/p&gt; &lt;p&gt;Now start the slave ...&lt;/p&gt; &lt;p style="color: rgb(255, 0, 0); font-weight: bold;" class="command"&gt;START SLAVE;&lt;/p&gt;&lt;p style="color: rgb(255, 0, 0); font-weight: bold;" class="command"&gt;quit;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 153); font-weight: bold;" class="command"&gt;Step 10:Test&lt;/p&gt;&lt;p style="color: rgb(255, 0, 0); font-weight: bold;" class="command"&gt;&lt;br /&gt;&lt;/p&gt;&lt;span style="font-weight: bold;"&gt;create mailbox Test1@test.vn and add in mailist ug@test.vn in system1:192.168.20.203&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_MzplYSbgF84/Spz7SMykt5I/AAAAAAAAAEo/kPM41jA98v0/s1600-h/1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 199px;" src="http://3.bp.blogspot.com/_MzplYSbgF84/Spz7SMykt5I/AAAAAAAAAEo/kPM41jA98v0/s400/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5376448345263093650" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Check in system 2:192.168.20.83&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/Spz7nzf-dYI/AAAAAAAAAEw/CW00cnhJE_w/s1600-h/2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 211px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/Spz7nzf-dYI/AAAAAAAAAEw/CW00cnhJE_w/s400/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5376448716431324546" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;create mailbox Test2@test.vn and add in mailist ug@test.vn in system2:192.168.20.83&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/Spz8UgX_I9I/AAAAAAAAAE4/0_QL7ohokkU/s1600-h/3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 217px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/Spz8UgX_I9I/AAAAAAAAAE4/0_QL7ohokkU/s400/3.JPG" alt="" id="BLOGGER_PHOTO_ID_5376449484391654354" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Check in system 1:192.168.20.203&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/Spz8gOZuxMI/AAAAAAAAAFA/WBqiy5ClFk8/s1600-h/4.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 207px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/Spz8gOZuxMI/AAAAAAAAAFA/WBqiy5ClFk8/s400/4.JPG" alt="" id="BLOGGER_PHOTO_ID_5376449685725562050" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Now i can login 2 Accounts in system1 and system 2&lt;br /&gt;&lt;/span&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-weight: bold;"&gt;Beside you need replicate other DB:mysql ,policyd, roundcubemail.&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/1767307989305526323-9140617553700782899?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/9140617553700782899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/09/cluster-linux-mail-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/9140617553700782899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/9140617553700782899'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/09/cluster-linux-mail-server.html' title='Cluster Linux Mail Server'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MzplYSbgF84/Spz7SMykt5I/AAAAAAAAAEo/kPM41jA98v0/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-8230599842162408291</id><published>2009-08-31T10:01:00.000+07:00</published><updated>2009-08-31T13:30:06.107+07:00</updated><title type='text'>Install Linux Mail Server with 5 minutes</title><content type='html'>iRedMail is a shell script that lets you quickly deploy a full-featured mail solution in less than 5 minutes on CentOS 5.x and Debian (Lenny) 5.0.1  and Ubuntu (it supports both i386 and x86_64). Its object is to make a Linux mail server installation and configuration simple and easy to use. iRedMail supports both OpenLDAP and MySQL as backends for storing virtual domains and users.This tutorial shows how to use the MYSQL as the backend.  &lt;p&gt;The mail server components: &lt;a href="http://code.google.com/p/iredmail/wiki/Main_Components" target="_blank" mce_real_href="http://code.google.com/p/iredmail/wiki/Main_Components"&gt;http://code.google.com/p/iredmail/wiki/Main_Components&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The discussion forum: &lt;a href="http://www.iredmail.org/forum/" target="_blank" mce_real_href="http://www.iredmail.org/forum/"&gt;http://www.iredmail.org/forum/&lt;/a&gt;&lt;/p&gt;       &lt;h3 style="font-weight: normal; color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:130%;"&gt;1/Preliminary Note&lt;/span&gt;&lt;/h3&gt;   &lt;p&gt;In this tutorial&lt;/p&gt;&lt;p&gt; I use:                                                                                                                    Hostname &lt;span class="system"&gt;mail.test.vn&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt; admin account: Postmaster@test.vn&lt;br /&gt;Mail domain: &lt;span class="system"&gt;test.vn&lt;/span&gt;&lt;br /&gt;Mail delivery (mailboxes) path: &lt;span class="system"&gt;/home/vmail/domains&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;These settings might differ for you, so you have to replace them where appropriate.&lt;/p&gt;&lt;h3&gt;Requirements&lt;/h3&gt;   &lt;p&gt;Install CentOS 5.x, I suggest to use the minimum install, make sure you don't install Apache, PHP and MySQL. You can remove them with yum if they are installed.Yum is working, because the installation needs to use CentOS source packages.&lt;/p&gt;&lt;h3&gt;Installation&lt;/h3&gt; &lt;p&gt;Download the iRedMail script: &lt;/p&gt;  &lt;p style="color: rgb(255, 0, 0); font-weight: bold;" class="command"&gt;wget http://iredmail.googlecode.com/files/iRedMail-0.4.0.tar.bz2&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(255, 0, 0); font-weight: bold;" class="command"&gt;tar xjf iRedMail-0.4.0.tar.bz2 &lt;/p&gt;  &lt;p&gt;Run the script to download all mail server related rpm packages:&lt;/p&gt;  &lt;p class="highlight"&gt;Only download packages not shipped within RHEL/CentOS iso files. &lt;/p&gt;  &lt;p style="color: rgb(255, 0, 0); font-weight: bold;" class="command"&gt;cd iRedMail-0.4.0/pkgs/&lt;br /&gt;sh get_all.sh &lt;/p&gt;    &lt;p style="color: rgb(255, 0, 0); font-weight: bold;" class="command"&gt;Run the script to install:&lt;/p&gt;&lt;p style="color: rgb(255, 0, 0); font-weight: bold;" class="command"&gt;cd ..&lt;br /&gt;sh iRedMail.sh&lt;/p&gt;&lt;p style="color: rgb(255, 0, 0); font-weight: bold;" class="command"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(255, 0, 0); font-weight: bold;" class="command"&gt;Step1:welcome page&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0);" class="command"&gt;&lt;br /&gt;&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SptAm904sxI/AAAAAAAAABM/TUlRjjmETt4/s1600-h/1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 204px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SptAm904sxI/AAAAAAAAABM/TUlRjjmETt4/s400/1.JPG" alt="" id="BLOGGER_PHOTO_ID_5375961618372408082" border="0" /&gt;&lt;/a&gt;&lt;p style="color: rgb(0, 0, 0); font-weight: bold;" class="command"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(255, 0, 0); font-weight: bold;" class="command"&gt;Step2:Mail delivery (mailboxes) path, all emails should be stored in this directory.&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0);" class="command"&gt;&lt;br /&gt;&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SptDXfSZ7QI/AAAAAAAAABU/V3VvUTRKtDk/s1600-h/2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 194px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SptDXfSZ7QI/AAAAAAAAABU/V3VvUTRKtDk/s400/2.JPG" alt="" id="BLOGGER_PHOTO_ID_5375964651011566850" border="0" /&gt;&lt;/a&gt;&lt;p style="color: rgb(255, 0, 0); font-weight: bold;" class="command"&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="color: rgb(255, 0, 0); font-weight: bold;" class="command"&gt;&lt;a name="iRedOS_Installation_Details"&gt;Step3:Choose backend to store virtual domains and virtual users.&lt;/a&gt;&lt;a name="iRedOS_Installation_Details"&gt;Note: Please choose the one you are familiar. Here we use MySQL for example.&lt;/a&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0);" class="command"&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0);" class="command"&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0);" class="command"&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;/a&gt;&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_MzplYSbgF84/SptD1SkkILI/AAAAAAAAABc/pFczoxA6chk/s1600-h/3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 185px;" src="http://3.bp.blogspot.com/_MzplYSbgF84/SptD1SkkILI/AAAAAAAAABc/pFczoxA6chk/s400/3.JPG" alt="" id="BLOGGER_PHOTO_ID_5375965162994147506" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a style="color: rgb(255, 0, 0); font-weight: bold;" name="iRedOS_Installation_Details"&gt;Step4:Set MySQL account 'root' password. &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SptFDMZWKSI/AAAAAAAAABk/KmBDH8WMQtU/s1600-h/4.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 192px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SptFDMZWKSI/AAAAAAAAABk/KmBDH8WMQtU/s400/4.JPG" alt="" id="BLOGGER_PHOTO_ID_5375966501366278434" border="0" /&gt;&lt;/a&gt;&lt;a style="font-weight: bold; color: rgb(255, 0, 0);" name="iRedOS_Installation_Details"&gt;Step5:Set MySQL account 'vmailadmin' password.&lt;/a&gt;&lt;a style="font-weight: bold; color: rgb(255, 0, 0);" name="iRedOS_Installation_Details"&gt;Note: vmailadmin is used for manage all virtual domains &amp;amp; users, so that you don't need MySQL root privileges&lt;/a&gt;&lt;a style="font-weight: bold; color: rgb(255, 0, 0);" name="iRedOS_Installation_Details"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SptF71lBW0I/AAAAAAAAABs/tsjKJN8RzC4/s1600-h/5.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 184px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SptF71lBW0I/AAAAAAAAABs/tsjKJN8RzC4/s400/5.JPG" alt="" id="BLOGGER_PHOTO_ID_5375967474493774658" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Step6:&lt;/span&gt;&lt;a style="color: rgb(255, 0, 0); font-weight: bold;" name="iRedOS_Installation_Details"&gt;Set first virtual domain. e.g. test.vn, botay.com, etc. &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SptGpT82bSI/AAAAAAAAAB0/dCxHufPMTAw/s1600-h/6.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 187px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SptGpT82bSI/AAAAAAAAAB0/dCxHufPMTAw/s400/6.JPG" alt="" id="BLOGGER_PHOTO_ID_5375968255740898594" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Step7:&lt;/span&gt;&lt;a style="font-weight: bold; color: rgb(255, 0, 0);" name="iRedOS_Installation_Details"&gt;Set admin user for first virtual domain you set above. e.g. &lt;strong&gt;postmaster&lt;/strong&gt;. &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SptHC8YBtYI/AAAAAAAAAB8/-Ll6fWlci64/s1600-h/7.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 188px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SptHC8YBtYI/AAAAAAAAAB8/-Ll6fWlci64/s400/7.JPG" alt="" id="BLOGGER_PHOTO_ID_5375968696089032066" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Step8:&lt;/span&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Set password for admin user you set above.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SptHZ0bziyI/AAAAAAAAACE/2A-qabYzCdk/s1600-h/8.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 185px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SptHZ0bziyI/AAAAAAAAACE/2A-qabYzCdk/s400/8.JPG" alt="" id="BLOGGER_PHOTO_ID_5375969089094388514" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Step9:&lt;/span&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Set first normal user. e.g. &lt;/span&gt;&lt;strong style="font-weight: bold; color: rgb(255, 0, 0);"&gt;www&lt;/strong&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_MzplYSbgF84/SptHm6D6lWI/AAAAAAAAACM/QFRRAPnV1aE/s1600-h/9.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 184px;" src="http://3.bp.blogspot.com/_MzplYSbgF84/SptHm6D6lWI/AAAAAAAAACM/QFRRAPnV1aE/s400/9.JPG" alt="" id="BLOGGER_PHOTO_ID_5375969313943098722" border="0" /&gt;&lt;/a&gt;&lt;a style="color: rgb(255, 0, 0); font-weight: bold;" name="iRedOS_Installation_Details"&gt;Step10:Set password for normal user you set above. &lt;/a&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SptH6oAoamI/AAAAAAAAACU/X0jTbgAc-2g/s1600-h/10.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 185px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SptH6oAoamI/AAAAAAAAACU/X0jTbgAc-2g/s400/10.JPG" alt="" id="BLOGGER_PHOTO_ID_5375969652694870626" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Step11:&lt;/span&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Enable SPF Validation, DKIM signing/verification or not.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SptILqKQUgI/AAAAAAAAACc/cQHRBzvf1Ak/s1600-h/11.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 187px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SptILqKQUgI/AAAAAAAAACc/cQHRBzvf1Ak/s400/11.JPG" alt="" id="BLOGGER_PHOTO_ID_5375969945329881602" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Step12:&lt;/span&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Enable managesieve service or not&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SptIa8A5SVI/AAAAAAAAACk/JBJ-8GpkmGk/s1600-h/12.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 190px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SptIa8A5SVI/AAAAAAAAACk/JBJ-8GpkmGk/s400/12.JPG" alt="" id="BLOGGER_PHOTO_ID_5375970207820499282" border="0" /&gt;&lt;/a&gt;&lt;a style="font-weight: bold; color: rgb(255, 0, 0);" name="iRedOS_Installation_Details"&gt;Step13:Enable POP3, POP3S, IMAP, IMAPS services or not&lt;/a&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SptIqgsggzI/AAAAAAAAACs/aeNkeg6DWBw/s1600-h/13.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 183px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SptIqgsggzI/AAAAAAAAACs/aeNkeg6DWBw/s400/13.JPG" alt="" id="BLOGGER_PHOTO_ID_5375970475365139250" border="0" /&gt;&lt;/a&gt;&lt;a style="color: rgb(255, 0, 0); font-weight: bold;" name="iRedOS_Installation_Details"&gt;Step14:Choose your prefer webmail programs&lt;/a&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SptI3EteQuI/AAAAAAAAAC0/RqkeZPBp0IE/s1600-h/14.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 186px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SptI3EteQuI/AAAAAAAAAC0/RqkeZPBp0IE/s400/14.JPG" alt="" id="BLOGGER_PHOTO_ID_5375970691191292642" border="0" /&gt;&lt;/a&gt;&lt;a style="font-weight: bold; color: rgb(255, 0, 0);" name="iRedOS_Installation_Details"&gt;Step15:Choose optional components. It's recommended you choose all. &lt;/a&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SptJJRO7h2I/AAAAAAAAAC8/zzZrfrMv3aw/s1600-h/15.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 187px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SptJJRO7h2I/AAAAAAAAAC8/zzZrfrMv3aw/s400/15.JPG" alt="" id="BLOGGER_PHOTO_ID_5375971003790493538" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Step16:&lt;/span&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;If you choose PostfixAdmin above, you need to set a global admin user. It can manage all virtual domains and users.&lt;/span&gt;&lt;br /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_MzplYSbgF84/SptJaxmetnI/AAAAAAAAADE/WVO0gwPMQ7Y/s1600-h/16.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 188px;" src="http://3.bp.blogspot.com/_MzplYSbgF84/SptJaxmetnI/AAAAAAAAADE/WVO0gwPMQ7Y/s400/16.JPG" alt="" id="BLOGGER_PHOTO_ID_5375971304536979058" border="0" /&gt;&lt;/a&gt;&lt;a style="font-weight: bold; color: rgb(255, 0, 0);" name="iRedOS_Installation_Details"&gt;Step17:&lt;/a&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;If you choose Awstats as log analyzer, you will be prompted to set a username and password&lt;/span&gt;&lt;br /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SptJ1-ux_7I/AAAAAAAAADM/QfvqWw9VXUg/s1600-h/17.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 186px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SptJ1-ux_7I/AAAAAAAAADM/QfvqWw9VXUg/s400/17.JPG" alt="" id="BLOGGER_PHOTO_ID_5375971771917926322" border="0" /&gt;&lt;/a&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;br /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SptJ46sfiTI/AAAAAAAAADU/JpKQtLvr0xs/s1600-h/18.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 187px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SptJ46sfiTI/AAAAAAAAADU/JpKQtLvr0xs/s400/18.JPG" alt="" id="BLOGGER_PHOTO_ID_5375971822374193458" border="0" /&gt;&lt;/a&gt;&lt;a style="font-weight: bold; color: rgb(255, 0, 0);" name="iRedOS_Installation_Details"&gt;Step18:&lt;/a&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Set mail alias address for root user in operation system&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Step19:drink coffee :D and wait few minutes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Step20:reboot and enjoy&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;Step21:After reboot .Create Mailbox by postfixadmin&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;&lt;span style="font-size:130%;"&gt;&lt;a style="color: rgb(255, 255, 255); font-weight: bold;" href="https://mail.test.vn/postfixadmin"&gt;https://mail.test.vn/postfixadmin&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SptLnTEGUCI/AAAAAAAAADc/a51-wk211-4/s1600-h/19.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 206px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SptLnTEGUCI/AAAAAAAAADc/a51-wk211-4/s400/19.JPG" alt="" id="BLOGGER_PHOTO_ID_5375973718701264930" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After login,I choose Virtual list-&gt; Add Mailbox&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_MzplYSbgF84/SptMVkw8W-I/AAAAAAAAADk/j3Dd7mVfznQ/s1600-h/20.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 212px;" src="http://4.bp.blogspot.com/_MzplYSbgF84/SptMVkw8W-I/AAAAAAAAADk/j3Dd7mVfznQ/s400/20.JPG" alt="" id="BLOGGER_PHOTO_ID_5375974513726741474" border="0" /&gt;&lt;/a&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;Step 22:Create Maillist&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I choose Virtual list-&gt; Add Alias&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_MzplYSbgF84/SptNFX_soII/AAAAAAAAADs/U2Qycf4y0NI/s1600-h/21.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 187px;" src="http://3.bp.blogspot.com/_MzplYSbgF84/SptNFX_soII/AAAAAAAAADs/U2Qycf4y0NI/s400/21.JPG" alt="" id="BLOGGER_PHOTO_ID_5375975334932684930" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Step23: Test configure and Account&lt;br /&gt;&lt;br /&gt;Configure Account use outlook Express check mail&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SptPXF93UmI/AAAAAAAAAD0/I-zAE9kXv6g/s1600-h/22.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 334px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SptPXF93UmI/AAAAAAAAAD0/I-zAE9kXv6g/s400/22.JPG" alt="" id="BLOGGER_PHOTO_ID_5375977838354059874" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can use webmail for check mail :&lt;a href="https://mail.test.vn/mail/"&gt;https://mail.test.vn/mail/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SptQLMavc5I/AAAAAAAAAD8/rMyrbNz0Gs0/s1600-h/23.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 232px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SptQLMavc5I/AAAAAAAAAD8/rMyrbNz0Gs0/s400/23.JPG" alt="" id="BLOGGER_PHOTO_ID_5375978733438989202" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Other you can create cluster mail server with replication mysql and can configure manual from http://www.postfix.org/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;/a&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;/a&gt;&lt;a name="iRedOS_Installation_Details"&gt;&lt;/a&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-8230599842162408291?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/8230599842162408291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/08/install-linux-mail-server-with-5.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/8230599842162408291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/8230599842162408291'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/08/install-linux-mail-server-with-5.html' title='Install Linux Mail Server with 5 minutes'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_MzplYSbgF84/SptAm904sxI/AAAAAAAAABM/TUlRjjmETt4/s72-c/1.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-9062015667752058622</id><published>2009-08-28T17:10:00.000+07:00</published><updated>2009-08-28T17:34:44.043+07:00</updated><title type='text'>SYNC DATA USE RSYNC</title><content type='html'>Configure Rsync to copy files.&lt;br /&gt;&lt;br /&gt;Following example based on a environment HostA is [192.168.0.19], HostB is [192.168.0.20].&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;[1] Install xinetd first. It's necessary on HostA. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[root@www ~]#yum -y install xinetd&lt;br /&gt;&lt;br /&gt;[root@www ~]#vi /etc/xinetd.d/rsync&lt;br /&gt;&lt;br /&gt;# default: off&lt;br /&gt;# description: The rsync server is a good addition to an ftp server, as it \&lt;br /&gt;#      allows crc checksumming etc.&lt;br /&gt;service rsync&lt;br /&gt;{&lt;br /&gt;&lt;div class="color2"&gt;disable = no// change&lt;/div&gt;&lt;br /&gt;&lt;div class="pos8"&gt;socket_type = stream&lt;/div&gt;&lt;br /&gt;&lt;div class="pos8"&gt;wait = no&lt;/div&gt;&lt;br /&gt;&lt;div class="pos8"&gt;user = root&lt;/div&gt;&lt;br /&gt;&lt;div class="pos8"&gt;server = /usr/bin/rsync&lt;/div&gt;&lt;br /&gt;&lt;div class="pos8"&gt;server_args = --daemon&lt;/div&gt;&lt;br /&gt;&lt;div class="pos8"&gt;log_on_failure += USERID&lt;/div&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;[root@www ~]#/etc/rc.d/init.d/xinetd start&lt;br /&gt;Starting xinetd:[  OK  ]&lt;br /&gt;[root@www ~]#chkconfig xinetd on&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;[2] Config for HostA. This example based on a configuration to copy files under /var/www/html to HostB. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[root@www ~]#vi /etc/rsyncd.conf&lt;br /&gt;&lt;br /&gt;&lt;div class="color1"&gt; [site] // name&lt;br /&gt;path = /var/www/html // copied directory&lt;br /&gt;hosts allow = 192.168.0.20&lt;br /&gt;hosts deny = *&lt;br /&gt;list = true&lt;br /&gt;uid = root&lt;br /&gt;gid = root&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;[3] Config for HostB.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;[root@lan ~]#vi /etc/rsync_exclude.lst&lt;br /&gt;&lt;br /&gt;&lt;div class="color2"&gt;// Write directory or files you don't want to copy.&lt;/div&gt;&lt;br /&gt;&lt;div class="color1"&gt; test&lt;br /&gt;test.txt&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;[4] Run Rsync.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;[root@lan ~]#rsync -avz --delete --exclude-from=/etc/rsync_exclude.lst 192.168.0.19::site /home/backup&lt;br /&gt;&lt;br /&gt;&lt;div class="color2"&gt;// add in cron if you'd like to run rsync.&lt;/div&gt;&lt;br /&gt;[root@lan ~]#crontab -e&lt;br /&gt;&lt;br /&gt;&lt;div style="color: rgb(255, 0, 0); font-weight: bold;" class="color1"&gt;00 06 * * * rsync -avz --delete --exclude-from=/etc/rsync_exclude.lst 192.168.0.19::site /home/backup&lt;/div&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-9062015667752058622?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/9062015667752058622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/08/sync-data-use-rsync.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/9062015667752058622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/9062015667752058622'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/08/sync-data-use-rsync.html' title='SYNC DATA USE RSYNC'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-5658900353913118948</id><published>2009-08-28T15:26:00.001+07:00</published><updated>2009-08-28T17:09:36.384+07:00</updated><title type='text'>LOAD BALANCE WEB SERVER USE POUND</title><content type='html'>This example is based on the environment below.&lt;br /&gt;&lt;br /&gt;(1) cluster.test.vn         [192.168.0.17]    Pound server&lt;br /&gt;(2) www.test.vn    [192.168.0.18]   Web server #1&lt;br /&gt;(3) www2.test.vn  [192.168.0.21]   Web server #2&lt;br /&gt;&lt;br /&gt;In this example,  Pound server listens HTTP requests, and if requests to jpg or gif files come, they are forwarded to (2)'s server, and  if requests to files except jpg or gif, they are forwarded to (3)'s server. It's also necessary to set gateway router that  HTTP requests are forwared to pound server first.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;[1] Install and configure Pound &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[root@cluster ~]# yum -y install pound  &lt;span style="color: rgb(255, 0, 0);"&gt;#or you download pound rpm from http://rpm.pbone.net&lt;/span&gt;&lt;br /&gt;[root@cluster ~]#useradd -s /sbin/nologin -d /root pound&lt;br /&gt;[root@cluster ~]#vi /etc/pound.cfg&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;div style="color: rgb(255, 0, 0); font-weight: bold;" class="color2"&gt;# an example&lt;br /&gt;# see "man pound" if you'd like to know more&lt;/div&gt;&lt;br /&gt;&lt;div style="color: rgb(255, 0, 0); font-weight: bold;" class="color1"&gt; #Global settings&lt;br /&gt;&lt;div class="color2"&gt;# specify user&lt;/div&gt;&lt;br /&gt;User  "pound"&lt;br /&gt;&lt;div class="color2"&gt;# specify group&lt;/div&gt;&lt;br /&gt;Group "pound"&lt;br /&gt;&lt;div class="color2"&gt;# log level (max = 5)&lt;/div&gt;&lt;br /&gt;LogLevel 1&lt;br /&gt;&lt;div class="color2"&gt;# send heartbeat ?/per second&lt;/div&gt;&lt;br /&gt;Alive 30&lt;br /&gt;&lt;div class="color2"&gt;# run as a daemon&lt;/div&gt;&lt;br /&gt;Daemon 1&lt;br /&gt;&lt;br /&gt;# Pound server settings&lt;br /&gt;ListenHTTP&lt;br /&gt;&lt;div class="pos15"&gt;&lt;div class="color2"&gt;# IP of Pound server&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="pos15"&gt;Address 192.168.0.17&lt;/div&gt;&lt;br /&gt;&lt;div class="pos15"&gt;&lt;div class="color2"&gt;# Listen Port&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="pos15"&gt;Port    80&lt;/div&gt;&lt;br /&gt;End&lt;br /&gt;&lt;br /&gt;&lt;div class="color2"&gt;# Config for backend server #1&lt;/div&gt;&lt;br /&gt;# Backend server settings&lt;br /&gt;Service&lt;br /&gt;&lt;div class="color2"&gt;# listen requests to jpg,gif&lt;/div&gt;&lt;br /&gt;URL ".*.(jpg|gif)"&lt;br /&gt;&lt;div class="pos15"&gt;BackEnd&lt;/div&gt;&lt;br /&gt;&lt;div class="pos15"&gt;&lt;div class="color2"&gt;# server's IP&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="pos15"&gt;Address 192.168.0.18&lt;/div&gt;&lt;br /&gt;&lt;div class="pos15"&gt;&lt;div class="color2"&gt;# Listen Port&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="pos15"&gt;Port    80&lt;/div&gt;&lt;br /&gt;&lt;div class="pos15"&gt;End&lt;/div&gt;&lt;br /&gt;End&lt;br /&gt;&lt;br /&gt;&lt;div class="color2"&gt;# Config for backend server #2&lt;/div&gt;&lt;br /&gt;Service&lt;br /&gt;&lt;div class="color2"&gt;# listen requests except the one specified on #1's server&lt;/div&gt;&lt;br /&gt;URL ".*"&lt;br /&gt;&lt;div class="pos15"&gt;BackEnd&lt;/div&gt;&lt;br /&gt;&lt;div class="pos15"&gt;&lt;div class="color2"&gt;# server's IP&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="pos15"&gt;Address 192.168.0.21&lt;/div&gt;&lt;br /&gt;&lt;div class="pos15"&gt;&lt;div class="color2"&gt;# Listen Port&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="pos15"&gt;Port    80&lt;/div&gt;&lt;br /&gt;&lt;div class="pos15"&gt;End&lt;/div&gt;&lt;br /&gt;End&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;[root@cluster ~]#vim /etc/init.d/pound&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;# an example&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;#!/bin/bash&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;#&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;# pound: Starting Pound&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;#&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;# chkconfig: 345 98 91&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;# description:&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;HTTP/HTTPS reverse-proxy and load-balancer&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;# processname: pound&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;. /etc/rc.d/init.d/functions&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;pound="/usr/sbin/pound"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;lockfile="/var/lock/subsys/pound"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;prog="pound"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;RETVAL=0&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;start() {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;echo -n $"Starting $prog: "&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;daemon $pound&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;RETVAL=$?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;echo&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;[ $RETVAL = 0 ] &amp;amp;&amp;amp; touch $lockfile&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;return $RETVAL&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;stop() {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;echo -n $"Stopping $prog: "&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;killproc $pound&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;RETVAL=$?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;echo&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;[ $RETVAL = 0 ] &amp;amp;&amp;amp; rm -f $lockfile&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;return $RETVAL&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;case "$1" in&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;start)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;start&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;stop)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;stop&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;restart)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;stop&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;start&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;status)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;status $pound&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;*)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;echo "Usage: $prog {start|stop|restart|status}"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;exit 1&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;esac&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;exit $?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;/span&gt;&lt;br /&gt;[root@cluster ~]#chmod 755 /etc/init.d/pound&lt;br /&gt;[root@cluster ~]#/etc/init.d/pound start&lt;br /&gt;Starting pound: starting...[  OK  ]&lt;br /&gt;[root@cluster ~]#chkconfig --add pound&lt;br /&gt;[root@cluster ~]#chkconfig pound on&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;[2] Verify load baranced or not.  Upload jpg or gif file on Web Server #1 and create a html file on webserver #2 that shows a file on Web server #1 . &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[root@www ~]#vim /var/www/html/index.html&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/SpekFoXGJGI/AAAAAAAAAA8/eFT-u010Dxg/s1600-h/test5.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 103px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/SpekFoXGJGI/AAAAAAAAAA8/eFT-u010Dxg/s400/test5.JPG" alt="" id="BLOGGER_PHOTO_ID_5374945096930567266" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;[3] Access with web browser. Pound works normally. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_MzplYSbgF84/Spemh1EtXyI/AAAAAAAAABE/4stxDBXzzr8/s1600-h/test6.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 349px; height: 400px;" src="http://2.bp.blogspot.com/_MzplYSbgF84/Spemh1EtXyI/AAAAAAAAABE/4stxDBXzzr8/s400/test6.JPG" alt="" id="BLOGGER_PHOTO_ID_5374947780402700066" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-5658900353913118948?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/5658900353913118948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/08/load-balance-web-server-using-pound.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/5658900353913118948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/5658900353913118948'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/08/load-balance-web-server-using-pound.html' title='LOAD BALANCE WEB SERVER USE POUND'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MzplYSbgF84/SpekFoXGJGI/AAAAAAAAAA8/eFT-u010Dxg/s72-c/test5.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1767307989305526323.post-3836231214756297249</id><published>2009-08-27T16:01:00.000+07:00</published><updated>2009-08-27T17:31:43.957+07:00</updated><title type='text'>High Availability HTTP use HeartBeat</title><content type='html'>&lt;span style="font-size:180%;"&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;I/ Install heartBeat&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I set 2 systems as cluster servers on this example. The environment of 2 systems are like below. They have 2 NICs.&lt;br /&gt;&lt;br /&gt;(1) www1.test.vn  [eth0:192.168.0.21] [eth1:10.0.0.21]&lt;br /&gt;(2) www2.test.vn [eth0:192.168.0.22] [eth1:10.0.0.22]&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;[1] Install HeartBeat first. It's necessary to do this on both systems.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[root@www1 ~]# yum -y install heartbeat &lt;span style="color: rgb(255, 0, 0);"&gt;#install heartbeat by yum &lt;/span&gt;&lt;br /&gt;[root@www1 ~]# vi /etc/ha.d/authkey &lt;span style="color: rgb(255, 0, 0);"&gt;# create cert&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;ificates&lt;/span&gt;&lt;br /&gt;&lt;div class="color1"&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;auth 1&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&lt;br /&gt;1 crc&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;[root@www1 ~]# chmod 600 /etc/ha.d/authkeys&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-size:130%;" &gt;&lt;span style="font-weight: bold;"&gt;[2] Config for a server of (1). &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[root@www1 ~]# vi /etc/ha.d/ha.cf&lt;br /&gt;&lt;br /&gt;&lt;div class="color1"&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;crm on&lt;/span&gt;  &lt;div style="color: rgb(255, 0, 0); font-weight: bold;" class="color2"&gt;# debug log&lt;/div&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; debugfile /var/log/ha-debug&lt;/span&gt;  &lt;div style="color: rgb(255, 0, 0); font-weight: bold;" class="color2"&gt;# log file&lt;/div&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; logfile /var/log/ha-log&lt;/span&gt;  &lt;div style="color: rgb(255, 0, 0); font-weight: bold;" class="color2"&gt;# the way of output to syslog&lt;/div&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; logfacility local0&lt;/span&gt;  &lt;div style="color: rgb(255, 0, 0); font-weight: bold;" class="color2"&gt;# keepalive&lt;/div&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; keepalive 2&lt;/span&gt;  &lt;div style="color: rgb(255, 0, 0); font-weight: bold;" class="color2"&gt;# deadtime&lt;/div&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; deadtime 30&lt;/span&gt;  &lt;div style="color: rgb(255, 0, 0); font-weight: bold;" class="color2"&gt;# deadping&lt;/div&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; deadping 40&lt;/span&gt;  &lt;div style="color: rgb(255, 0, 0); font-weight: bold;" class="color2"&gt;# warntime&lt;/div&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; warntime 10&lt;/span&gt;  &lt;div style="color: rgb(255, 0, 0); font-weight: bold;" class="color2"&gt;# initdead&lt;/div&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; initdead 60&lt;/span&gt;  &lt;div style="color: rgb(255, 0, 0); font-weight: bold;" class="color2"&gt;# port&lt;/div&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; udpport 694&lt;/span&gt;  &lt;div style="color: rgb(255, 0, 0); font-weight: bold;" class="color2"&gt;# interface and IP address of another Host&lt;/div&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; ucast eth1 10.0.0.22&lt;/span&gt;  &lt;div style="color: rgb(255, 0, 0); font-weight: bold;" class="color2"&gt;# auto failback&lt;/div&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; auto_failback on&lt;/span&gt;  &lt;div style="color: rgb(255, 0, 0); font-weight: bold;" class="color2"&gt;# node name (the name of "uname -n")&lt;/div&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; node www1.test.vn&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; node www2.test.vn&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; respawn root /usr/lib/heartbeat/pingd -m 100 -d 5s -a default_ping_set&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;[3] Config for a server of (2). The different point is only the section of ucast. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[root@www1 ~]#vi /etc/ha.d/ha.cf&lt;br /&gt;&lt;div style="color: rgb(255, 0, 0); font-weight: bold;" class="color1"&gt; crm on&lt;br /&gt;debugfile /var/log/ha-debug&lt;br /&gt;logfile /var/log/ha-log&lt;br /&gt;logfacility local0&lt;br /&gt;keepalive 2&lt;br /&gt;deadtime 30&lt;br /&gt;deadping 40&lt;br /&gt;warntime 10&lt;br /&gt;initdead 60&lt;br /&gt;udpport 694&lt;br /&gt;&lt;div class="color2"&gt;# interface and IP address of another Host&lt;/div&gt;&lt;br /&gt;ucast eth1 10.0.0.21&lt;br /&gt;auto_failback on&lt;br /&gt;node www1.test.vn&lt;br /&gt;node www2.test.vn&lt;br /&gt;respawn root /usr/lib/heartbeat/pingd -m 100 -d 5s -a default_ping_set&lt;/div&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;[4] Start HeartBeat on both server. &lt;/span&gt;&lt;/span&gt; &lt;/div&gt;&lt;br /&gt;[root@www1 ~]#/etc/rc.d/init.d/heartbeat start&lt;br /&gt;Starting High-Availability services: [  OK   ]&lt;br /&gt;[root@www1 ~]# chkconfig heartbeat on&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;[5] Run crm_mon on both server, then if following result is shown, it's OK, heartbeat running normally. These are Basical configuration of HeartBeat. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[root@www1 ~]# crm_mon -i 3&lt;br /&gt;&lt;span style="color: rgb(102, 0, 204);"&gt;Defaulting to one-shot mode&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; You need to have curses available at compile time to enable console mode&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; &lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; ============&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; Last updated: Sun Jun 15 05:04:34 2008&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; Current DC: www2.test.vn (f8719a77-70b4-4e5f-851b-dafa7d65e2d3a2)&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; 2 Nodes configured.&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; 0 Resources configured.&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; ============&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; &lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; Node: www2.test.vn (f8719a77-70b4-4e5f-851b-dafa7d65e2d3a2): online&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; Node: www1.test.vn (2bbd6408-ec01-4b8c-bb8e-20723ee7af3a99): online&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;II/Configure 2 web servers for cluster. &lt;/span&gt;&lt;a style="color: rgb(255, 0, 0); font-weight: bold;" href="http://www.server-world.info/en/note?os=CentOS_5&amp;amp;p=httpd" target="_top"&gt;httpd&lt;/a&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; is also needed&lt;/span&gt;&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The environment of 2 web servers are like below. And more, I set virual IP address [192.168.0.100].&lt;br /&gt;&lt;br /&gt;(1) www1.test.vn eth0:192.168.0.21] [eth1:10.0.0.21]&lt;br /&gt;(2) www2.test.vn eth0:192.168.0.22] [eth1:10.0.0.22]&lt;br /&gt;(3) cluster.test.vn Virtual IP:192.168.0.100]&lt;br /&gt;&lt;span style="font-size:130%;"&gt; &lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;[1] Configure like below on both Host.  if httpd is running, stop it because they are controled by HeartBeat.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;[root@www1 ~]#/etc/rc.d/init.d/heartbeat stop&lt;br /&gt;Stopping High-Availability services:[  OK  ]&lt;br /&gt;[root@www1 ~]# cd /var/lib/heartbeat/crm&lt;br /&gt;[root@www1 crm]#rm -f cib.xml.*&lt;br /&gt;[root@www1 crm]#vi cib.xml&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SpZfhDHkuHI/AAAAAAAAAAs/xDxrgNby9ag/s1600-h/test3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 235px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SpZfhDHkuHI/AAAAAAAAAAs/xDxrgNby9ag/s400/test3.JPG" alt="" id="BLOGGER_PHOTO_ID_5374588226690660466" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt; &lt;cib generated="true" admin_epoch="0" epoch="1" have_quorum="true" ignore_dtd="false" ccm_transition="2" num_peers="2" cib_feature_revision="2.0" dc_uuid="f8719a77-70b4-4e5f-851b-dafa7d65e2d3a2" num_updates="4" written="Wed Aug 26 01:04:30 2009"&gt;&lt;/cib&gt;&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;    &lt;configuration&gt;&lt;/configuration&gt;&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;      &lt;crm_config&gt;&lt;/crm_config&gt;&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;        &lt;cluster_property_set id="cib-bootstrap-options"&gt;&lt;/cluster_property_set&gt;&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;          &lt;attributes&gt;&lt;/attributes&gt;&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;            &lt;nvpair id="cib-bootstrap-options-dc-version" name="dc-version" value="2.1.3-node: 552305612591183b1628baa5bcdve86e903e0f1e26a3"&gt;&lt;/nvpair&gt;&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;          &lt;/span&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;        &lt;/span&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;      &lt;/span&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;      &lt;nodes&gt;&lt;/nodes&gt;&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;        &lt;node id="2bbd6408-ec01-4b8c-bb8e-20723ee7af3a99" uname="www1.test.vn" type="normal"&gt;&lt;/node&gt;&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;        &lt;node id="f8719a77-70b4-4e5f-851b-dafa7d65e2d3a2" uname="www2.test.vn" type="normal"&gt;&lt;/node&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;&lt;resources&gt;&lt;/resources&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="color2"&gt;&lt;cib generated="true" admin_epoch="0" epoch="1" have_quorum="true" ignore_dtd="false" ccm_transition="2" num_peers="2" cib_feature_revision="2.0" dc_uuid="f8719a77-70b4-4e5f-851b-dafa7d65e2d3a2" num_updates="4" written="Sun Jun 15 05:04:30 2008"&gt;&lt;br /&gt;&lt;configuration&gt;&lt;br /&gt;&lt;crm_config&gt;&lt;br /&gt;&lt;cluster_property_set id="cib-bootstrap-options"&gt;&lt;br /&gt;  &lt;attributes&gt;&lt;br /&gt;    &lt;nvpair id="cib-bootstrap-options-dc-version" name="dc-version" value="2.1.3-node: 552305612591183b1628baa5bc6e903e0f1e26a3"&gt;&lt;br /&gt;  &lt;/nvpair&gt;&lt;br /&gt;&lt;/attributes&gt;&lt;/cluster_property_set&gt;&lt;nodes&gt;&lt;node id="2bbd6408-ec01-4b8c-bb8e-207237af3a99" uname="www1.server-linux.info" type="normal"&gt;&lt;/node&gt;&lt;/nodes&gt;&lt;/crm_config&gt;&lt;/configuration&gt;&lt;/cib&gt;&lt;cib generated="true" admin_epoch="0" epoch="1" have_quorum="true" ignore_dtd="false" ccm_transition="2" num_peers="2" cib_feature_revision="2.0" dc_uuid="f8719a77-70b4-4e5f-851b-dafa7d65e2d3a2" num_updates="4" written="Sun Jun 15 05:04:30 2008"&gt;&lt;configuration&gt;&lt;crm_config&gt;&lt;nodes&gt;&lt;node id="2bbd6408-ec01-4b8c-bb8e-207237af3a99" uname="www1.server-linux.info" type="normal"&gt;&lt;br /&gt;[root@www1 crm]# cd&lt;br /&gt;[root@www1 ~]# vi /etc/httpd/conf/httpd.conf&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/node&gt;&lt;/nodes&gt;&lt;/crm_config&gt;&lt;/configuration&gt;&lt;/cib&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_MzplYSbgF84/SpZgUEYqvqI/AAAAAAAAAA0/2PBY_AfsPsE/s1600-h/test4.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 194px;" src="http://3.bp.blogspot.com/_MzplYSbgF84/SpZgUEYqvqI/AAAAAAAAAA0/2PBY_AfsPsE/s400/test4.JPG" alt="" id="BLOGGER_PHOTO_ID_5374589103204122274" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;cib generated="true" admin_epoch="0" epoch="1" have_quorum="true" ignore_dtd="false" ccm_transition="2" num_peers="2" cib_feature_revision="2.0" dc_uuid="f8719a77-70b4-4e5f-851b-dafa7d65e2d3a2" num_updates="4" written="Sun Jun 15 05:04:30 2008"&gt;&lt;configuration&gt;&lt;crm_config&gt;&lt;nodes&gt;&lt;node id="2bbd6408-ec01-4b8c-bb8e-207237af3a99" uname="www1.server-linux.info" type="normal"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/node&gt;&lt;/nodes&gt;&lt;/crm_config&gt;&lt;/configuration&gt;&lt;/cib&gt;&lt;/div&gt;[root@www1 ~]# /etc/rc.d/init.d/heartbeat start&lt;br /&gt;Starting High-Availability services: [  OK  ]&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;[2] Run crm_mon after some time passed, then following result is shown, it's OK. httpd is running on primary server. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[root@www1 ~]#crm_mon -i 3&lt;br /&gt;&lt;span style="color: rgb(102, 0, 204);"&gt;Defaulting to one-shot mode&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; You need to have curses available at compile time to enable console mode&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; &lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; ============&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; Last updated: Sun Jun 15 05:58:18 2008&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; Current DC: www2.test.vn (f8719a77-70b4-4e5f-851b-dafa7d65e2d3a2)&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; 2 Nodes configured.&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; 1 Resources configured.&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; ============&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; &lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; Node: www1.test.vn (2bbd6408-ec01-4b8c-bb8e-20723ee7af3a99): online&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; Node: www2.test.vn (f8719a77-70b4-4e5f-851b-dafa7d65e2d3a2): online&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; &lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt; Resource Group: group_apache&lt;/span&gt; &lt;span style="color: rgb(102, 0, 204);"&gt;  &lt;/span&gt;&lt;div style="color: rgb(102, 0, 204);" class="pos3"&gt;ipaddr          (heartbeat::ocf:IPaddr):        Started www1.test.vn&lt;/div&gt;&lt;span style="color: rgb(102, 0, 204);"&gt;apache         (heartbeat::ocf:apache):         Started www1.test.vn&lt;/span&gt;&lt;br /&gt;&lt;table class="t4" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="color: rgb(0, 0, 153); font-weight: bold;" class="ko"&gt;&lt;span style="font-size:130%;"&gt;[3] Make test page on both servers and access to virtual IP. Primary server replys normally like below.&lt;br /&gt;&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SpZZ_c3j2QI/AAAAAAAAAAc/9y2hXej7dZo/s1600-h/test1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 109px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SpZZ_c3j2QI/AAAAAAAAAAc/9y2hXej7dZo/s320/test1.JPG" alt="" id="BLOGGER_PHOTO_ID_5374582151929125122" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&gt;&lt;span style="font-size:130%;"&gt;[4] Shutdown HeartBeat on primary server and verify if HeartBeat works or not.&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[root@www1 ~]# /etc/rc.d/init.d/heartbeat stop&lt;br /&gt;Stopping High-Availability services:[  OK  ]&lt;br /&gt;&lt;br /&gt;Access to virtual IP address you set, then running server is switched normally like below&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_MzplYSbgF84/SpZZvAdeWzI/AAAAAAAAAAU/hqoWfpcu6WA/s1600-h/test2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 112px;" src="http://3.bp.blogspot.com/_MzplYSbgF84/SpZZvAdeWzI/AAAAAAAAAAU/hqoWfpcu6WA/s320/test2.JPG" alt="" id="BLOGGER_PHOTO_ID_5374581869425613618" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt; &lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&gt;[5] Start HeartBeat again on primary server and verify if HeartBeat&lt;br /&gt;works or not.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;[root@www1 ~]#/etc/rc.d/init.d/heartbeat start&lt;br /&gt;Starting High-Availability services:[  OK  ]&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_MzplYSbgF84/SpZZ_c3j2QI/AAAAAAAAAAc/9y2hXej7dZo/s1600-h/test1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 109px;" src="http://1.bp.blogspot.com/_MzplYSbgF84/SpZZ_c3j2QI/AAAAAAAAAAc/9y2hXej7dZo/s320/test1.JPG" alt="" id="BLOGGER_PHOTO_ID_5374582151929125122" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="color: rgb(255, 102, 102); font-weight: bold;"&gt;Other we can create cluster for FTP and another service by heartbeat.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;input id="gwProxy" type="hidden"&gt;&lt;!--Session data--&gt;&lt;input onclick="jsCall();" id="jsProxy" type="hidden"&gt;&lt;div id="refHTML"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1767307989305526323-3836231214756297249?l=conheotiensinh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://conheotiensinh.blogspot.com/feeds/3836231214756297249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://conheotiensinh.blogspot.com/2009/08/high-availability-http-use-heartbeat.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/3836231214756297249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1767307989305526323/posts/default/3836231214756297249'/><link rel='alternate' type='text/html' href='http://conheotiensinh.blogspot.com/2009/08/high-availability-http-use-heartbeat.html' title='High Availability HTTP use HeartBeat'/><author><name>Con Heo Tien Sinh</name><uri>http://www.blogger.com/profile/11973709317204528507</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='http://4.bp.blogspot.com/_MzplYSbgF84/SpzuEk0L4EI/AAAAAAAAAEI/2LZL2T5ujY4/S220/takeittux.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_MzplYSbgF84/SpZfhDHkuHI/AAAAAAAAAAs/xDxrgNby9ag/s72-c/test3.JPG' height='72' width='72'/><thr:total>2</thr:total></entry></feed>
