<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-5209171088164792990</atom:id><lastBuildDate>Sat, 07 Sep 2024 23:09:07 +0000</lastBuildDate><category>Linux</category><category>CentOS</category><category>Fedora</category><category>News</category><category>Tips</category><category>Ubuntu</category><category>Apache</category><category>Book Review</category><category>Firewall</category><category>FreeBSD</category><category>Mono</category><category>MySQL</category><category>OpenSUSE</category><category>Opera</category><category>Oracle</category><category>PHP</category><category>Postfix</category><category>Postgresql</category><category>WebDAV</category><title>Linux Help and Info Center</title><description>Tips and Tricks about Linux, News, OS reviews. If you like this blog, please support us by providing a link.</description><link>http://linux-info-center.blogspot.com/</link><managingEditor>noreply@blogger.com (Unknown)</managingEditor><generator>Blogger</generator><openSearch:totalResults>30</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-4398085875368815823</guid><pubDate>Wed, 02 Jul 2008 13:29:00 +0000</pubDate><atom:updated>2008-08-13T06:34:26.135-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">News</category><title>Major Search Engine Yahoo and Google learning to crawl Flash</title><description>The statistics show that Adobe Flash is installed in a whooping 98% of computers connected to the Internet. The use of Flash, a Web developer is able to give his imagination a free field and build magnificent multimedia intensive but also functional sites.&lt;br /&gt;&lt;br /&gt;But so far, building Flash sites had a singular disadvantage. However, search engines had no way of indexing unless the Web developer also included text in its Flash site explaining what the site or rather on the content of the site is all about.&lt;br /&gt;&lt;br /&gt;Some time ago, Adobe has published the file format Flash &lt;a href=&quot;http://www.adobe.com/devnet/swf/pdf/swf_file_format_spec_v9.pdf&quot;&gt;SWF as an open specification&lt;/a&gt; that encourages third-party developers to create applications that could make Flash files. Adobe has now gone one step further and collaborates closely with Internet search engine companies Yahoo and Google for help in indexing Flash. It is a clear green light for all web developers to start creating sites that are heavy on the Flash content. It also means the Web developers can reduce the size of their Flash sites by deleting the text.&lt;br /&gt;&lt;br /&gt;You should know that the &lt;a href=&quot;http://linuxhelp.blogspot.com/2006/10/adobe-flash-player-90-beta-version-for.html&quot;&gt;latest version of Adobe Flash Player&lt;/a&gt; is available for Linux as a platform and make Flash which is a universal format to share and present content on the Web.&lt;br /&gt;&lt;br /&gt;Read the official information from &lt;a href=&quot;http://www.adobe.com/devnet/flashplayer/articles/swf_searchability.html&quot;&gt;Adobe&lt;/a&gt; and the &lt;a href=&quot;http://googleblog.blogspot.com/2008/06/google-learns-to-crawl-flash.html&quot;&gt;announcement of Google&lt;/a&gt;.</description><link>http://linux-info-center.blogspot.com/2008/07/major-search-engine-yahoo-and-google.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-3324249318566540594</guid><pubDate>Wed, 02 Jul 2008 13:20:00 +0000</pubDate><atom:updated>2008-08-15T06:30:55.619-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">CentOS</category><title>Set Up Shorewall Firewall On CentOS</title><description>This tutorial will guide you through the setting of Shorewall (Shoreline) 4.0 firewall on CentOS 5.1, which can be easily adapted to any other Linux distribution.&lt;br /&gt;&lt;br /&gt;The Shoreline of firewalls, more commonly known as &quot;Shorewall&quot; is a high-level configuration tool Netfilter. You describe your firewall / gateway using entries in a set of configuration files. Shorewall read configuration files and with the help of utility iptables, Shorewall configure Netfilter to match your needs. Shorewall can be used on a dedicated firewall system , a multi-function gateway / router / server or on GNU / Linux system. Shorewall doesn&#39;t use Netfilter ipchains compatibility mode and can thus benefit from connecting Netfilter state monitoring capabilities.&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;span class=&quot;system&quot;&gt;http://www.shorewall.net/&lt;/span&gt;&lt;br /&gt;&lt;div class=&quot;highlight&quot;&gt;Important Note:&lt;br /&gt;Before installing shorewall we need to uninstall ipchains if you installed in your machine.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Download shorewall&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;&lt;br /&gt;wget http://www.invoca.ch/pub/packages/shorewall/4.0/shorewall-4.0.11/shorewall-4.0.11-2.noarch.rpm&lt;br /&gt;&lt;br /&gt;wget http://www.invoca.ch/pub/packages/shorewall/4.0/shorewall-4.0.11/shorewall-perl-4.0.11-2.noarch.rpm&lt;br /&gt;&lt;br /&gt;wget http://www.invoca.ch/pub/packages/shorewall/4.0/shorewall-4.0.11/shorewall-shell-4.0.11-2.noarch.rpm&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;You can check download section in shorewall official web site for newer versions.&lt;br /&gt;&lt;a target=&quot;_blank&quot; mce_real_href=&quot;http://www.shorewall.net/download.htm&quot; href=&quot;http://www.shorewall.net/download.htm&quot;&gt;http://www.shorewall.net/download.htm&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Install Shorewall&lt;/b&gt;&lt;br /&gt;&lt;div&gt;Installing shorewall is quite easy. Just open a terminal and do a &lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;&lt;br /&gt;rpm -ivh shorewall-perl-4.0.11-2.noarch.rpm shorewall-shell-4.0.11-2.noarch.rpm shorewall-4.0.11-2.noarch.rpm&lt;/div&gt;&lt;br /&gt;&lt;div&gt;and you&#39;re all ready. Don&#39;t close your terminal, because we will need it some more.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Setting Shorewall&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;The program will not start unless you change the shorewall configuration file &lt;span class=&quot;system&quot;&gt;/etc/shorewall/shorewall.conf&lt;/span&gt; .You can do this in following way:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;vim /etc/shorewall/shorewall.conf&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Change the first line from&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;STARTUP_ENABLED=No&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;to&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;STARTUP_ENABLED=Yes&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;Save and exit (in VIM, hit [ESC] and then &#39;:wq&#39;).&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If you want to configure shorewall you need to copy the sample configuration file from&lt;br /&gt;&lt;span class=&quot;system&quot;&gt;/usr/share/doc/shorewall-4.0.11/Samples/&lt;/span&gt;. In Samples directory there are 3 different directories :&lt;span class=&quot;system&quot;&gt;one-interface/&lt;/span&gt;,&lt;span class=&quot;system&quot;&gt;two-interfaces/&lt;/span&gt; and &lt;br /&gt;&lt;span class=&quot;system&quot;&gt;three-interfaces/&lt;/span&gt;. Depending on your network,you can do this by the following command:&lt;/div&gt;&lt;div class=&quot;command&quot;&gt;cp /usr/share/doc/shorewall-4.0.11/Samples/one-interfaces/{interfaces,policy,masq,routestopped,rules,zones} /etc/shorewall/&lt;/div&gt;&lt;br /&gt;&lt;div&gt;or&lt;/div&gt;&lt;div class=&quot;command&quot;&gt;cp /usr/share/doc/shorewall-4.0.11/Samples/two-interfaces/{interfaces,policy,masq,routestopped,rules,zones} /etc/shorewall/&lt;br /&gt;&lt;/div&gt;&lt;div&gt;or&lt;/div&gt;&lt;div class=&quot;command&quot;&gt;cp /usr/share/doc/shorewall-4.0.11/Samples/three-interfaces/{interfaces,policy,masq,routestopped,rules,zones} /etc/shorewall/&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Now you have configuration files located in &lt;span class=&quot;system&quot;&gt;/etc/shorewall&lt;/span&gt;.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Zones Configuration&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Open and edit the file &lt;span class=&quot;system&quot;&gt;/etc/shorewall/zones&lt;/span&gt; to specify the different network zones, &lt;br /&gt;these are just labels that you will use in the other files.&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;vim /etc/shorewall/zones&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Consider the Internet(net) as one zone, and a private network(dmz) as another zone.The firewall zone or &quot;fw&quot; is your linux box itself.&lt;br /&gt;If you have these then the zones file would look like this:&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;#ZONE TYPE OPTIONS  IN OPTIONS  OUT OPTIONS&lt;br /&gt;#&lt;br /&gt;fw firewall&lt;br /&gt;net ipv4&lt;br /&gt;loc ipv4&lt;br /&gt;dmz ipv4&lt;br /&gt;#LAST LINE - ADD YOUR ENTRIES ABOVE THIS ONE - DO NOT REMOVE&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Interfaces Configuration&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The next file to edit is the interfaces file to specify the interfaces on your machine. &lt;br /&gt;&lt;div class=&quot;command&quot;&gt;vim /etc/shorewall/interfaces&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Here you will connect the zones that you defined in the previous step with an actual interface. &lt;br /&gt;The third field is the broadcast address for the network attached to the interface (&quot;detect&quot; will figure this out for you). Finally the last fields are options for the interface. The options listed below are a good starting point.&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;#ZONE INTERFACE BROADCAST OPTIONS&lt;br /&gt;net     eth0            detect          tcpflags,dhcp,routefilter,nosmurfs,logmartians&lt;br /&gt;loc     eth1            detect          tcpflags,nosmurfs&lt;br /&gt;dmz     eth2            detect&lt;br /&gt;#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Policy Configuration&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The next file defines your firewall default policy. The default policy is used if no other rules apply. &lt;br /&gt;Often you will set the default policy to REJECT or DROP as the default, and then configure &lt;br /&gt;specifically what ports/services are allowed in the next step, and any that you do not configure are by default &lt;br /&gt;rejected or dropped according to this policy. &lt;br /&gt;&lt;div class=&quot;command&quot;&gt;vim /etc/shorewall/policy&lt;/div&gt;&lt;br /&gt;&lt;div&gt;An example policy (based on the zones and interfaces we used above) would be:&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;#SOURCE  DEST  POLICY  LOG LEVEL LIMIT:BURST&lt;br /&gt;#&lt;br /&gt;# Policies for traffic originating from the local LAN (loc)&lt;br /&gt;#&lt;br /&gt;# If you want to force clients to access the Internet via a proxy server&lt;br /&gt;# in your DMZ, change the following policy to REJECT info.&lt;br /&gt;loc  net  ACCEPT&lt;br /&gt;# If you want open access to DMZ from loc, change the following policy&lt;br /&gt;# to ACCEPT.  (If you chose not to do this, you will need to add a rule&lt;br /&gt;# for each service in the rules file.)&lt;br /&gt;loc  dmz  REJECT  info&lt;br /&gt;loc  $FW  REJECT  info&lt;br /&gt;loc  all  REJECT  info&lt;br /&gt;#&lt;br /&gt;# Policies for traffic originating from the firewall ($FW)&lt;br /&gt;#&lt;br /&gt;# If you want open access to the Internet from your firewall, change the&lt;br /&gt;# $FW to net policy to ACCEPT and remove the &#39;info&#39; LOG LEVEL.&lt;br /&gt;$FW  net  REJECT  info&lt;br /&gt;$FW  dmz  REJECT  info&lt;br /&gt;$FW  loc  REJECT  info&lt;br /&gt;$FW  all  REJECT  info&lt;br /&gt;#&lt;br /&gt;# Policies for traffic originating from the De-Militarized Zone (dmz)&lt;br /&gt;#&lt;br /&gt;# If you want open access from DMZ to the Internet change the following&lt;br /&gt;# policy to ACCEPT.  This may be useful if you run a proxy server in&lt;br /&gt;# your DMZ.&lt;br /&gt;dmz  net  REJECT  info&lt;br /&gt;dmz  $FW  REJECT  info&lt;br /&gt;dmz  loc  REJECT  info&lt;br /&gt;dmz  all  REJECT  info&lt;br /&gt;#&lt;br /&gt;# Policies for traffic originating from the Internet zone (net)&lt;br /&gt;#&lt;br /&gt;net  dmz  DROP  info&lt;br /&gt;net  $FW  DROP  info&lt;br /&gt;net  loc  DROP  info&lt;br /&gt;net  all  DROP  info&lt;br /&gt;# THE FOLLOWING POLICY MUST BE LAST&lt;br /&gt;all  all  REJECT  info&lt;br /&gt;#LAST LINE -- ADD YOUR ENTRIES ABOVE THIS LINE -- DO NOT REMOVE&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Rules Configuration&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;The most important file is the rules. This is where you set what is allowed or not. &lt;br /&gt;Any new connection that comes into your firewall passes over these rules, if none of these apply, then the &lt;br /&gt;default policy will apply.&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;highlight&quot;&gt;Note: This is only for new connections, existing connections are automatically accepted.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;The comments in the file give you a good idea of how things work, but the following will provided an example &lt;br /&gt;that can give you a head-start:&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;command&quot;&gt;vim /etc/shorewall/rules&lt;/div&gt;&lt;br /&gt;&lt;div&gt;An example would be:&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;#############################################################################################################&lt;br /&gt;#ACTION  SOURCE  DEST PROTO DEST SOURCE  ORIGINAL RATE USER/ MARK&lt;br /&gt;#      PORT PORT(S)  DEST  LIMIT  GROUP&lt;br /&gt;#&lt;br /&gt;# Accept DNS connections from the firewall to the Internet&lt;br /&gt;#&lt;br /&gt;DNS/ACCEPT $FW  net&lt;br /&gt;#&lt;br /&gt;#&lt;br /&gt;# Accept SSH connections from the local network to the firewall and DMZ&lt;br /&gt;#&lt;br /&gt;SSH/ACCEPT      loc             $FW&lt;br /&gt;SSH/ACCEPT      loc             dmz&lt;br /&gt;#&lt;br /&gt;# DMZ DNS access to the Internet&lt;br /&gt;#&lt;br /&gt;DNS/ACCEPT dmz  net&lt;br /&gt;#&lt;br /&gt;# Drop Ping from the &quot;bad&quot; net zone.&lt;br /&gt;#&lt;br /&gt;Ping/DROP     net             $FW&lt;br /&gt;#&lt;br /&gt;#       Make ping work bi-directionally between the dmz, net, Firewall and local zone&lt;br /&gt;#       (assumes that the loc-&amp;gt; net policy is ACCEPT).&lt;br /&gt;#&lt;br /&gt;Ping/ACCEPT     loc             $FW&lt;br /&gt;Ping/ACCEPT     dmz             $FW&lt;br /&gt;Ping/ACCEPT     loc             dmz&lt;br /&gt;Ping/ACCEPT     dmz             loc&lt;br /&gt;Ping/ACCEPT     dmz             net&lt;br /&gt;ACCEPT  $FW  net  icmp&lt;br /&gt;ACCEPT  $FW  loc  icmp&lt;br /&gt;ACCEPT  $FW  dmz  icmp&lt;br /&gt;# Uncomment this if using Proxy ARP and static NAT and you want to allow ping from&lt;br /&gt;# the net zone to the dmz and loc&lt;br /&gt;#Ping/ACCEPT    net             dmz&lt;br /&gt;#Ping/ACCEPT    net             loc&lt;br /&gt;#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Finally&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Well we are done, let&#39;s fire up the services and begin testing. &lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;service shorewall start&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Shorewall Web interface or GUI tool&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;We have a webmin interface for shorewall to configure through GUI. You can download from &lt;a target=&quot;_self&quot; mce_real_href=&quot;http://www.webmin.com/download/modules/shorewall.wbm.gz&quot; href=&quot;http://www.webmin.com/download/modules/shorewall.wbm.gz&quot;&gt;http://www.webmin.com/download/modules/shorewall.wbm.gz&lt;/a&gt;.&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;</description><link>http://linux-info-center.blogspot.com/2008/07/set-up-shorewall-firewall-on-centos.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-5432311840350565021</guid><pubDate>Thu, 26 Jun 2008 19:55:00 +0000</pubDate><atom:updated>2008-08-14T13:06:06.360-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Firewall</category><title>Configuring The Firewall Using IPTABLES</title><description>&lt;span style=&quot;font-weight:bold;&quot;&gt;About the Script:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The script is about to build a firewall in Linux using iptables, the user need only to monitor and respond to simple and easy measures and the script will generate the user specified iptables rule in its form original.&lt;br /&gt;&lt;br /&gt;I tested the script to PCLinuxOS, FEDORA-9, DREAM_LINUX, UBUNTU-8.&lt;br /&gt;This is my iptables, version 1.0&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;About iptables:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Network security is a primary consideration in any decision to host a website as the threats are becoming more widespread and persistent every day. One way to provide additional protection is to invest in a firewall. Although prices are still falling, in some cases, you be able to create a comparable unit using the Linux iptables package on a server for little or no additional cost.&lt;br /&gt;&lt;br /&gt;Originally, most firewall / NAT package running on Linux was ipchains, but it had a number of shortcomings. To remedy this situation, Netfilter organization has decided to create a product called iptables.&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;b&gt;Starting of the Script&lt;/b&gt;&lt;br /&gt;&lt;div&gt;A Menu will appear like this:&lt;/div&gt;&lt;br /&gt;&lt;div class=system&gt;*****Main Menu*****&lt;BR /&gt;1. Check Iptables Package&lt;BR /&gt;2. Iptables Services&lt;BR /&gt;3. Build Your Firewall with Iptables&lt;BR /&gt;4. Exit&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. Check Iptables Package&lt;/b&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;Now let the user select the option &lt;B&gt;1. Check iptable Package&lt;/b&gt; from the menu by pressing &lt;B&gt;&quot;1&quot;&lt;/b&gt; from the keyboard. &lt;br /&gt;&lt;div&gt;Now the script confirms that the user must be &lt;B&gt;Root&lt;/b&gt;, and we know that the &lt;B&gt;UID&lt;/b&gt; of &lt;B&gt;Root&lt;/b&gt; is zero ( 0 ). So first I have to compare the &lt;B&gt;UID&lt;/b&gt; of the current user with zero ( 0 ), if the &lt;B&gt;UID &lt;/b&gt;doesn&#39;t match with the &lt;B&gt;UID &lt;/b&gt;of root then it will display the following message: &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=system&gt;****You must be the root user to run this script!****&lt;/div&gt;and if the &lt;B&gt;UID&lt;/b&gt; matches with root&#39;s UID then it displays the following message and runs the script: &lt;br /&gt;&lt;div class=system&gt;***Identity Verified_You are the Root***&lt;/div&gt;&lt;br /&gt;&lt;div&gt;We can check the UID of the current user by typing the following command in the terminal:&lt;/div&gt;&lt;br /&gt;&lt;div class=command&gt;echo $UID&lt;/div&gt;&lt;br /&gt;&lt;div class=highlight&gt;If the identity of the user is verified as root, then the script will check the iptables package in the Linux OS by using the following command.&lt;/div&gt;&lt;br /&gt;&lt;div class=command&gt;rpm -q iptables&lt;/div&gt;&lt;br /&gt;&lt;div class=system&gt;*****Main Menu*****&lt;BR /&gt;1. Check Iptables Package&lt;BR /&gt;2. Iptables Services&lt;BR /&gt;3. Build Your Firewall with Iptables&lt;BR /&gt;4. Exit&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Now if the user selects the option &lt;B&gt;2. Iptables Services&lt;/b&gt; then the &lt;B&gt;checkstatus&lt;/b&gt; function will be called. In this function there are some options for the user:&lt;/div&gt;&lt;br /&gt;&lt;div class=system&gt;*****Note: Save your Iptables before stop/Restart the iptables Services*****&lt;BR /&gt;1. Save the iptables&lt;BR /&gt;2. Status of Iptables&lt;BR /&gt;3. Start iptables Services&lt;BR /&gt;4. Stop iptables Services&lt;BR /&gt;5. Restart iptable Services&lt;BR /&gt;6. Flush iptables (**Use Carefully_it will remove all the rules from iptables**)&lt;BR /&gt;7. Go back to Main Menu&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;If the user selects &lt;B&gt;1. Save the iptables&lt;/b&gt; the iptables rules will be saved in the Linux OS by using the following command:&lt;/div&gt;&lt;br /&gt;&lt;div class=command&gt;/etc/init.d/iptables save &lt;/div&gt;&lt;br /&gt;&lt;div&gt;If the user selects &lt;B&gt;2. Status of iptables&lt;/b&gt; the current status of iptables will be displayed, using the following command:&lt;/div&gt;&lt;br /&gt;&lt;div class=command&gt;/etc/init.d/iptables status&lt;/div&gt;&lt;br /&gt;&lt;div class=system&gt;Chain INPUT (policy ACCEPT)&lt;BR /&gt;target prot opt source destination&lt;BR /&gt;REJECT tcp -- 192.168.1.45 172.16.4.8 reject-with icmp-port-unreachable&lt;BR /&gt;ACCEPT tcp -- 192.168.1.1 192.168.1.25&lt;BR /&gt;LOG icmp -- anywhere anywhere LOG level warning&lt;BR /&gt;&lt;BR /&gt;Chain FORWARD (policy ACCEPT)&lt;BR /&gt;target prot opt source destination&lt;BR /&gt;&lt;BR /&gt;Chain OUTPUT (policy ACCEPT)&lt;BR /&gt;target prot opt source destination&lt;BR /&gt;DROP udp -- 192.168.6.3 10.6.3.7&lt;BR /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;If the user selects &lt;B&gt;3. Start iptables Services&lt;/b&gt; then iptables will be started, using the following command:&lt;/div&gt;&lt;br /&gt;&lt;div class=command&gt;/etc/init.d/iptables start&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If the user selects &lt;B&gt;4. Stop iptables Services&lt;/b&gt; then iptables will be stopped, using the following command:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=command&gt;/etc/init.d/iptables stop&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If the user selects &lt;B&gt;5. Restart iptable Services&lt;/b&gt; then iptables will be restarted, using the following command, it will load the saved iptables rules:&lt;/div&gt;&lt;br /&gt;&lt;div class=command&gt;/etc/init.d/iptables restart&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If the user selects &lt;B&gt;6. Flush iptables&lt;/b&gt; then iptables will be flushed, (**use Carefully_it will remove all the rules from iptables**), using the following command, it will flush the saved iptables rules:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=command&gt;iptables -F&lt;/div&gt;&lt;br /&gt;&lt;div&gt;To go back to the Main Menu the user must select option &lt;B&gt;7. Go back to Main Menu.&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=system&gt;*****Main Menu*****&lt;BR /&gt;1. Check Iptables Package&lt;BR /&gt;2. Iptables Services&lt;BR /&gt;3. Build Your Firewall with Iptables&lt;BR /&gt;4. Exit&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Option &lt;B&gt;3. Build your Firewall with Iptables&lt;/b&gt; is the heart of this script, by using this option users can create the firewall with iptables using simple steps, when a user selects the option &lt;B&gt;3. Build your Firewall with Iptables&lt;/b&gt; then the script will ask the user to create the firewall.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=system&gt;Using Which Chain of Filter Table?&lt;BR /&gt;1. INPUT&lt;BR /&gt;2. OUTPUT&lt;BR /&gt;3. Forward&quot;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;The above menu will ask the user to select the chain where he/she wants to put the rule.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Now the script will ask the user to get the IP information from the &lt;B&gt;Source side&lt;/b&gt;...&lt;/div&gt;&lt;br /&gt;&lt;div class=system&gt;1. Firewall using Single Source IP&lt;BR /&gt;2. Firewall using Source Subnet&lt;BR /&gt;3. Firewall using for All Source Networks &lt;/div&gt;&lt;br /&gt;&lt;div&gt;Then the above menu ask the user the above three question, if the user selects the option &lt;B&gt;1. Firewall using Single Source IP&lt;/b&gt; then the script will ask the user to enter the IP address.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;If the user selects option &lt;B&gt;2. Firewall using Source Subnet&lt;/b&gt; then the script will ask the user to enter the subnet in the form of &quot;192.168.1.0/24&quot;.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If the user selects option &lt;B&gt;3. Firewall using for All Source Networks&lt;/b&gt; then the script will put &lt;B&gt;0/0&lt;/b&gt; in the variable named &quot;ip_source&quot; in the script.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Now the script will ask the user to get the IP information from the &lt;B&gt;Destination side&lt;/b&gt;...&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=system&gt;1. Firewall using Single Destination IP&lt;BR /&gt;2. Firewall using Destination Subnet&lt;BR /&gt;3. Firewall using for All Destination Networks &lt;/div&gt;&lt;br /&gt;&lt;div&gt;Then the above menu asks the user the above three questions, if the user selects option &lt;B&gt;1. Firewall using Single Destination IP&lt;/b&gt; then the script will ask the user to enter the IP address.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If the user selects option &lt;B&gt;2. Firewall using Destination Subnet&lt;/b&gt; then the script will ask the user to enter the subnet in the form of &quot;192.168.1.0/24&quot;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If the user selects option &lt;B&gt;3. Firewall using for All Destination Networks&lt;/b&gt; then the script will put &lt;B&gt;0/0&lt;/b&gt; in the variable named &quot;ip_dest&quot; in the script.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Now the script asks the user to select the &lt;B&gt;PROTOCOL:&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=system&gt;1. Block All Traffic of TCP&lt;BR /&gt;2. Block Specific TCP Service&lt;BR /&gt;3. Block Specific Port&lt;BR /&gt;4. Using no Protocol&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Now from the above displayed menu if the user selects&lt;B&gt; 1. Block All Traffic of TCP&lt;/b&gt; then the script will block all the TCP Traffic.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If the user selects &lt;B&gt;2. Block Specific TCP Service&lt;/b&gt;, now the script will ask the user to enter the TCP Service of his/her choice (e.g ICMP).&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=highlight&gt;Note: the TCP Service name should be in CAPITAL LETTERS!!!&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If the user selects &lt;B&gt;3. Block Specific Port&lt;/b&gt; the script will ask the user to enter the &lt;B&gt;PORT number&lt;/b&gt;.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Now the script prompts the user &lt;B&gt;What to do with the Above Created Rule?&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=system&gt;What to do with Rule?&lt;BR /&gt;1. Accept the Packet&lt;BR /&gt;2. Reject the Packet&lt;BR /&gt;3. Drop the Packet&lt;BR /&gt;4. Create Log&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;If the user selects &lt;B&gt;1. Accept the Packet&lt;/b&gt; then the packet will be accepted.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If the user selects &lt;B&gt;2. Reject the Packet&lt;/b&gt; then the packet will be rejected.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If the user selects &lt;B&gt;3. Drop the Packet&lt;/b&gt; then the packet will be dropped.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If the user selects &lt;B&gt;4. Create Log&lt;/b&gt; then only the log will be created.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Now the following message will be shown to the user: &lt;/div&gt;&lt;br /&gt;&lt;div class=system&gt;Press Enter key to Generate the Complete Rule!!!&lt;/div&gt;&lt;br /&gt;&lt;div&gt;When the user presses the Enter key then the script generates the original rule with the correct syntax and displays it to the user, in my case:&lt;/div&gt;&lt;br /&gt;&lt;div class=system&gt;The Generated Rule is&lt;BR /&gt;iptables -A INPUT -s 192.168.0.0/24 -d 172.16.0.0/16 -p TCP -j ACCEPT &lt;/div&gt;&lt;br /&gt;&lt;div&gt;Now the script shows the following message to the user:&lt;/div&gt;&lt;br /&gt;&lt;div class=system&gt;Do you want to Enter the Above rule to the IPTABLES? Yes=1 , No=2&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If the above rule is correct then the user presses &lt;B&gt;1&lt;/b&gt; for Yes and adds the rule to iptables&lt;BR /&gt;otherwise &lt;B&gt;2&lt;/b&gt; for No and the script will return to let the user edit the rule.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Here is the whole script:&lt;/div&gt;&lt;PRE editor_id=&quot;mce_editor_0&quot;&gt;#!/bin/bash&lt;br /&gt;echo -e &quot;****************Welcome*************&quot;&lt;br /&gt;###############################IPTABLE SERVICES PROGRAM BEGINS HERE###############################&lt;br /&gt;checkstatus()&lt;br /&gt; {&lt;br /&gt;  opt_checkstatus=1&lt;br /&gt; while [ $opt_checkstatus != 7 ]&lt;br /&gt;      do&lt;br /&gt;       clear&lt;br /&gt;  #echo -e &quot;\nChoose the Option Bellow!!!\n&lt;br /&gt;  echo -e &quot;\n\t*****Note: Save your Iptables before stop/Restart the iptables Services*****\n&quot;&lt;br /&gt;  echo -e &quot;   1. Save the iptables\n&lt;br /&gt;   2. Status of Iptables\n&lt;br /&gt;   3. Start iptables Services\n&lt;br /&gt;   4. Stop iptables Services\n&lt;br /&gt;   5. Restart iptable Services\n&lt;br /&gt;   6. Flush iptables (**Use Carefully_it will remove all the rules from iptables**)\n&lt;br /&gt;   7. Go back to Main Menu&quot;&lt;br /&gt;  read opt_checkstatus&lt;br /&gt;  case $opt_checkstatus in&lt;br /&gt;   1) echo -e &quot;*******************************************************\n&quot; &lt;br /&gt;               /etc/init.d/iptables save &lt;br /&gt;      echo -e &quot;\n*******************************************************\n&quot;&lt;br /&gt;    echo -e &quot;Press Enter key to Continue...&quot;&lt;br /&gt;    read temp;;&lt;br /&gt;   2) echo -e &quot;*******************************************************\n&quot;&lt;br /&gt;               /etc/init.d/iptables status &lt;br /&gt;      echo -e &quot;*******************************************************&quot;&lt;br /&gt;                                echo -e &quot;Press Enter key to Continue...&quot;&lt;br /&gt;                                     read temp;;&lt;br /&gt;   3) echo -e &quot;*******************************************************\n&quot;  &lt;br /&gt;               /etc/init.d/iptables start &lt;br /&gt;      echo -e &quot;*******************************************************\n&quot;&lt;br /&gt;                                 echo -e &quot;Press Enter key to Continue...&quot;&lt;br /&gt;                                       read temp;;&lt;br /&gt;   &lt;br /&gt;   4) echo -e &quot;*******************************************************\n&quot;&lt;br /&gt;               /etc/init.d/iptables stop&lt;br /&gt;      echo -e &quot;*******************************************************\n&quot;&lt;br /&gt;                                echo -e &quot;Press Enter key to Continue...&quot;&lt;br /&gt;                                     read temp;;&lt;br /&gt;     &lt;br /&gt;             5) echo -e &quot;*******************************************************\n&quot;&lt;br /&gt;                      /etc/init.d/iptables restart &lt;br /&gt;      echo -e &quot;*******************************************************\n&quot;&lt;br /&gt;                                echo -e &quot;Press Enter key to Continue...&quot;&lt;br /&gt;                                     read temp;;&lt;br /&gt;   6) iptables -F &lt;br /&gt;   echo -e &quot;*******************************************************&quot;&lt;br /&gt;   echo -e &quot;All the Rules from the Iptables are Flushed!!!&quot;&lt;br /&gt;   echo -e &quot;*******************************************************\n&quot;&lt;br /&gt;                                echo -e &quot;Press Enter key to Continue...&quot;&lt;br /&gt;                                 read temp;;&lt;br /&gt;   7) main;;&lt;br /&gt;   *) echo -e &quot;Wrong Option Selected!!!&quot;&lt;br /&gt;  esac&lt;br /&gt; done&lt;br /&gt; }&lt;br /&gt;###############################BUILD FIREWALL PROGRAM BEGINS FROM HERE############################### &lt;br /&gt;buildfirewall()&lt;br /&gt; {&lt;br /&gt;  ###############Getting the Chain############&lt;br /&gt;  echo -e &quot;Using Which Chain of Filter Table?\n&lt;br /&gt;  1. INPUT&lt;br /&gt;  2. OUTPUT&lt;br /&gt;  3. Forward&quot;&lt;br /&gt;  read opt_ch&lt;br /&gt;  case $opt_ch in&lt;br /&gt;   1) chain=&quot;INPUT&quot; ;;&lt;br /&gt;   2) chain=&quot;OUTPUT&quot; ;;&lt;br /&gt;   3) chain=&quot;FORWARD&quot; ;;&lt;br /&gt;   *) echo -e &quot;Wrong Option Selected!!!&quot;&lt;br /&gt;  esac&lt;br /&gt; &lt;br /&gt;  #########Getting Source IP Address##########&lt;br /&gt;  #Label&lt;br /&gt;   &lt;br /&gt;  echo -e &quot;&lt;br /&gt;  1. Firewall using Single Source IP\n&lt;br /&gt;  2. Firewall using Source Subnet\n&lt;br /&gt;  3. Firewall using for All Source Networks\n&quot;&lt;br /&gt;  read opt_ip&lt;br /&gt;   &lt;br /&gt;  case $opt_ip in&lt;br /&gt;   1) echo -e &quot;\nPlease Enter the IP Address of the Source&quot;&lt;br /&gt;   read ip_source ;;&lt;br /&gt;   2) echo -e &quot;\nPlease Enter the Source Subnet (e.g 192.168.10.0/24)&quot;&lt;br /&gt;   read ip_source ;;&lt;br /&gt;   3) ip_source=&quot;0/0&quot; ;;&lt;br /&gt;   #4) ip_source = &quot;NULL&quot; ;;&lt;br /&gt;   *) echo -e &quot;Wrong Option Selected&quot;&lt;br /&gt;  esac&lt;br /&gt;  #########Getting Destination IP Address##########&lt;br /&gt;   echo -e &quot;&lt;br /&gt;  1. Firewall using Single Destination IP\n&lt;br /&gt;                2. Firewall using Destination Subnet\n&lt;br /&gt;         3. Firewall using for All Destination Networks\n&quot;&lt;br /&gt;  &lt;br /&gt;     read opt_ip&lt;br /&gt;              case $opt_ip in&lt;br /&gt;        1) echo -e &quot;\nPlease Enter the IP Address of the Destination&quot;&lt;br /&gt;                     read ip_dest ;;&lt;br /&gt;               2) echo -e &quot;\nPlease Enter the Destination Subnet (e.g 192.168.10.0/24)&quot;&lt;br /&gt;                     read ip_dest ;;&lt;br /&gt;               3) ip_dest=&quot;0/0&quot; ;;&lt;br /&gt;        #4) ip_dest = &quot;NULL&quot; ;;&lt;br /&gt;               *) echo -e &quot;Wrong Option Selected&quot;&lt;br /&gt;       esac&lt;br /&gt;       ###############Getting the Protocol#############&lt;br /&gt;       echo -e &quot;&lt;br /&gt;       1. Block All Traffic of TCP&lt;br /&gt;       2. Block Specific TCP Service&lt;br /&gt;       3. Block Specific Port&lt;br /&gt;       4. Using no Protocol&quot;&lt;br /&gt;       read proto_ch&lt;br /&gt;       case $proto_ch in&lt;br /&gt;        1) proto=TCP ;;&lt;br /&gt;        2) echo -e &quot;Enter the TCP Service Name: (CAPITAL LETTERS!!!)&quot;&lt;br /&gt;       read proto ;;&lt;br /&gt;        3) echo -e &quot;Enter the Port Name: (CAPITAL LETTERS!!!)&quot; &lt;br /&gt;       read proto ;;&lt;br /&gt;        4) proto=&quot;NULL&quot; ;;&lt;br /&gt;        *) echo -e &quot;Wrong option Selected!!!&quot;&lt;br /&gt;       esac&lt;br /&gt; &lt;br /&gt;       #############What to do With Rule############# &lt;br /&gt;       echo -e &quot;What to do with Rule?&lt;br /&gt;       1. Accept the Packet&lt;br /&gt;       2. Reject the Packet&lt;br /&gt;       3. Drop the Packet&lt;br /&gt;       4. Create Log&quot;&lt;br /&gt;       read rule_ch&lt;br /&gt;       case $rule_ch in &lt;br /&gt;        1) rule=&quot;ACCEPT&quot; ;;&lt;br /&gt;        2) rule=&quot;REJECT&quot; ;;&lt;br /&gt;        3) rule=&quot;DROP&quot; ;;&lt;br /&gt;        4) rule=&quot;LOG&quot; ;;&lt;br /&gt;       esac&lt;br /&gt;###################Generating the Rule####################&lt;br /&gt;echo -e &quot;\n\tPress Enter key to Generate the Complete Rule!!!&quot;&lt;br /&gt;read temp&lt;br /&gt;echo -e &quot;The Generated Rule is \n&quot;&lt;br /&gt;if [ $proto == &quot;NULL&quot; ]; then&lt;br /&gt; echo -e &quot;\niptables -A $chain -s $ip_source -d $ip_dest -j $rule\n&quot;&lt;br /&gt; gen=1&lt;br /&gt;else&lt;br /&gt; echo -e &quot;\niptables -A $chain -s $ip_source -d $ip_dest -p $proto -j $rule\n&quot;&lt;br /&gt; gen=2&lt;br /&gt;fi &lt;br /&gt;echo -e &quot;\n\tDo you want to Enter the Above rule to the IPTABLES? Yes=1 , No=2&quot;&lt;br /&gt;read yesno&lt;br /&gt;if [ $yesno == 1 ] &amp;amp;&amp;amp; [ $gen == 1 ]; then&lt;br /&gt; iptables -A $chain -s $ip_source -d $ip_dest -j $rule&lt;br /&gt;else if [ $yesno == 1 ] &amp;amp;&amp;amp; [ $gen == 2 ]; then&lt;br /&gt; iptables -A $chain -s $ip_source -d $ip_dest -p $proto -j $rule         &lt;br /&gt;   &lt;br /&gt;else if [ $yesno == 2 ]; then&lt;br /&gt; &lt;br /&gt; main&lt;br /&gt;fi&lt;br /&gt;fi&lt;br /&gt;fi&lt;br /&gt;}&lt;br /&gt;      &lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt; ROOT_UID=0&lt;br /&gt; if [ $UID == $ROOT_UID ];&lt;br /&gt; then&lt;br /&gt; clear&lt;br /&gt; opt_main=1&lt;br /&gt; while [ $opt_main != 4 ]&lt;br /&gt; do&lt;br /&gt;echo -e &quot;/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\n&quot; &lt;br /&gt;#############Check Whether the iptables installed or not############ &lt;br /&gt; echo -e &quot;\t*****Main Menu*****\n&lt;br /&gt; 1. Check Iptables Package\n&lt;br /&gt; 2. Iptables Services\n&lt;br /&gt; 3. Build Your Firewall with Iptables\n&lt;br /&gt; 4. Exit&quot;&lt;br /&gt; read opt_main&lt;br /&gt; case $opt_main in&lt;br /&gt;  1) echo -e &quot;******************************&quot;&lt;br /&gt;    rpm -q iptables &lt;br /&gt;     echo -e &quot;******************************&quot; ;;&lt;br /&gt;  2) checkstatus ;;&lt;br /&gt;  3) buildfirewall ;;&lt;br /&gt;  4) exit 0 ;;&lt;br /&gt;  *) echo -e &quot;Wrong option Selected!!!&quot;&lt;br /&gt; esac&lt;br /&gt;done&lt;br /&gt;else&lt;br /&gt; echo -e &quot;You Must be the ROOT to Perfom this Task!!!&quot;&lt;br /&gt;fi&lt;br /&gt;}&lt;br /&gt;main&lt;br /&gt;exit 0&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;</description><link>http://linux-info-center.blogspot.com/2008/06/configuring-firewall-using-iptables.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-8805275716075768901</guid><pubDate>Wed, 25 Jun 2008 09:00:00 +0000</pubDate><atom:updated>2008-08-14T12:54:45.623-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">CentOS</category><title>Set Up DHCP Failover On Centos</title><description>This tutorial will guide you through setting up DHCP fail on CentOS 5.1 default using the ISC DHCP server, which can be easily adapted to any other Linux distribution on the market. You&#39;ll probably need changeover in network environments where downtime can not be tolerated. At my house is running a configuration DLNA so I need my devices to be able to obtain network settings at any time.&lt;br /&gt;&lt;br /&gt;Since DHCP and DNS often go hand in hand i will be setting up a local DNS server which allows updates dynamic, such as host names will be automatically updated DNS forever when a lease is granted to a customer.&lt;br /&gt;&lt;br /&gt;My setup use the following configuration please substitute to your own network configuration.&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Domain name - home.topdog-software.com&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Network - 192.168.1.0/24&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;DHCP servers - 192.168.1.2,192.168.1.3&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Gateway - 192.168.1.254&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;DNS servers - 192.168.1.2,192.168.1.3&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Install required Packages&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;DHCP&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# yum install dhcp -y&lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;DNS&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# yum install bind bind-chroot caching-nameserver -y&lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;NTP&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# yum install ntp -y &lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Configuration :&lt;/b&gt;&lt;br /&gt;&lt;b&gt;DHCP&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Backup your original config on the Master 192.168.1.2:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;  # cp /etc/dhcpd.conf /etc/dhcpd.conf.orig&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Edit the DHCP configuration &lt;span class=&quot;system&quot;&gt;/etc/dhcpd.conf&lt;/span&gt; on the master 192.168.1.2 and add the following, read the comments to understand the options:&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;authoritative;                                  # server is authoritative&lt;br /&gt;option domain-name &quot;home.topdog-software.com&quot;;       # the domain name issued&lt;br /&gt;option domain-name-servers 192.168.1.2,192.168.1.3;  # name servers issued&lt;br /&gt;option netbios-name-servers 192.168.1.2;             # netbios servers&lt;br /&gt;allow booting;                                       # allow for booting over the network&lt;br /&gt;allow bootp;                                         # allow for booting&lt;br /&gt;next-server 192.168.1.2;                             # TFTP server for booting&lt;br /&gt;filename &quot;pxelinux.0&quot;;                               # kernel for network booting&lt;br /&gt;ddns-update-style interim;                           # setup dynamic DNS updates&lt;br /&gt;ddns-updates on;&lt;br /&gt;ddns-domainname &quot;home.topdog-software.com&quot;;          # domain name for DDNS updates&lt;br /&gt;key rndckey {&lt;br /&gt;        algorithm       hmac-md5;&lt;br /&gt;        secret          &quot;xxxxxxxxxx&quot;;                # get from the /etc/rndc.key file&lt;br /&gt;}&lt;br /&gt;zone home.topdog-software.com                        # forward zone to update&lt;br /&gt;{&lt;br /&gt;        primary 127.0.0.1;                           # update on the local machine&lt;br /&gt;        key rndckey;                                 # key to use for the update&lt;br /&gt;}&lt;br /&gt;zone 1.168.192.in-addr.arpa                          # reverse zone to update&lt;br /&gt;{&lt;br /&gt;        primary 127.0.0.1;                           # update on the local machine&lt;br /&gt;        key rndckey;                                 # key for update&lt;br /&gt;}&lt;br /&gt;failover peer &quot;home-net&quot; {                           # fail over configuration&lt;br /&gt;         primary;                                    # This is the primary&lt;br /&gt;         address 192.168.1.2;                        # primarys ip address&lt;br /&gt;         port 647;&lt;br /&gt;         peer address 192.168.1.3;                   # peer&#39;s ip address&lt;br /&gt;         peer port 647;&lt;br /&gt;         max-response-delay 60;&lt;br /&gt;         max-unacked-updates 10;&lt;br /&gt;         mclt 3600;&lt;br /&gt;         split 128;&lt;br /&gt;         load balance max seconds 3;&lt;br /&gt;}&lt;br /&gt;subnet 192.168.1.0 netmask 255.255.255.0             # zone to issue addresses from&lt;br /&gt;{&lt;br /&gt;        pool {&lt;br /&gt;                failover peer &quot;home-net&quot;;            # pool for dhcp leases with failover bootp not allowed &lt;br /&gt;                deny dynamic bootp clients;         &lt;br /&gt;                option routers 192.168.1.254;&lt;br /&gt;                range 192.168.1.25 192.168.1.50;&lt;br /&gt;        }&lt;br /&gt;        pool {                                       # accomodate our bootp clients here no replication and failover&lt;br /&gt;                option routers 192.168.1.254;&lt;br /&gt;                range 192.168.1.51 192.168.1.55;&lt;br /&gt;        }&lt;br /&gt;        allow unknown-clients;&lt;br /&gt;        ignore client-updates;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Back up your original config on the Slave 192.168.1.3:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt; # cp /etc/dhcpd.conf /etc/dhcpd.conf.orig&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Edit the DHCP configuration &lt;span class=&quot;system&quot;&gt;/etc/dhcpd.conf&lt;/span&gt; on the slave 192.168.1.3 and add the following, read the comments to understand the options:&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;authoritative;                                  # server is authoritative&lt;br /&gt;option domain-name &quot;home.topdog-software.com&quot;;       # the domain name issued&lt;br /&gt;option domain-name-servers 192.168.1.2,192.168.1.3;  # name servers issued&lt;br /&gt;option netbios-name-servers 192.168.1.2;             # netbios servers&lt;br /&gt;allow booting;                                       # allow for booting over the network&lt;br /&gt;allow bootp;                                         # allow for booting&lt;br /&gt;next-server 192.168.1.2;                             # TFTP server for booting&lt;br /&gt;filename &quot;pxelinux.0&quot;;                               # kernel for network booting&lt;br /&gt;ddns-update-style interim;                           # setup dynamic DNS updates&lt;br /&gt;ddns-updates on;&lt;br /&gt;ddns-domainname &quot;home.topdog-software.com&quot;;          # domain name for DDNS updates&lt;br /&gt;key rndckey {&lt;br /&gt;        algorithm       hmac-md5;&lt;br /&gt;        secret          &quot;xxxxxxxxxx&quot;;                # get from the /etc/rndc.key file on the master&lt;br /&gt;}&lt;br /&gt;zone home.topdog-software.com                        # forward zone to update&lt;br /&gt;{&lt;br /&gt;        primary 192.168.1.2;                         # update on the local machine&lt;br /&gt;        key rndckey;                                 # key to use for the update&lt;br /&gt;}&lt;br /&gt;zone 1.168.192.in-addr.arpa                          # reverse zone to update&lt;br /&gt;{&lt;br /&gt;        primary 192.168.1.2;                         # update on the local machine&lt;br /&gt;        key rndckey;                                 # key for update&lt;br /&gt;}&lt;br /&gt;failover peer &quot;home-net&quot; {                           # fail over configuration&lt;br /&gt;         secondary;                                  # This is the secondary&lt;br /&gt;         address 192.168.1.3;                        # our ip address&lt;br /&gt;         port 647;&lt;br /&gt;         peer address 192.168.1.2;                   # primary&#39;s ip address&lt;br /&gt;         peer port 647;&lt;br /&gt;         max-response-delay 60;&lt;br /&gt;         max-unacked-updates 10;&lt;br /&gt;         mclt 3600;&lt;br /&gt;         load balance max seconds 3;&lt;br /&gt;}&lt;br /&gt;subnet 192.168.1.0 netmask 255.255.255.0             # zone to issue addresses from&lt;br /&gt;{&lt;br /&gt;        pool {&lt;br /&gt;                failover peer &quot;home-net&quot;;            # pool for dhcp leases with failover bootp not allowed &lt;br /&gt;                deny dynamic bootp clients;         &lt;br /&gt;                option routers 192.168.1.254;&lt;br /&gt;                range 192.168.1.25 192.168.1.50;&lt;br /&gt;        }&lt;br /&gt;        pool {                                       # accomodate our bootp clients here no replication and failover&lt;br /&gt;                option routers 192.168.1.254;&lt;br /&gt;                range 192.168.1.51 192.168.1.55;&lt;br /&gt;        }&lt;br /&gt;        allow unknown-clients;&lt;br /&gt;        ignore client-updates;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;DNS&lt;/b&gt;&lt;br /&gt;&lt;div&gt;Back up the the Bind configuration on the master:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt; # cp /var/named/chroot/etc/named.caching-nameserver.conf /var/named/chroot/etc/named.caching-nameserver.conf.orig&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Edit the configuration to reflect the config below.&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;options {&lt;br /&gt;        directory       &quot;/var/named&quot;;&lt;br /&gt;        dump-file       &quot;/var/named/data/cache_dump.db&quot;;&lt;br /&gt;        statistics-file &quot;/var/named/data/named_stats.txt&quot;;&lt;br /&gt;        memstatistics-file &quot;/var/named/data/named_mem_stats.txt&quot;;&lt;br /&gt;        query-source    port 53;&lt;br /&gt;        query-source-v6 port 53;&lt;br /&gt;        allow-query     { localhost; localnets; };&lt;br /&gt;};&lt;br /&gt;include &quot;/etc/rndc.key&quot;;&lt;br /&gt;include &quot;/etc/named.rfc1912.zones&quot;;&lt;br /&gt;zone &quot;home.topdog-software.com&quot; {&lt;br /&gt;        type master;&lt;br /&gt;        file &quot;data/home.topdog-software.com.hosts&quot;;&lt;br /&gt;        allow-transfer { 192.168.1.3; };&lt;br /&gt;        allow-update { key &quot;rndckey&quot;; };&lt;br /&gt;        allow-query { any; };&lt;br /&gt;};&lt;br /&gt;zone &quot;1.168.192.in-addr.arpa&quot; {&lt;br /&gt;        type master;&lt;br /&gt;        file &quot;data/1.168.192.in-addr.arpa.hosts&quot;;&lt;br /&gt;        allow-transfer { 192.168.1.3; };&lt;br /&gt;        allow-update { key &quot;rndckey&quot;; };&lt;br /&gt;        allow-query { any; };&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;Back up the the Bind configuration on the slave:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt; # cp /var/named/chroot/etc/named.caching-nameserver.conf /var/named/chroot/etc/named.caching-nameserver.conf.orig&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Edit the configuration to reflect the config below.&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;options {&lt;br /&gt;        directory       &quot;/var/named&quot;;&lt;br /&gt;        dump-file       &quot;/var/named/data/cache_dump.db&quot;;&lt;br /&gt;        statistics-file &quot;/var/named/data/named_stats.txt&quot;;&lt;br /&gt;        memstatistics-file &quot;/var/named/data/named_mem_stats.txt&quot;;&lt;br /&gt;        query-source    port 53;&lt;br /&gt;        query-source-v6 port 53;&lt;br /&gt;        allow-query     { localhost; localnets; };&lt;br /&gt;};&lt;br /&gt;include &quot;/etc/rndc.key&quot;;&lt;br /&gt;include &quot;/etc/named.rfc1912.zones&quot;;&lt;br /&gt;zone &quot;home.topdog-software.com&quot; {&lt;br /&gt;        type slave;&lt;br /&gt;        masters { 192.168.1.2; };&lt;br /&gt;        file &quot;data/home.topdog-software.com.hosts&quot;;&lt;br /&gt;};&lt;br /&gt;zone &quot;1.168.192.in-addr.arpa&quot; {&lt;br /&gt;        type slave;&lt;br /&gt;        masters { 192.168.1.2; };&lt;br /&gt;        file &quot;data/1.168.192.in-addr.arpa.hosts&quot;;&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;Create the zone files on the master&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;span class=&quot;system&quot;&gt;/var/named/chroot/var/named/data/home.topdog-software.com.hosts&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;$ORIGIN .&lt;br /&gt;$TTL 38400 &lt;br /&gt;home.topdog-software.com IN SOA ns1.home.topdog-software.com. andrew.topdog.za.net. (&lt;br /&gt;                                2008061629 ; serial&lt;br /&gt;                                10800      ; refresh (3 hours)&lt;br /&gt;                                3600       ; retry (1 hour)&lt;br /&gt;                                604800     ; expire (1 week)&lt;br /&gt;                                38400      ; minimum (10 hours 40 minutes)&lt;br /&gt;                                )&lt;br /&gt;                        NS      ns1.home.topdog-software.com.&lt;br /&gt;                        NS      ns2.home.topdog-software.com.&lt;br /&gt;ns1      IN    A 192.168.1.2&lt;br /&gt;ns2      IN    A 192.168.1.3&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;&lt;span class=&quot;system&quot;&gt;/var/named/chroot/var/named/data/1.168.192.in-addr.arpa.hosts&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;$ORIGIN .&lt;br /&gt;$TTL 38400      ; 10 hours 40 minutes&lt;br /&gt;1.168.192.in-addr.arpa  IN SOA  ns1.home.topdog-software.com. andrew.topdog.za.net. (&lt;br /&gt;                                2008061644 ; serial&lt;br /&gt;                                10800      ; refresh (3 hours)&lt;br /&gt;                                3600       ; retry (1 hour)&lt;br /&gt;                                604800     ; expire (1 week)&lt;br /&gt;                                38400      ; minimum (10 hours 40 minutes)&lt;br /&gt;                                )&lt;br /&gt;                        NS      ns1.home.topdog-software.com.&lt;br /&gt;                        NS      ns2.home.topdog-software.com.&lt;br /&gt;2    IN  PTR ns1.home.topdog-software.com.&lt;br /&gt;3    IN  PTR ns2.home.topdog-software.com.&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;NTP&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;NTP is required because the two DHCP servers need to be in sync for fail over as well as DDNS to take place. You can run a full fledged NTP server if you want, i will only provide you with instructions on using cron to sync NTP to an external NTP server every hour. You need to do this on BOTH servers.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;create a file &lt;span class=&quot;system&quot;&gt;/etc/cron.hourly/timesync&lt;/span&gt; and add the following:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#!/bin/bash&lt;br /&gt;#&lt;br /&gt;ntpdate -s 0.rhel.pool.ntp.org&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;make the file executable and run it for the first time:&lt;br /&gt;&lt;div class=&quot;command&quot;&gt; # /etc/cron.hourly/timesync&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Finally&lt;/b&gt;&lt;br /&gt;&lt;div&gt;Well we are done, let&#39;s fire up the services and begin testing.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;on the master:&lt;br /&gt;&lt;div class=&quot;command&quot;&gt; # service named start&lt;br /&gt;&lt;br /&gt; # service dhcpd start&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;on the slave:&lt;br /&gt;&lt;div class=&quot;command&quot;&gt; # service named start&lt;br /&gt;&lt;br /&gt; # service dhcpd start&lt;/div&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;You should see the following in your logs on the master:&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;Jun 16 13:58:56 kudusoft dhcpd: failover peer home-net: I move from recover to startup&lt;br /&gt;Jun 16 13:58:56 kudusoft dhcpd: dhcpd startup succeeded&lt;br /&gt;Jun 16 13:58:56 kudusoft dhcpd: failover peer home-net: I move from startup to recover&lt;br /&gt;Jun 16 13:59:12 kudusoft dhcpd: failover peer home-net: peer moves from unknown-state to recover&lt;br /&gt;Jun 16 13:59:12 kudusoft dhcpd: failover peer home-net: requesting full update from peer&lt;br /&gt;Jun 16 13:59:12 kudusoft dhcpd: Sent update request all message to home-net&lt;br /&gt;Jun 16 13:59:12 kudusoft dhcpd: failover peer home-net: peer moves from recover to recover&lt;br /&gt;Jun 16 13:59:12 kudusoft dhcpd: failover peer home-net: requesting full update from peer&lt;br /&gt;Jun 16 13:59:12 kudusoft dhcpd: Update request all from home-net: sending update&lt;br /&gt;Jun 16 13:59:12 kudusoft dhcpd: failover peer home-net: peer update completed.&lt;br /&gt;Jun 16 13:59:12 kudusoft dhcpd: failover peer home-net: I move from recover to recover-done&lt;br /&gt;Jun 16 13:59:13 kudusoft dhcpd: Sent update done message to home-net&lt;br /&gt;Jun 16 13:59:13 kudusoft dhcpd: failover peer home-net: peer moves from recover to recover-done&lt;br /&gt;Jun 16 13:59:13 kudusoft dhcpd: failover peer home-net: I move from recover-done to normal&lt;br /&gt;Jun 16 13:59:13 kudusoft dhcpd: failover peer home-net: peer moves from recover-done to normal&lt;br /&gt;Jun 16 13:59:14 kudusoft dhcpd: pool 914eb10 192.168.1/24 total 26  free 25  backup 0  lts -12&lt;br /&gt;Jun 16 13:59:14 kudusoft dhcpd: pool 914eb10 192.168.1/24  total 26  free 25  backup 0  lts 12&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;And on the slave:&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;Jun 16 13:59:12 shaka dhcpd: Sending on   Socket/fallback/fallback-net&lt;br /&gt;Jun 16 13:59:12 shaka dhcpd: failover peer home-net: I move from recover to startup&lt;br /&gt;Jun 16 13:59:12 shaka dhcpd: failover peer home-net: peer moves from unknown-state to recover&lt;br /&gt;Jun 16 13:59:12 shaka dhcpd: dhcpd startup succeeded&lt;br /&gt;Jun 16 13:59:12 shaka dhcpd: failover peer home-net: requesting full update from peer&lt;br /&gt;Jun 16 13:59:12 shaka dhcpd: failover peer home-net: I move from startup to recover&lt;br /&gt;Jun 16 13:59:12 shaka dhcpd: Sent update request all message to home-net&lt;br /&gt;Jun 16 13:59:12 shaka dhcpd: Sent update done message to home-net&lt;br /&gt;Jun 16 13:59:12 shaka dhcpd: Update request all from home-net: nothing pending&lt;br /&gt;Jun 16 13:59:12 shaka dhcpd: failover peer home-net: peer moves from recover to recover-done&lt;br /&gt;Jun 16 13:59:14 shaka dhcpd: failover peer home-net: peer update completed.&lt;br /&gt;Jun 16 13:59:14 shaka dhcpd: failover peer home-net: I move from recover to recover-done&lt;br /&gt;Jun 16 13:59:14 shaka dhcpd: failover peer home-net: peer moves from recover-done to normal&lt;br /&gt;Jun 16 13:59:14 shaka dhcpd: failover peer home-net: I move from recover-done to normal&lt;br /&gt;Jun 16 13:59:14 shaka dhcpd: pool 9d78ad8 192.168.1/24 total 26  free 25  backup 0  lts 12&lt;br /&gt;Jun 16 13:59:14 shaka dhcpd: pool response: 12 leases&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;</description><link>http://linux-info-center.blogspot.com/2008/06/set-up-dhcp-failover-on-centos.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-666064752244423290</guid><pubDate>Wed, 25 Jun 2008 03:48:00 +0000</pubDate><atom:updated>2008-08-14T12:40:18.068-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Postgresql</category><title>Securing Postgresql with Two-Factor Authentication</title><description>This tutorial will demonstrate how to secured PostgreSQL databases using two factors authentication of the WiKID strong authentication server via WFP on Linux. We assume that you have PostgreSQL and WiKID strong authentication server configured.&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;b&gt;Configuring Postgresql&lt;/b&gt;&lt;br /&gt;&lt;div&gt;Configuring Postgresql to use PAM authentication is trivial.  Edit the pg_hba.conf file to use PAM and add &lt;br /&gt;an entry for PAM for the appropriate network:&lt;br /&gt; &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;host all all 192.168.0.0/24 pam postgresql&lt;/pre&gt;&lt;div&gt;&lt;br /&gt; This entry specifies that all the users from the local lan (192.168.x.x) will use PAM, specifically the file  postgresql which on redhat flavors is found in /etc/pam.d.  We assume you have a separate line for access by applications.  You don&#39;t want to break any applications that are using Postgres.&lt;/div&gt;&lt;br /&gt; &lt;br /&gt; &lt;b&gt;Configuring PAM&lt;/b&gt; &lt;br /&gt; &lt;br /&gt;&lt;div&gt;If your system does not have a package for pam_radius you can download the source from the &lt;a target=&quot;_blank&quot; href=&quot;http://www.freeradius.org/pam_radius_auth/&quot;&gt; Pam Radius website&lt;/a&gt;.  &lt;a target=&quot;_blank&quot; href=&quot;http://www.freeradius.org/pam_radius_auth/INSTALL&quot;&gt;Installation documentation&lt;/a&gt; is&lt;br /&gt; also available. &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Once installed, edit the postgresql PAM file to use radius:&lt;/div&gt;&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;#%PAM-1.0 &lt;br /&gt; &lt;br /&gt;auth       sufficient   /lib/security/pam_radius_auth.so &lt;br /&gt; &lt;br /&gt;account    include      system-auth &lt;br /&gt; &lt;br /&gt;password   include      system-auth &lt;br /&gt; &lt;br /&gt;session    include      system-auth  &lt;br /&gt; &lt;/pre&gt;&lt;br /&gt;&lt;div&gt;PAM settings vary by linux flavor, so please consult your distribution&#39;s PAM documentation.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Now edit the &lt;span class=&quot;system&quot;&gt;/etc/raddb/server&lt;/span&gt; file to point to your WiKID server:  &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# server[:port] shared_secret      timeout (s)&lt;br /&gt;#127.0.0.1      secret             1&lt;br /&gt;192.168.0.10    your_shared_secret  3     &lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Configuring the WiKID Strong Authentication Server&lt;/b&gt;&lt;br /&gt;&lt;b&gt;Adding a domain to the WiKID server&amp;nbsp; &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;The WiKID Authentication System employs the concept of authentication domains.  An authentication domain is a segmentation of authentication authority.  Any given token client using the system can participate in any number of authentication domains.  These domains may exist on an individual WiKID Strong Authentication Server or they may exist on separate and discrete servers (or any combination).  Conversely, a WiKID Strong Authentication Server may provide authentication services for any number of discrete domains.  These domains may be exclusive or inclusive of any set of token clients.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;An authentication domain is initially defined by the 12-digit code used in token client provisioning.  This code allows any un-configured, unrelated token client to locate and register with a particular WiKID Strong Authentication Server and domain.  In practice, the 12-digit code signifies a zero-padded IP address that is Internet accessible.  Optionally, if may designate a prefix in the wikidsystems.net domain.  For example, a WiKID Strong Authentication Server with the public IP address of 27.232.7.14 would be directly accessible via the 12-digit code 027232007014.  Using the wikidsystem.net service, codes signifying non-routable IP addresses may be used, such as 999888777666.  You can also alter the DNS settings by &lt;a href=&quot;http://www.wikidsystems.com/documentation/howtos/How-to-configure-your-software-token-clients-to&quot; target=&quot;_blank&quot;&gt;deploying a custom jw.properties file with your software token&lt;/a&gt;.  &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Selecting the [Domains] header option will display the current domains served by this WiKID Strong Authentication Server.  See Figure 1 below. &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;img src=&quot;http://i533.photobucket.com/albums/ee333/blogger_luc/11-DomainConfigurationScreen.jpg&quot; border=&quot;0&quot; height=&quot;472&quot; width=&quot;549&quot; /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Figure 1 – Domain Configuration Screen&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Selecting [Create New Domain] on this screen will allow the administrator to establish a new authentication domain for this server.  The new domain parameter screen is depicted in Figure 2.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;img src=&quot;http://i533.photobucket.com/albums/ee333/blogger_luc/12-DomainConfigurationParameters.jpg&quot; border=&quot;0&quot; height=&quot;558&quot; width=&quot;549&quot; /&gt;&lt;/div&gt;&lt;br /&gt;The required domain configuration options are:&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;Domain Name &lt;/b&gt;– This is a descriptive label for this domain visible only in the administration system.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;Device Domain Name&lt;/b&gt; – This is the domain label that will appear in the menu option on the token client.  This label should be relatively short to facilitate viewing on a mobile device.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;Minimum PIN Length&lt;/b&gt; - This is the minimum allowable PIN length for this domain.  Any attempt to set a pin shorter than this value will generate an error on the client token client.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;Passcode Lifetime&lt;/b&gt; – This parameter specifies the maximum lifetime of the &lt;b&gt;one-time passcode&lt;/b&gt; generated in this domain.  After N elapsed seconds, the one-time passcode will automatically be invalidated.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;Server Code&lt;/b&gt; – This is the zero-padded IP address of the server or the pre-registered prefix in the wikidsystems.net domain.  This value must be exactly 12 digits in length.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;Max Bad PIN Attempts &lt;/b&gt;– The maximum number of bad PINs attempted by a token client in this domain before the token is disabled.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;Max Bad Passcode Attempts &lt;/b&gt;– The maximum number of bad passcodes entered for a userid registered in this domain before the userid is disabled.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;Max Sequential Offlines&lt;/b&gt; – The maximum number of times a token client may use the offline challenge/response authentication before being required to authenticate online. This feature is used in the Enterprise version for the wireless clients when they are out-of-network coverage. &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;Use TACACS+&lt;/b&gt; Select this to use TACACS+ for this domain.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Creating Network Clients&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Network clients are systems that request one-time password validation from a WiKID Strong Authentication Server.  These systems act in a proxy capacity, accepting questionable information from users and communicating with the WiKID Strong Authentication Server for validation.&lt;br /&gt;Network clients utilize one of the installed protocol modules.  The protocol module must be installed, initialized and enabled before you can configure add a network client for it.  &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Each network client must be configured on the WiKID Strong Authentication Server before it will allow the client to request validation. &lt;br /&gt;Figure 3 shows the initial network client screen.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;img src=&quot;http://i533.photobucket.com/albums/ee333/blogger_luc/17-InitialNetworkClientScreen.jpg&quot; align=&quot;bottom&quot; border=&quot;0&quot; height=&quot;477&quot; width=&quot;548&quot; /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Initial Network Client Screen&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Select – Create new Network Client - to begin adding a network client.  You will be presented with a screen similar to Figure 4 below.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;img src=&quot;http://i533.photobucket.com/albums/ee333/blogger_luc/18-NetworkClientProperties.jpg&quot; align=&quot;bottom&quot; border=&quot;0&quot; height=&quot;622&quot; width=&quot;550&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Network Client Properties Screen&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;These are the general network client properties.  These values are required for each network client configured, regardless of the protocol selected.  Property definitions are:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;Name&lt;/b&gt; – The descriptive name of the server.  This will be the primary display name in the administrative system and in system logs and reports.  It is recommended that you use a combination of hostname, and WiKID domain for clarity.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;IP Address&lt;/b&gt; – The IP address of the network client.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;Protocol&lt;/b&gt; – The communications protocol used by this network client.  Only protocols previously enabled will be available.  The protocol selection will dictate the additional properties that must be defined for this client. In this instance, choose Radius.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;Domain&lt;/b&gt; – This is the WiKID authentication domain in which this client will request credential validation. Your postgresql administrators will need to have their tokens registered in this domain.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Radius traffic is encoded by a shared secret, so we need to enter the same shared secret here as we entered on Postgresql server&#39;s /etc/raddb/server file:&lt;/div&gt;&lt;br /&gt;&lt;img src=&quot;http://i533.photobucket.com/albums/ee333/blogger_luc/wikid_create_shared_secret.jpg&quot; align=&quot;bottom&quot; border=&quot;0&quot; height=&quot;535&quot; width=&quot;549&quot; /&gt;&lt;br /&gt;&lt;div&gt;That&#39;s it! To access Postgresql from the command line or from any GUI interface will require a one-time passcode from the WiKID Strong Authentication server.  &lt;/div&gt;&lt;br /&gt;&lt;/span&gt;</description><link>http://linux-info-center.blogspot.com/2008/06/securing-postgresql-with-two-factor.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-650304946028922366</guid><pubDate>Mon, 23 Jun 2008 18:25:00 +0000</pubDate><atom:updated>2008-08-13T11:30:50.099-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">CentOS</category><title>Install MySQL Proxy On CentOS</title><description>This tutorial explains how you can install MySQL Proxy on a CentOS 5 (x86_64). MySQL Proxy is a simple program that sits between your client and MySQL server that can monitor, analyze and transform their communication. Its flexibility allows an unlimited number of uses; common include: load balancing, failover; query analysis, filtering and application modification, and many others.&lt;br /&gt;&lt;br /&gt;At a minimum Centos 5 final x86_64 install:&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;yum&lt;br /&gt;install gcc.x86_64 libevent.x86_64 libevent-devel.x86_64&lt;br /&gt;readline.x86_64 readline-devel.x86_64 ncurses.x86_64&lt;br /&gt;ncurses-devel.x86_64 glib2.x86_64 glib2-devel.x86_64 &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;cd /usr/local/src/&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;wget http://www.lua.org/ftp/lua-5.1.3.tar.gz&lt;br /&gt;&lt;br /&gt;tar zxvf lua-5.1.3.tar.gz&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;cd lua-5.1.3&lt;br /&gt;&lt;br /&gt;make linux&lt;br /&gt;&lt;br /&gt;make install&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;wget&lt;br /&gt;http://dev.mysql.com/get/Downloads/MySQL-Cluster-6.2/mysql-5.1.23-ndb-6.2.15-linux-x86_64-glibc23.tar.gz/\&lt;br /&gt;from/http://www.mirrorservice.org/sites/ftp.mysql.com/&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;tar xzvf mysql-5.1.23-ndb-6.2.15-linux-x86_64-glibc23.tar.gz&lt;br /&gt;&lt;br /&gt;ln -s mysql-5.1.23-ndb-6.2.15-linux-x86_64-glibc23 mysql&lt;br /&gt;&lt;br /&gt;PATH=$PATH:/usr/local/mysql/bin&lt;br /&gt;&lt;br /&gt;export PATH&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Edit your &lt;span class=&quot;system&quot;&gt;.profile&lt;/span&gt; to make this permanent:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;# .bash_profile&lt;br /&gt;&lt;br /&gt;# Get the aliases and functions&lt;br /&gt;if [ -f ~/.bashrc ]; then&lt;br /&gt;       . ~/.bashrc&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;# User specific environment and startup programs&lt;br /&gt;&lt;br /&gt;PATH=$PATH:/usr/local/mysql/bin:$HOME/bin&lt;br /&gt;&lt;br /&gt;export PATH&lt;br /&gt;unset USERNAME&lt;/pre&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;wget&lt;br /&gt;http://dev.mysql.com/get/Downloads/MySQL-Proxy/mysql-proxy-0.6.1.tar.gz/from/http://www.mirrorservice.org/sites/ftp.mysql.com/&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;tar zxvf mysql-proxy-0.6.1.tar.gz&lt;br /&gt;&lt;br /&gt;cd mysql-proxy-0.6.1&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;./configure  LDFLAGS=&quot;-lm -ldl&quot; LUA_CFLAGS=&quot;-I/usr/local/include/&quot; LUA_LIBS=/usr/local/lib/liblua.a&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;make&lt;br /&gt;&lt;br /&gt;make install&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Let&#39;s create a sample LUA script so you can see some logs.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mkdir /var/log/mysql-proxy/&lt;br /&gt;&lt;br /&gt;mkdir -p /usr/local/mysql/lua-scripts/&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;vi /usr/local/mysql/lua-scripts/simple-log.lua&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;(see: &lt;a mce_real_href=&quot;http://www.oreillynet.com/pub/a/databases/2007/07/12/getting-started-with-mysql-proxy.html?page=3&quot; href=&quot;http://www.oreillynet.com/pub/a/databases/2007/07/12/getting-started-with-mysql-proxy.html?page=3&quot; target=&quot;_blank&quot;&gt;http://www.oreillynet.com/pub/a/databases/2007/07/12/getting-started-with-mysql-proxy.html?page=3&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Script modified to get IP and to use  &lt;span class=&quot;system&quot;&gt;proxy.connection.server.thread_id&lt;/span&gt;.)&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;local log_file = &#39;/var/log/mysql-proxy/mysql.log&#39;&lt;br /&gt;local fh = io.open(log_file, &quot;a+&quot;)&lt;br /&gt;&lt;br /&gt;function read_query( packet )&lt;br /&gt;if string.byte(packet) == proxy.COM_QUERY then&lt;br /&gt; local query = string.sub(packet, 2)&lt;br /&gt; fh:write( string.format(&quot;%s %6d -- %s :IP %s :USER: %s\n&quot;,&lt;br /&gt; os.date(&#39;%Y-%m-%d %H:%M:%S&#39;),&lt;br /&gt; proxy.connection.server.thread_id,&lt;br /&gt; query,&lt;br /&gt; proxy.connection.client.address,&lt;br /&gt; proxy.connection.client.username))&lt;br /&gt;fh:flush()&lt;br /&gt;end&lt;br /&gt;end&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;Now start up your proxy using the variable &lt;span class=&quot;system&quot;&gt;--proxy-backend-addresses&lt;/span&gt; to point the proxy at your servers.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;/usr/local/sbin/mysql-proxy&lt;br /&gt;--proxy-lua-script=/usr/local/mysql/lua-scripts/simple-log.lua&lt;br /&gt;--proxy-backend-addresses=192.168.1.33:3306&lt;br /&gt;--proxy-backend-addresses=192.168.1.34:3306 --daemon&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span class=&quot;system&quot;&gt;192.168.1.33&lt;/span&gt; and &lt;span class=&quot;system&quot;&gt;192.168.1.34&lt;/span&gt; are the MySQL nodes that the proxy will be connecting to. &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Allow connections for the proxy through your firewall:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;### ALLOWED TO CONNECT TO MYSQL PROXY&lt;br /&gt;###&lt;br /&gt;### LOCAL ADMINS&lt;br /&gt;-A INPUT -s SRC-IP -d DST-IP -p tcp -m state --state NEW -m tcp --dport 4040 -j ACCEPT&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;Where  &lt;span class=&quot;system&quot;&gt;DST-IP&lt;/span&gt; is my proxy server and  &lt;span class=&quot;system&quot;&gt;SRC-IP&lt;/span&gt; is my local box (client machine).&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Now&lt;br /&gt;from your local box (not the mysql-proxy server) try and connect to the&lt;br /&gt;backend databases through the proxy ( user with relevent permissions&lt;br /&gt;must exist in the db).&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;  mysql -u dba_admin -p -h PROXY-SERVER -P 4040&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;system&quot;&gt;  Welcome to the MySQL monitor.  Commands end with ; or \g.&lt;br /&gt;&lt;br /&gt;Your MySQL connection id is 16 to server version: 5.1.23-ndb-6.2.15&lt;br /&gt;&lt;br /&gt;Type &#39;help;&#39; or &#39;\h&#39; for help. Type &#39;\c&#39; to clear the buffer.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mysql&amp;gt; show databases;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;system&quot;&gt;&lt;br /&gt;+--------------------+&lt;br /&gt;| Database           |&lt;br /&gt;+--------------------+&lt;br /&gt;| information_schema |&lt;br /&gt;| Imap_Forms         |&lt;br /&gt;| mysql              |&lt;br /&gt;| test               |&lt;br /&gt;+--------------------+&lt;br /&gt;&lt;br /&gt;4 rows in set (0.01 sec)&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mysql&amp;gt; quit&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;system&quot;&gt;Bye&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;N.B. The proxy uses the port &lt;span class=&quot;system&quot;&gt;4040&lt;/span&gt; instead of &lt;span class=&quot;system&quot;&gt;3306&lt;/span&gt;.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Test the mysql-proxy admin interface from the mysql-proxy server:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;  mysql -u root -p -h 127.0.0.1 -P 4041&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;system&quot;&gt;Welcome to the MySQL monitor.  Commands end with ; or \g.&lt;br /&gt;&lt;br /&gt;Your MySQL connection id is 1&lt;br /&gt;&lt;br /&gt;Server version: 5.1.20-agent MySQL Enterprise Agent&lt;br /&gt;&lt;br /&gt;Type &#39;help;&#39; or &#39;\h&#39; for help. Type &#39;\c&#39; to clear the buffer.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;  mysql&amp;gt; select * from proxy_connections;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;system&quot;&gt;&lt;br /&gt;+------+--------+-------+------+&lt;br /&gt;| id   | type   | state | db   |&lt;br /&gt;+------+--------+-------+------+&lt;br /&gt;|    0 | server | 0     |      |&lt;br /&gt;|    1 | proxy  | 0     |      |&lt;br /&gt;|    2 | server | 10    |      |&lt;br /&gt;+------+--------+-------+------+&lt;br /&gt;&lt;br /&gt;3 rows in set (0.00 sec)&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mysql&amp;gt;quit&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;system&quot;&gt;  bye&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt; Job done! Now read on:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;&quot;&gt;&lt;a mce_real_href=&quot;http://dev.mysql.com/tech-resources/articles/proxy-gettingstarted.html&quot; href=&quot;http://dev.mysql.com/tech-resources/articles/proxy-gettingstarted.html&quot; target=&quot;_blank&quot;&gt;http://dev.mysql.com/tech-resources/articles/proxy-gettingstarted.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;  &lt;a mce_real_href=&quot;http://forge.mysql.com/wiki/MySQL_Proxy&quot; href=&quot;http://forge.mysql.com/wiki/MySQL_Proxy&quot; target=&quot;_blank&quot;&gt;http://forge.mysql.com/wiki/MySQL_Proxy&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;  &lt;a mce_real_href=&quot;http://www.oreillynet.com/pub/a/databases/2007/07/12/getting-started-with-mysql-proxy.html?page=1&quot; href=&quot;http://www.oreillynet.com/pub/a/databases/2007/07/12/getting-started-with-mysql-proxy.html?page=1&quot; target=&quot;_blank&quot;&gt;http://www.oreillynet.com/pub/a/databases/2007/07/12/getting-started-with-mysql-proxy.html?page=1&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;</description><link>http://linux-info-center.blogspot.com/2008/06/install-mysql-proxy-on-centos.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-218023869001238058</guid><pubDate>Sun, 22 Jun 2008 18:32:00 +0000</pubDate><atom:updated>2008-08-13T11:50:25.273-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP</category><title>Intrusion Detection For PHP</title><description>This tutorial explains how to set up PHPIDS on a web server with Apache2 and PHP5. PHPIDS (PHP-Intrusion Detection System) is a simple to use, well structured, fast and state-of-the-art layer of security for your PHP based web application. The IDS or bands or filters sanitizes any malicious input, it recognizes when an attacker tries to break your site and reacts exactly how you want. On the basis of a set of highly approved and tested filtering rules any attack is a digital impact rating which makes it easy to decide what type of action should follow the hacking attempt. It may be the simple logging to send an urgent email to the development team, displaying a warning message to the attacker or even to terminate the user session.&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;b&gt;1 Preliminary Note&lt;/b&gt;&lt;br /&gt;&lt;div&gt;I have tested this on a Debian Etch LAMP system with Apache2 and PHP5 and the IP address &lt;span class=&quot;system&quot;&gt;192.168.0.100&lt;/span&gt;. The Apache user and group on Debian Etch is &lt;span class=&quot;system&quot;&gt;www-data&lt;/span&gt;, so if you are on a different distribution, the Apache user and group might be different. The location of &lt;span class=&quot;system&quot;&gt;php.ini&lt;/span&gt; (&lt;span class=&quot;system&quot;&gt;/etc/php5/apache2/php.ini&lt;/span&gt; on Debian Etch) might differ as well. &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;I&#39;m using a virtual host with the document root &lt;span class=&quot;system&quot;&gt;/var/www/web1/web&lt;/span&gt; in this example.&lt;/div&gt;&lt;br /&gt;&lt;b&gt;2 Installing PHPIDS&lt;/b&gt;&lt;br /&gt;&lt;div&gt;For security reasons, I want to install PHPIDS outside of the document root, so I create the directory &lt;span class=&quot;system&quot;&gt;/var/www/web1/phpids&lt;/span&gt;:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mkdir /var/www/web1/phpids&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Then I install PHPIDS as follows (at the time of this writing the latest version was 0.4.7) - of all the contents of the &lt;span class=&quot;system&quot;&gt;phpids-0.4.7.tar.gz&lt;/span&gt; file, we only need the &lt;span class=&quot;system&quot;&gt;lib/&lt;/span&gt; directory:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;cd /tmp&lt;br /&gt;&lt;br /&gt;  wget http://php-ids.org/files/phpids-0.4.7.tar.gz&lt;br /&gt;&lt;br /&gt;  tar xvfz phpids-0.4.7.tar.gz&lt;br /&gt;&lt;br /&gt;  cd phpids-0.4.7&lt;br /&gt;&lt;br /&gt;mv lib/ /var/www/web1/phpids/&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Now I change to the directory  &lt;span class=&quot;system&quot;&gt;/var/www/web1/phpids/lib/IDS&lt;/span&gt;...&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;cd /var/www/web1/phpids/lib/IDS&lt;/div&gt;&lt;br /&gt;&lt;div&gt;... and make the &lt;span class=&quot;system&quot;&gt;tmp/&lt;/span&gt; directory (which will hold the PHPIDS log file) writable for the Apache user and group:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;chown -R www-data:www-data tmp/&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Next we configure the PHPIDS configuration file (&lt;span class=&quot;system&quot;&gt;Config.ini&lt;/span&gt;): &lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;cd Config/&lt;br /&gt;&lt;br /&gt;vi Config.ini  &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;I&#39;m using the default configuration here, all I did was to adjust the paths:&lt;/div&gt;&lt;br /&gt;      &lt;pre&gt;; PHPIDS Config.ini&lt;br /&gt;&lt;br /&gt;; General configuration settings&lt;br /&gt;&lt;br /&gt;; !!!DO NOT PLACE THIS FILE INSIDE THE WEB-ROOT IF DATABASE CONNECTION DATA WAS ADDED!!!&lt;br /&gt;&lt;br /&gt;[General]&lt;br /&gt;&lt;br /&gt;    filter_type     = xml&lt;br /&gt;    filter_path     = /var/www/web1/phpids/lib/IDS/default_filter.xml&lt;br /&gt;    tmp_path        = /var/www/web1/phpids/lib/IDS/tmp&lt;br /&gt;    scan_keys       = false&lt;br /&gt;&lt;br /&gt;    exceptions[]    = __utmz&lt;br /&gt;    exceptions[]    = __utmc&lt;br /&gt;&lt;br /&gt;; If you use the PHPIDS logger you can define specific configuration here&lt;br /&gt;&lt;br /&gt;[Logging]&lt;br /&gt;&lt;br /&gt;    ; file logging&lt;br /&gt;    path            = /var/www/web1/phpids/lib/IDS/tmp/phpids_log.txt&lt;br /&gt;&lt;br /&gt;    ; email logging&lt;br /&gt;&lt;br /&gt;    ; note that enabling safemode you can prevent spam attempts,&lt;br /&gt;    ; see documentation&lt;br /&gt;    recipients[]    = test@test.com.invalid&lt;br /&gt;    subject         = &quot;PHPIDS detected an intrusion attempt!&quot;&lt;br /&gt;    header                      = &quot;From: &amp;lt;PHPIDS&amp;gt; info@php-ids.org&quot;&lt;br /&gt;    safemode        = true&lt;br /&gt;    allowed_rate    = 15&lt;br /&gt;&lt;br /&gt;    ; database logging&lt;br /&gt;&lt;br /&gt;    wrapper         = &quot;mysql:host=localhost;port=3306;dbname=phpids&quot;&lt;br /&gt;    user            = phpids_user&lt;br /&gt;    password        = 123456&lt;br /&gt;    table           = intrusions&lt;br /&gt;&lt;br /&gt;; If you would like to use other methods than file caching you can configure them here&lt;br /&gt;&lt;br /&gt;[Caching]&lt;br /&gt;&lt;br /&gt;    ; caching:      session|file|database|memcached|none&lt;br /&gt;    caching         = file&lt;br /&gt;    expiration_time = 600&lt;br /&gt;&lt;br /&gt;    ; file cache&lt;br /&gt;    path            = /var/www/web1/phpids/lib/IDS/tmp/default_filter.cache&lt;br /&gt;&lt;br /&gt;    ; database cache&lt;br /&gt;    wrapper         = &quot;mysql:host=localhost;port=3306;dbname=phpids&quot;&lt;br /&gt;    user            = phpids_user&lt;br /&gt;    password        = 123456&lt;br /&gt;    table           = cache&lt;br /&gt;&lt;br /&gt;    ; memcached&lt;br /&gt;    ;host           = localhost&lt;br /&gt;    ;port           = 11211&lt;br /&gt;    ;key_prefix     = PHPIDS&lt;br /&gt;    ;tmp_path       = /var/www/web1/phpids/lib/IDS/tmp/memcache.timestamp&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;3 Using PHPIDS&lt;/b&gt;&lt;br /&gt;&lt;div&gt;We will now create the file &lt;span class=&quot;system&quot;&gt;/var/www/web1/web/phpids.php&lt;/span&gt; which will call PHPIDS for us (we will later on prepend that file to all our PHP files so that our PHP files can make use of PHPIDS automatically):&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;vi /var/www/web1/web/phpids.php&lt;/div&gt;&lt;br /&gt;      &lt;pre&gt;&amp;lt;?php&lt;br /&gt;set_include_path(&lt;br /&gt;   get_include_path()&lt;br /&gt;   . PATH_SEPARATOR&lt;br /&gt;   . &#39;/var/www/web1/phpids/lib&#39;&lt;br /&gt;  );&lt;br /&gt;&lt;br /&gt;  require_once &#39;IDS/Init.php&#39;;&lt;br /&gt;  $request = array(&lt;br /&gt;      &#39;REQUEST&#39; =&amp;gt; $_REQUEST,&lt;br /&gt;      &#39;GET&#39; =&amp;gt; $_GET,&lt;br /&gt;      &#39;POST&#39; =&amp;gt; $_POST,&lt;br /&gt;      &#39;COOKIE&#39; =&amp;gt; $_COOKIE&lt;br /&gt;  );&lt;br /&gt;  $init = IDS_Init::init(&#39;/var/www/web1/phpids/lib/IDS/Config/Config.ini&#39;);&lt;br /&gt;  $ids = new IDS_Monitor($request, $init);&lt;br /&gt;  $result = $ids-&amp;gt;run();&lt;br /&gt;&lt;br /&gt;  if (!$result-&amp;gt;isEmpty()) {&lt;br /&gt;   // Take a look at the result object&lt;br /&gt;   echo $result;&lt;br /&gt;   require_once &#39;IDS/Log/File.php&#39;;&lt;br /&gt;   require_once &#39;IDS/Log/Composite.php&#39;;&lt;br /&gt;&lt;br /&gt;   $compositeLog = new IDS_Log_Composite();&lt;br /&gt;   $compositeLog-&amp;gt;addLogger(IDS_Log_File::getInstance($init));&lt;br /&gt;   $compositeLog-&amp;gt;execute($result);&lt;br /&gt;  }&lt;br /&gt;?&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Now when you call that file in a browser, (e.g. &lt;span class=&quot;system&quot;&gt;http://192.168.0.100/phpids.php&lt;/span&gt;), you will see a blank page. But if you try to append some malicious parameters to the URL (e.g. &lt;span class=&quot;system&quot;&gt;http://192.168.0.100/phpids.php?test=%22%3EXXX%3Cscript%3Ealert(1)%3C/script%3E&lt;/span&gt;), PHPIDS will detect this and print its findings in the browser: &lt;/div&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqX5-14ais0Jr5l-4PU9Oxk5J5MXGtWL0Br4a5B5wRGrmRZOOSUeEa5h0D4GO_55ocQUcUpcsDybNXNaJ3RlPIolL5rAa8ntOu8i8fFjdo4G8G8sMqY4CTP2SJ0qtqZVvy7Y-s2JK0H1Uh/s1600-h/1.png&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqX5-14ais0Jr5l-4PU9Oxk5J5MXGtWL0Br4a5B5wRGrmRZOOSUeEa5h0D4GO_55ocQUcUpcsDybNXNaJ3RlPIolL5rAa8ntOu8i8fFjdo4G8G8sMqY4CTP2SJ0qtqZVvy7Y-s2JK0H1Uh/s320/1.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5234075095508155682&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;Now we have to find a way to make our PHP scripts use PHPIDS. Of course, you don&#39;t want to modify all your PHP scripts (you could have hundreds of them...). Fortunately, there&#39;s a better way: we can tell PHP to prepend a PHP script whenever a PHP script is called. For example, if we call the script &lt;span class=&quot;system&quot;&gt;info.php&lt;/span&gt; in a browser, PHP would first execute &lt;span class=&quot;system&quot;&gt;phpids.php&lt;/span&gt; and then &lt;span class=&quot;system&quot;&gt;info.php&lt;/span&gt;, and we don&#39;t even have to modify &lt;span class=&quot;system&quot;&gt;info.php&lt;/span&gt;.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;We can do this by using PHP&#39;s &lt;span class=&quot;system&quot;&gt;auto_prepend_file&lt;/span&gt; parameter. We can &lt;span class=&quot;highlight&quot;&gt;either&lt;/span&gt; set this in our &lt;span class=&quot;system&quot;&gt;php.ini&lt;/span&gt; (this is a global setting which is valid for all PHP web sites on the server), &lt;span class=&quot;highlight&quot;&gt;or&lt;/span&gt; in an &lt;span class=&quot;system&quot;&gt;.htaccess&lt;/span&gt; file (this is a setting valid only for the web site in question):&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;b&gt;php.ini&lt;/b&gt;&lt;br /&gt;&lt;div&gt;Open your php.ini (e.g. &lt;span class=&quot;system&quot;&gt;/etc/php5/apache2/php.ini&lt;/span&gt;), and set &lt;span class=&quot;system&quot;&gt;auto_prepend_file&lt;/span&gt; to &lt;span class=&quot;system&quot;&gt;/var/www/web1/web/phpids.php&lt;/span&gt;:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;vi /etc/php5/apache2/php.ini&lt;/div&gt;&lt;br /&gt;      &lt;pre&gt;[...]&lt;br /&gt;auto_prepend_file = /var/www/web1/web/phpids.php&lt;br /&gt;[...]&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;Restart Apache afterwards:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;/etc/init.d/apache2 restart&lt;/div&gt;&lt;br /&gt;&lt;b&gt;.htaccess&lt;/b&gt;&lt;br /&gt;&lt;div&gt;Instead of modifying &lt;span class=&quot;system&quot;&gt;php.ini&lt;/span&gt; (which is a global change, i.e., the change is valid for all web sites that use PHP on the server), you can instead use an &lt;span class=&quot;system&quot;&gt;.htaccess&lt;/span&gt; file (so the setting would be valid only for the web site for which you create the &lt;span class=&quot;system&quot;&gt;.htaccess&lt;/span&gt; file):&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;vi /var/www/web1/web/.htaccess&lt;/div&gt;&lt;br /&gt;      &lt;pre&gt;php_value auto_prepend_file /var/www/web1/web/phpids.php&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;Please make sure that the vhost for the web site in &lt;span class=&quot;system&quot;&gt;/var/www/web1/web&lt;/span&gt; contains something like this (otherwise the &lt;span class=&quot;system&quot;&gt;php_value&lt;/span&gt; line in the &lt;span class=&quot;system&quot;&gt;.htaccess&lt;/span&gt; file will be ignored) (if you have to modify the vhost, please don&#39;t forget to restart Apache): &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;      &lt;pre&gt;&amp;lt;Directory /var/www/web1/web/&amp;gt;&lt;br /&gt;AllowOverride All&lt;br /&gt;&amp;lt;/Directory&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Now we create a simple PHP file, &lt;span class=&quot;system&quot;&gt;/var/www/web1/web/info.php&lt;/span&gt;:&lt;/div&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmGYi0dq_tHG2cY8wwiOPnjXtuqcbciGZat8uJg-z26obUDievX3L6xjXBgH5ueEy84aGV8ZMD9hf5oFJ7TWCM1OlbW1L68xfK7XU_Tx9FUbKxW1oG4mqK6XJpvNGbVJ_Us1y7h6Cjvy_6/s1600-h/2.png&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmGYi0dq_tHG2cY8wwiOPnjXtuqcbciGZat8uJg-z26obUDievX3L6xjXBgH5ueEy84aGV8ZMD9hf5oFJ7TWCM1OlbW1L68xfK7XU_Tx9FUbKxW1oG4mqK6XJpvNGbVJ_Us1y7h6Cjvy_6/s320/2.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5234076217948374034&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;vi /var/www/web1/web/info.php&lt;/div&gt;&lt;br /&gt;      &lt;pre&gt;&amp;lt;?php&lt;br /&gt;phpinfo();&lt;br /&gt;?&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Call that file in a browser (&lt;span class=&quot;system&quot;&gt;http://192.168.0.100/info.php&lt;/span&gt;), and you should see the normal &lt;span class=&quot;system&quot;&gt;phpinfo()&lt;/span&gt; output. &lt;/div&gt;&lt;br /&gt;&lt;div&gt;Now append some malicious parameters to the URL (e.g. &lt;span class=&quot;system&quot;&gt;http://192.168.0.100/info.php?test=%22%3EXXX%3Cscript%3Ealert(1)%3C/script%3E&lt;/span&gt;), and you should find a PHPIDS report before the &lt;span class=&quot;system&quot;&gt;phpinfo()&lt;/span&gt; output (because &lt;span class=&quot;system&quot;&gt;/var/www/web1/web/phpids.php&lt;/span&gt; was executed before &lt;span class=&quot;system&quot;&gt;/var/www/web1/web/info.php&lt;/span&gt;):&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;PHPIDS logs to &lt;span class=&quot;system&quot;&gt;/var/www/web1/phpids/lib/IDS/tmp/phpids_log.txt&lt;/span&gt;, so you should see something in the log now:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;cat /var/www/web1/phpids/lib/IDS/tmp/phpids_log.txt&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;system&quot;&gt;&quot;192.168.0.200&quot;,2008-06-04T17:36:08+02:00,54,&quot;xss csrf id rfe lfi&quot;,&quot;REQUEST.test=%5C%22%3EXXX%3Cscript%3Ealert%281%29%3C%2Fscript%3E GET.test=%5C%22%3EXXX%3Cscript%3Ealert%281%29%3C%2Fscript%3E&quot;,&lt;br /&gt;&quot;%2Finfo.php%3Ftest%3D%2522%253EXXX%253Cscript%253Ealert%281%29%253C%2Fscript%253E&quot;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Now by observing that log you learn what hackers are trying to do to your PHP applications, and you can try to harden your applications.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;To add another level of security, we can stop our PHP scripts from executing if PHPIDS find that they are under attack: we simply add something like &lt;span class=&quot;system&quot;&gt;die(&#39;&amp;lt;h1&amp;gt;Go away!&amp;lt;/h1&amp;gt;&#39;);&lt;/span&gt; to the &lt;span class=&quot;system&quot;&gt;if (!$result-&amp;gt;isEmpty()) {}&lt;/span&gt; section of the &lt;span class=&quot;system&quot;&gt;/var/www/web1/web/phpids.php&lt;/span&gt; script:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;vi /var/www/web1/web/phpids.php&lt;/div&gt;&lt;br /&gt;      &lt;pre&gt;&amp;lt;?php&lt;br /&gt;set_include_path(&lt;br /&gt;   get_include_path()&lt;br /&gt;   . PATH_SEPARATOR&lt;br /&gt;   . &#39;/var/www/web1/phpids/lib&#39;&lt;br /&gt;  );&lt;br /&gt;&lt;br /&gt;  require_once &#39;IDS/Init.php&#39;;&lt;br /&gt;  $request = array(&lt;br /&gt;      &#39;REQUEST&#39; =&amp;gt; $_REQUEST,&lt;br /&gt;      &#39;GET&#39; =&amp;gt; $_GET,&lt;br /&gt;      &#39;POST&#39; =&amp;gt; $_POST,&lt;br /&gt;      &#39;COOKIE&#39; =&amp;gt; $_COOKIE&lt;br /&gt;  );&lt;br /&gt;  $init = IDS_Init::init(&#39;/var/www/web1/phpids/lib/IDS/Config/Config.ini&#39;);&lt;br /&gt;  $ids = new IDS_Monitor($request, $init);&lt;br /&gt;  $result = $ids-&amp;gt;run();&lt;br /&gt;&lt;br /&gt;  if (!$result-&amp;gt;isEmpty()) {&lt;br /&gt;   // Take a look at the result object&lt;br /&gt;   echo $result;&lt;br /&gt;   require_once &#39;IDS/Log/File.php&#39;;&lt;br /&gt;   require_once &#39;IDS/Log/Composite.php&#39;;&lt;br /&gt;&lt;br /&gt;   $compositeLog = new IDS_Log_Composite();&lt;br /&gt;   $compositeLog-&amp;gt;addLogger(IDS_Log_File::getInstance($init));&lt;br /&gt;   $compositeLog-&amp;gt;execute($result);&lt;br /&gt;&lt;br /&gt;   die(&#39;&amp;lt;h1&amp;gt;Go away!&amp;lt;/h1&amp;gt;&#39;);&lt;br /&gt;  }&lt;br /&gt;?&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;If there&#39;s no attack, the scripts are executed, but if PHPIDS finds an attack, it prevents the scripts from being executed and displays a message to the hackers: &lt;/div&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj64SclODu4xHitT6LnxxgEQlakocy8EE5BtDM_rDDLY0veFhbj466Encx_64ir5kwZDmpL8OiONIXsjJpxwahCskSFn8VWeqlO7DOWxYNEv0dwIayf6YC0aIZpj0v2bcpCPO3WjTY3t8A5/s1600-h/3.png&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj64SclODu4xHitT6LnxxgEQlakocy8EE5BtDM_rDDLY0veFhbj466Encx_64ir5kwZDmpL8OiONIXsjJpxwahCskSFn8VWeqlO7DOWxYNEv0dwIayf6YC0aIZpj0v2bcpCPO3WjTY3t8A5/s320/3.png&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5234076221915700546&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;b&gt;4 Links&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;  &lt;li&gt;PHPIDS: &lt;a href=&quot;http://php-ids.org/&quot; target=&quot;_blank&quot;&gt;http://php-ids.org&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;PHP: &lt;a href=&quot;http://www.php.net/&quot; target=&quot;_blank&quot;&gt;http://www.php.net&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;  &lt;li&gt;Apache: &lt;a href=&quot;http://httpd.apache.org/&quot; target=&quot;_blank&quot;&gt;http://httpd.apache.org&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/span&gt;</description><link>http://linux-info-center.blogspot.com/2008/06/intrusion-detection-for-php.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqX5-14ais0Jr5l-4PU9Oxk5J5MXGtWL0Br4a5B5wRGrmRZOOSUeEa5h0D4GO_55ocQUcUpcsDybNXNaJ3RlPIolL5rAa8ntOu8i8fFjdo4G8G8sMqY4CTP2SJ0qtqZVvy7Y-s2JK0H1Uh/s72-c/1.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-3320808631339541204</guid><pubDate>Thu, 19 Jun 2008 13:36:00 +0000</pubDate><atom:updated>2008-08-13T06:45:51.535-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">OpenSUSE</category><title>New Version of OpenSUSE Released</title><description>OpenSUSE has released its latest version alias 11.0 today. This version will contain fresh innovations and new features. Some of them being the inclusion of KDE 4.04, marks a new theme installation, the latest Linux kernel (2.6.25.4) and a series of characteristics of OpenSUSE.&lt;br /&gt;&lt;br /&gt;For a list of new features, read the release notes. And then go see screenshots of the installer to get an idea of how easy it is to be installed on your machine.</description><link>http://linux-info-center.blogspot.com/2008/06/new-version-of-opensuse-released.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-5544558576105698185</guid><pubDate>Tue, 17 Jun 2008 14:04:00 +0000</pubDate><atom:updated>2008-08-13T07:34:33.224-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">WebDAV</category><title>Set Up WebDAV With MySQL Authentication On Apache2</title><description>The guide explains how to set up WebDAV MySQL Authentication (using mod_auth_mysql) Apache2 on a server Debian Etch. WebDAV means Web-based Distributed Authoring and versioning and is a set of extensions to the HTTP protocol which allows users to edit files directly on the Apache server so they do not need to be downloaded or sent via FTP. Of course, WebDAV may also be used to send and download files.&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;b&gt;1 Preliminary Note&lt;/b&gt;&lt;br /&gt;&lt;div&gt;I&#39;m using a Debian Etch server with the hostname &lt;span class=&quot;system&quot;&gt;server1.example.com&lt;/span&gt; and the IP address &lt;span class=&quot;system&quot;&gt;192.168.0.100&lt;/span&gt; here. &lt;/div&gt;&lt;br /&gt;&lt;b&gt;2 Installing Apache2, WebDAV, MySQL, mod_auth_mysql&lt;/b&gt;&lt;br /&gt;&lt;div&gt;Unfortunately &lt;span class=&quot;system&quot;&gt;libapache2-mod-auth-mysql&lt;/span&gt; is available as a Debian package only for Debian Lenny (testing) and Sid (unstable), but not for Etch. Therefore we will install the &lt;span class=&quot;system&quot;&gt;libapache2-mod-auth-mysql&lt;/span&gt; package from Lenny. To do this, open &lt;span class=&quot;system&quot;&gt;/etc/apt/sources.list&lt;/span&gt; and add the line &lt;span class=&quot;system&quot;&gt;deb http://ftp2.de.debian.org/debian/ lenny main&lt;/span&gt;; your &lt;span class=&quot;system&quot;&gt;/etc/apt/sources.list&lt;/span&gt; could then look like this:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;vi /etc/apt/sources.list&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;deb http://ftp2.de.debian.org/debian/ etch main&lt;br /&gt;deb-src http://ftp2.de.debian.org/debian/ etch main&lt;br /&gt;&lt;br /&gt;deb http://ftp2.de.debian.org/debian/ lenny main&lt;br /&gt;&lt;br /&gt;deb http://security.debian.org/ etch/updates main contrib&lt;br /&gt;deb-src http://security.debian.org/ etch/updates main contrib&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;Of course (in order not to mess up our system), we want to install packages from Lenny only if there&#39;s no appropriate package from Etch - if there are packages from Etch and Lenny, we want to install the one from Etch. To do this, we give packages from Etch a higher priority in &lt;span class=&quot;system&quot;&gt;/etc/apt/preferences&lt;/span&gt;:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;vi /etc/apt/preferences&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;Package: *&lt;br /&gt;Pin: release a=etch&lt;br /&gt;Pin-Priority: 700&lt;br /&gt;&lt;br /&gt;Package: *&lt;br /&gt;Pin: release a=lenny&lt;br /&gt;Pin-Priority: 650&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;(The terms &lt;span class=&quot;system&quot;&gt;etch&lt;/span&gt; and &lt;span class=&quot;system&quot;&gt;lenny&lt;/span&gt; refer to the appropriate terms in &lt;span class=&quot;system&quot;&gt;/etc/apt/sources.list&lt;/span&gt;; if you&#39;re using &lt;span class=&quot;system&quot;&gt;stable&lt;/span&gt; and &lt;span class=&quot;system&quot;&gt;testing&lt;/span&gt; there, you must use &lt;span class=&quot;system&quot;&gt;stable&lt;/span&gt; and &lt;span class=&quot;system&quot;&gt;testing&lt;/span&gt; instead of &lt;span class=&quot;system&quot;&gt;etch&lt;/span&gt; and &lt;span class=&quot;system&quot;&gt;lenny&lt;/span&gt; in &lt;span class=&quot;system&quot;&gt;/etc/apt/preferences&lt;/span&gt; as well.)&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Afterwards, we update our packages database:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;apt-get update&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If you&#39;re getting an error like this:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;system&quot;&gt;Segmentation faultsts... 96%&lt;/div&gt;&lt;br /&gt;&lt;div&gt;or this one:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;system&quot;&gt;E: Dynamic MMap ran out of room&lt;/div&gt;&lt;br /&gt;&lt;div&gt;open &lt;span class=&quot;system&quot;&gt;/etc/apt/apt.conf&lt;/span&gt; and add a line for &lt;span class=&quot;system&quot;&gt;APT::Cache-Limit&lt;/span&gt; with a very high value, e.g. like this: &lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;vi /etc/apt/apt.conf &lt;/div&gt;&lt;br /&gt;&lt;pre&gt;APT::Cache-Limit &quot;100000000&quot;;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;Then run&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;apt-get update&lt;/div&gt;&lt;br /&gt;&lt;div&gt;again and upgrade the installed packages:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;apt-get upgrade &lt;/div&gt;&lt;br /&gt;&lt;div&gt;(If you see any questions, you can accept the default values.) &lt;/div&gt;&lt;br /&gt;&lt;div&gt;To install Apache2, WebDAV, MySQL, and mod_auth_mysql, we run:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;apt-get install apache2 mysql-server mysql-client libapache2-mod-auth-mysql&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Create a password for the MySQL user root (replace &lt;span class=&quot;system&quot;&gt;yourrootsqlpassword&lt;/span&gt; with the password you want to use):&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mysqladmin -u root password yourrootsqlpassword&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Then check with&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;netstat -tap | grep mysql&lt;/div&gt;&lt;br /&gt;&lt;div&gt;on which addresses MySQL is listening. If the output looks like this:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;system&quot;&gt;tcp        0      0 localhost.localdo:mysql *:*                     LISTEN     2713/mysqld&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;which means MySQL is listening on &lt;span class=&quot;system&quot;&gt;localhost.localdomain&lt;/span&gt; only, then you&#39;re safe with the password you set before. But if the output looks like this:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;system&quot;&gt;tcp        0      0 *:mysql *:*                     LISTEN     2713/mysqld&lt;/div&gt;&lt;br /&gt;&lt;div&gt;you should set a MySQL password for your hostname, too, because otherwise anybody can access your database and modify data:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mysqladmin -h server1.example.com -u root password yourrootsqlpassword&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Afterwards, enable the WebDAV and mod_auth_mysql modules:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;a2enmod dav_fs&lt;br /&gt;&lt;br /&gt;a2enmod dav&lt;br /&gt;&lt;br /&gt;a2enmod auth_mysql&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Reload Apache:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;/etc/init.d/apache2 force-reload&lt;/div&gt;&lt;br /&gt;&lt;b&gt;3 Creating A Virtual Host&lt;/b&gt;&lt;br /&gt;&lt;div&gt;I will now create a default Apache vhost in the directory &lt;span class=&quot;system&quot;&gt;/var/www/web1/web&lt;/span&gt;. For this purpose, I will modify the default Apache vhost configuration in &lt;span class=&quot;system&quot;&gt;/etc/apache2/sites-available/default&lt;/span&gt;. If you already have a vhost for which you&#39;d like to enable WebDAV, you must adjust this tutorial to your situation.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;First, we create the directory &lt;span class=&quot;system&quot;&gt;/var/www/web1/web&lt;/span&gt; and make the Apache user (&lt;span class=&quot;system&quot;&gt;www-data&lt;/span&gt;) the owner of that directory:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mkdir -p /var/www/web1/web&lt;br /&gt;&lt;br /&gt;chown www-data /var/www/web1/web&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Then we back up the default Apache vhost configuration (&lt;span class=&quot;system&quot;&gt;/etc/apache2/sites-available/default&lt;/span&gt;) and create our own one:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mv /etc/apache2/sites-available/default /etc/apache2/sites-available/default_orig&lt;br /&gt;&lt;br /&gt;vi /etc/apache2/sites-available/default&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;NameVirtualHost *&lt;br /&gt;&amp;lt;VirtualHost *&amp;gt;&lt;br /&gt;  ServerAdmin webmaster@localhost&lt;br /&gt;&lt;br /&gt;  DocumentRoot /var/www/web1/web/&lt;br /&gt;  &amp;lt;Directory /var/www/web1/web/&amp;gt;&lt;br /&gt;          Options Indexes MultiViews&lt;br /&gt;          AllowOverride None&lt;br /&gt;          Order allow,deny&lt;br /&gt;          allow from all&lt;br /&gt;  &amp;lt;/Directory&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/VirtualHost&amp;gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;Then reload Apache:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;/etc/init.d/apache2 reload&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;</description><link>http://linux-info-center.blogspot.com/2008/06/set-up-webdav-with-mysql-authentication.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-1635379098117389223</guid><pubDate>Fri, 13 Jun 2008 14:34:00 +0000</pubDate><atom:updated>2008-08-13T10:10:04.885-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Ubuntu</category><title>Unlock Encrypted Root Partition</title><description>Systems fully encrypted to prevent others from obtaining your data from physical access. The rational of an encryption system is that you do not worry about what you encrypt and what not, because everything (except for / boot), will be encrypted.&lt;br /&gt;&lt;br /&gt;However, the problem I encountered so far, how could I restart my computer from a distance? I would be obliged to be in front of the computer and enter the password. I asked at this stage how I could restart the computer remotely.&lt;br /&gt;&lt;br /&gt;On Debian Administrator then I found an &lt;a href=&quot;http://www.debian-administration.org/articles/579&quot;&gt;article&lt;/a&gt; written by Wulf (Coulmann Wolfram), in which he creates an initrd with Dropbear light as ssh server and unlock a script. However, the script still has some bugs and is not suitable for Ubuntu. In comments There are some changes (in particular comment # 31 and # 29), which will also work on Ubuntu.&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;b&gt;The Script&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Well, here&#39;s the script: dropbear&lt;/div&gt;&lt;br /&gt;&lt;pre&gt;#!/bin/bash&lt;br /&gt;# We add dropbear to the initrd to be able&lt;br /&gt;# mount crypted partitions from remote&lt;br /&gt;# copyright Wulf Coulmann&lt;br /&gt;# GNU GPL&lt;br /&gt;# http://www.gnu.org/licenses/gpl.html&lt;br /&gt;#&lt;br /&gt;# Download me here: http://gpl.coulmann.de/dropbear&lt;br /&gt;# get infos about this script here:&lt;br /&gt;# http://gpl.coulmann.de/ssh_luks_unlock.html&lt;br /&gt;# Modified by Anonymous 2008&lt;br /&gt;# Modified By Geoffroy RABOUIN 26/05/2008&lt;br /&gt;# Modified by hyper_ch 15/06/2008&lt;br /&gt;### INSTRUCTIONS FOR UBUNTU ###&lt;br /&gt;# 0. Enable root login&lt;br /&gt;# 1. Install killall, busybox and dropbear:&lt;br /&gt;#    ~# sudo apt-get install psmisc busybox dropbear&lt;br /&gt;# 2. Edit network configuration below and copy contents&lt;br /&gt;#    of this file to /etc/initramfs-tools/hooks/dropbear&lt;br /&gt;# 3. Save the script and make it executable:&lt;br /&gt;#    ~# sudo chmod +x /etc/initramfs-tools/hooks/dropbear&lt;br /&gt;# 4. Create new initrd:&lt;br /&gt;#    ~# sudo mkinitramfs -o /boot/netboot&lt;br /&gt;# 5. Edit /boot/grub/menu.lst and add your new initrd as the first entry&lt;br /&gt;# 6. Delete the dropbear script the hooks folder&lt;br /&gt;#    ~# sudo rm /etc/initramfs-tools/hooks/dropbear&lt;br /&gt;# 7. Profit!&lt;br /&gt;PREREQ=&quot;&quot;&lt;br /&gt;prereqs()&lt;br /&gt;{&lt;br /&gt;echo &quot;$PREREQ&quot;&lt;br /&gt;}&lt;br /&gt;case $1 in&lt;br /&gt;prereqs)&lt;br /&gt;prereqs&lt;br /&gt;exit 0&lt;br /&gt;;;&lt;br /&gt;esac&lt;br /&gt;# Begin real processing below this line&lt;br /&gt;# load the prepared functions of debians initramfs enviroment&lt;br /&gt;source /usr/share/initramfs-tools/hook-functions&lt;br /&gt;# build the directories&lt;br /&gt;DIRS=&#39;/lib /bin /usr/bin /usr/sbin/ /proc/ /root/.ssh/ /var/ /var/run/ /etc/dropbear/&#39;&lt;br /&gt;for now in $DIRS ; do&lt;br /&gt;if [ ! -e ${DESTDIR}$now ]&lt;br /&gt;then&lt;br /&gt;mkdir -p ${DESTDIR}$now&lt;br /&gt;fi&lt;br /&gt;done&lt;br /&gt;# copy the ssh-daemon and librarys&lt;br /&gt;copy_exec /usr/sbin/dropbear /usr/sbin/&lt;br /&gt;copy_exec /usr/bin/passwd /usr/bin/&lt;br /&gt;copy_exec /bin/login /bin/&lt;br /&gt;copy_exec /usr/bin/killall /usr/bin/&lt;br /&gt;copy_exec /sbin/route /sbin/&lt;br /&gt;copy_exec /usr/bin/awk /usr/bin/&lt;br /&gt;#copy_exec /usr/bin/strace /usr/bin/&lt;br /&gt;#copy_exec /bin/nc /bin/&lt;br /&gt;copy_exec /usr/bin/wc /usr/bin/&lt;br /&gt;# some librarys are not autoincluded by copy_exec&lt;br /&gt;copy_exec /lib/libnss_compat.so.2 /lib/&lt;br /&gt;copy_exec /usr/lib/libz.so.1 /usr/lib/&lt;br /&gt;copy_exec /etc/ld.so.cache /etc/&lt;br /&gt;copy_exec /lib/libutil.so.1 /lib/&lt;br /&gt;# we copy config and key files&lt;br /&gt;cp -pr /etc/dropbear/dropbear_dss_host_key ${DESTDIR}/etc/dropbear/&lt;br /&gt;cp -pr /etc/dropbear/dropbear_rsa_host_key ${DESTDIR}/etc/dropbear/&lt;br /&gt;cp -pr /etc/passwd ${DESTDIR}/etc/&lt;br /&gt;cp -pr /etc/shadow ${DESTDIR}/etc/&lt;br /&gt;cp -pr /etc/group ${DESTDIR}/etc/&lt;br /&gt;if [ -e /root/.ssh/authorized_keys ]&lt;br /&gt;then&lt;br /&gt;cp -pr /root/.ssh/authorized_keys ${DESTDIR}/root/.ssh/&lt;br /&gt;fi&lt;br /&gt;cp -pr /etc/nsswitch.conf ${DESTDIR}/etc/&lt;br /&gt;cp -pr /etc/localtime ${DESTDIR}/etc/&lt;br /&gt;cp -pr /lib/tls ${DESTDIR}/lib/&lt;br /&gt;# we don&#39;t have bash in our initrd&lt;br /&gt;# also we only add the root account&lt;br /&gt;cat /etc/passwd | grep root | sed s/\\/bash/\\/sh/ &amp;gt; ${DESTDIR}/etc/passwd&lt;br /&gt;cat /etc/shadow | grep root &amp;gt; ${DESTDIR}/etc/shadow&lt;br /&gt;cat /etc/group | grep root &amp;gt; ${DESTDIR}/etc/group&lt;br /&gt;cat &amp;gt;${DESTDIR}/scripts/local-top/network_ssh &amp;lt;&amp;lt; &#39;EOF&#39;&lt;br /&gt;#!/bin/sh&lt;br /&gt;# we start the network and ssh-server&lt;br /&gt;PREREQ=&quot;&quot;&lt;br /&gt;prereqs()&lt;br /&gt;{&lt;br /&gt;echo &quot;$PREREQ&quot;&lt;br /&gt;}&lt;br /&gt;case $1 in&lt;br /&gt;prereqs)&lt;br /&gt;prereqs&lt;br /&gt;exit 0&lt;br /&gt;;;&lt;br /&gt;esac&lt;br /&gt;# Begin real processing below this line&lt;br /&gt;# build up helpful environment&lt;br /&gt;[ -d /dev ] || mkdir -m 0755 /dev&lt;br /&gt;[ -d /root ] || mkdir --mode=0700 /root&lt;br /&gt;[ -d /tmp ] || mkdir /tmp&lt;br /&gt;[ -d /sys ] || {&lt;br /&gt;mkdir /sys&lt;br /&gt;mount -t sysfs -o nodev,noexec,nosuid none /sys&lt;br /&gt;}&lt;br /&gt;[ -d /proc ] || {&lt;br /&gt;mkdir /proc&lt;br /&gt;mount -t proc -o nodev,noexec,nosuid none /proc&lt;br /&gt;}&lt;br /&gt;mkdir -p /var/lock&lt;br /&gt;mkdir -p /var/log&lt;br /&gt;touch /var/log/lastlog&lt;br /&gt;mkdir /dev/pts&lt;br /&gt;mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts&lt;br /&gt;/bin/sleep 5&lt;br /&gt;################# CHANGE THE LINES BELOW #################&lt;br /&gt;# The network setup: edit ip address and gateway to match your needs&lt;br /&gt;ifconfig eth0 172.16.2.128 netmask 255.255.255.0&lt;br /&gt;route add default gw 172.16.2.2&lt;br /&gt;################# CHANGE THE LINES ABOVE #################&lt;br /&gt;# display the network settings for double check&lt;br /&gt;ifconfig&lt;br /&gt;# If you like to use dhcp make sure you include dhclient or pump in&lt;br /&gt;# /etc/initramfs-tools/hooks/dropbear via&lt;br /&gt;# copy_exec /sbin/dhclient&lt;br /&gt;# for debugging ssh-server you may run it in forgound&lt;br /&gt;# /usr/sbin/dropbear -E -F&lt;br /&gt;# for more debugging you may run it with strace&lt;br /&gt;# therfor you have to include strace and nc at top of&lt;br /&gt;# /etc/initramfs-tools/hooks/dropbear via&lt;br /&gt;# copy_exec /usr/bin/strace&lt;br /&gt;# copy_exec /usr/bin/nc&lt;br /&gt;# then start nc on an other host and run&lt;br /&gt;# /usr/sbin/dropbear -E -F 2&amp;gt;&amp;amp;1 | /bin/nc -vv &amp;lt;ip of=&quot;&quot; other=&quot;&quot; host=&quot;&quot;&amp;gt; &amp;lt;nc port=&quot;&quot; of=&quot;&quot; other=&quot;&quot; host=&quot;&quot;&amp;gt;&lt;br /&gt;# e.g.:&lt;br /&gt;# /usr/sbin/dropbear -E -F 2&amp;gt;&amp;amp;1 | /bin/nc -vv 192.168.1.2 8888&lt;br /&gt;# We will use /dev/urandom because /dev/random gets easily blocked&lt;br /&gt;mv /dev/random /dev/random.old&lt;br /&gt;ln -s /dev/urandom /dev/random&lt;br /&gt;# /usr/sbin/dropbear -E -F -b /etc/dropbear/banner -d /etc/dropbear/dropbear_dss_host_key -r /etc/dropbear/dropbear_rsa_host_key -p 22&lt;br /&gt;/usr/sbin/dropbear -b /etc/dropbear/banner -d /etc/dropbear/dropbear_dss_host_key -r /etc/dropbear/dropbear_rsa_host_key -p 22&lt;br /&gt;#ls -al&lt;br /&gt;rm -f /dev/random&lt;br /&gt;mv /dev/random.old /dev/random&lt;br /&gt;EOF&lt;br /&gt;chmod 700 ${DESTDIR}/scripts/local-top/network_ssh&lt;br /&gt;cat &amp;gt;${DESTDIR}/etc/dropbear/banner &amp;lt;&amp;lt; &#39;EOF&#39;&lt;br /&gt;To unlock root-partition run&lt;br /&gt;unlock&lt;br /&gt;EOF&lt;br /&gt;# script to unlock luks via ssh&lt;br /&gt;# dirty but effektive&lt;br /&gt;cat &amp;gt;${DESTDIR}/usr/bin/unlock &amp;lt;&amp;lt; &#39;EOF&#39;&lt;br /&gt;#!/bin/sh&lt;br /&gt;/bin/sh /scripts/local-top/cryptroot&lt;br /&gt;# Kill processes locking boot process&lt;br /&gt;[ `ls /dev/mapper/ | grep -v control| wc -l | awk &#39;{print $1}&#39;` -gt 0 ] &amp;amp;&amp;amp; {&lt;br /&gt;for i in `ps | grep -E &quot;cryptroot|cryptsetup&quot; | awk &#39;{ print $1 }&#39;`&lt;br /&gt;do&lt;br /&gt;kill $i&lt;br /&gt;done&lt;br /&gt;}&lt;br /&gt;/bin/sh /scripts/local-bottom/rm_dropbear&lt;br /&gt;EOF&lt;br /&gt;chmod 700 ${DESTDIR}/usr/bin/unlock&lt;br /&gt;# make sure we exit dropbear at the end of the startup process&lt;br /&gt;cat &amp;gt;${DESTDIR}/scripts/local-bottom/rm_dropbear &amp;lt;&amp;lt; &#39;EOF&#39;&lt;br /&gt;#!/bin/sh&lt;br /&gt;PREREQ=&quot;&quot;&lt;br /&gt;prereqs()&lt;br /&gt;{&lt;br /&gt;echo &quot;&quot;&lt;br /&gt;}&lt;br /&gt;case $1 in&lt;br /&gt;prereqs)&lt;br /&gt;prereqs&lt;br /&gt;exit 0&lt;br /&gt;;;&lt;br /&gt;esac&lt;br /&gt;# Begin real processing below this line&lt;br /&gt;# we kill dropbear ssh-server&lt;br /&gt;/usr/bin/killall dropbear&lt;br /&gt;EOF&lt;br /&gt;chmod 700 ${DESTDIR}/scripts/local-bottom/rm_dropbear&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 0: Enable root login&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;First, you have to enable the root account.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;&lt;br /&gt;sudo passwd root&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;The reason why I say that root must be enabled is, because I couldn&#39;t work out how to get the whole sudo permission stuff into the initrd. I&#39;m sure there must be a way and if someone is willing to take up the challenge, please go ahead. However you can enable root login only during the creation of the initrd. Once it&#39;s created then the according stuff is saved in there and you can remove root login from the actual installation again. The root login is only required to log into dropbear and then run the unlock script. It&#39;s not used for anything else.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 1: Install required packages&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Install those packages:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;&lt;br /&gt;&lt;br /&gt;sudo apt-get install psmisc busybox dropbear&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 2: Configure network&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;In the script change the network configuration to your needs. I have sofar only used static ips. The script itself provides also option for dhcp - however I did not try those.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;################# CHANGE THE LINES BELOW #################&lt;br /&gt;# The network setup: edit ip address and gateway to match your needs&lt;br /&gt;ifconfig eth0 172.16.2.128 netmask 255.255.255.0&lt;br /&gt;route add default gw 172.16.2.2&lt;br /&gt;################# CHANGE THE LINES ABOVE #################&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;The above settings are just the values from my vmware machine on where I tested it.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 3: Save the script and make it executable:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Save the altered script to [I]/etc/initramfs-tools/hooks/dropbear[/I] and make it then executable:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;&lt;br /&gt;sudo chmod +x /etc/initramfs-tools/hooks/dropbear&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 4: Create new initrd&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Run this command to create a new initrd with the name of &quot;netboot&quot;. Of course you can rename &quot;netboot&quot; to anything you like.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;&lt;br /&gt;sudo mkinitramfs -o /boot/netboot&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 5: Edit /boot/grub/menu.lst and add your new initrd as the first entry&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Now you have to edit grub&#39;s menu list to add the new init.rd.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Run:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;&lt;br /&gt;sudo nano /boot/grub/menu.lst&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;to edit the menu.lst in nano.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Go to the end (or almost) and copy an existing kernel entry e.g.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;title           Ubuntu 8.04.1, kernel 2.6.24-19-generic&lt;br /&gt;root            (hd0,1)&lt;br /&gt;kernel          /vmlinuz-2.6.24-19-generic root=/dev/mapper/sda4_crypt ro quiet splash&lt;br /&gt;initrd          /initrd.img-2.6.24-19-generic&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;Change it to something like:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;title           Netboot&lt;br /&gt;root            (hd0,1)&lt;br /&gt;kernel          /vmlinuz-2.6.24-19-generic root=/dev/mapper/sda4_crypt ro quiet splash&lt;br /&gt;initrd          /netboot&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;Don&#39;t copy my example directly but use yours. That way the root hd entry and the mapper name are correct.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Finally, at the top of the menu.lst also change the default boot entry accordingly. If you have 7 kernel entries, then you will put a &quot;6&quot; there because it starts with 0 and you add the netboot one at the bottom.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 6: Delete the dropbear script in the hooks folder&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;When I tried it on my machine, after a kernel upgrade there were some problems (which may have resulted from my earlier tries with a buggy script). Just to make sure, delete the dropbear script from the folder.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;&lt;br /&gt;sudo rm /etc/initramfs-tools/hooks/dropbear&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Step 7: Profit!&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;That&#39;s it... it should be working now.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;A few things to mention&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;- Well, in the script I currently call a &lt;i&gt;ifconfig&lt;/i&gt; after the network configuration. I did that for bugtracing. You can of course delete that from the script.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;- After you have now created the netboot initrd you can either change the root password again or disable root login. As the initrd is not encrypted it is possible to get the hash of the root password and so you want to use a different one from remote unlocking the crypto drives. I highly recommend changing the password or disabling root login in the actual machine.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;Change root password&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;&lt;br /&gt;sudo passwd root&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;or delete the root password (disable root)&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;&lt;br /&gt;sudo passwd -l root&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;- Although the system is fully encrypted, there are still two possible attacks left to gain access to the data:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&amp;nbsp; (1) ColdBoot Attack by reading the crypto password from the ram blocks (not much you can&#39;t do against that without special hardware, see &lt;a target=&quot;_blank&quot; mce_real_href=&quot;http://citp.princeton.edu/memory&quot; href=&quot;http://citp.princeton.edu/memory&quot;&gt;here&lt;/a&gt;)&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&amp;nbsp; (2) The created initrd can be manipulated so that it logs the crypto password somewhere. As /boot is not encrypted an attacker may gain this way the password for the LUKS-devices. You could, to prevent that, make a bootable cd with the according kernels and initrds and implement some kind of hash check... maybe there are other methods... feedback is welcomed here.&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;- Most of this tutorial is not from me, just a few adapations and explanations. So thanks goes to Wolfram Coulmann and the others who modified the original script.&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;</description><link>http://linux-info-center.blogspot.com/2008/06/unlock-luks-encrypted-root-partition.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-4285235093692574779</guid><pubDate>Fri, 13 Jun 2008 09:23:00 +0000</pubDate><atom:updated>2008-08-13T06:42:31.183-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Opera</category><title>New Opera Web Browser Released ver 0.95</title><description>Opera has released another version of its flagship Web browser with the same name. It comes with unique features, many of which are not yet available on other browsers of the box.&lt;br /&gt;&lt;br /&gt;I have always found using Opera to be a pleasant experience. Some new features offered by Opera are as follows:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Opera Link: For the first time ever, all your bookmarks, speed dialing and notes taken in Opera Web browser will follow you everywhere around you. You can even access from your mobile phone. The catch is that you must use a Web browser Opera. Opera offers space on their server to store your bookmarks and other parameters which makes it possible.&lt;/li&gt;&lt;li&gt;Quick Search: Opera monitors not only Web addresses you visit, but also the words of pages you&#39;ve visited. So if you do not remember the address but do not forget a word about the Web page by typing in the address bar will allow you to zero on the web page accurate.&lt;/li&gt;&lt;li&gt;Better protection against fraud.&lt;/li&gt;&lt;li&gt;A clear skin.&lt;/li&gt;&lt;/ol&gt;Opera has also claimed --&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;-- It’s faster, lighter and pushes us further out in front of other browsers,&lt;br /&gt;-- by blending the mobile and desktop worlds together in new&lt;br /&gt;-- and powerful ways.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;But let the end-users who decide. Why not visit the opera and &lt;a href=&quot;http://www.opera.com/download/&quot;&gt;download the latest version 9.5&lt;/a&gt; and take it for a spin? For all you know, you might get hooked on another fabulous Web browser.</description><link>http://linux-info-center.blogspot.com/2008/06/new-opera-web-browser-released-ver-095.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-7890775921632186096</guid><pubDate>Thu, 12 Jun 2008 15:36:00 +0000</pubDate><atom:updated>2008-07-30T00:26:47.770-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Apache</category><title>Apache : Reduce Log File Disk Usage</title><description>Slowly, I saw my hard drive use more and more space, I knew it was the log files which are growing more and much more. I discovered that the Apache log files were the worst, it was about 1 GB of space used in 3 months.&lt;br /&gt;&lt;br /&gt;So I decided to make a bash script, which compresses the Apache log files every month.&lt;br /&gt;&lt;br /&gt;The script can be altered to your needs:&lt;br /&gt;&lt;pre&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;MONTH=&quot;$((`date +%m`-1))&quot;&lt;br /&gt;YEAR=$(date +&quot;%Y&quot;)&lt;br /&gt;&lt;br /&gt;cd /var/www/&lt;br /&gt;&lt;br /&gt;for f in $(ls /var/www | grep web); do&lt;br /&gt;cd /var/www/$f/log&lt;br /&gt;if [ -a $YEAR ];&lt;br /&gt;then&lt;br /&gt;cd $YEAR&lt;br /&gt;  if [ -a 0$MONTH ];&lt;br /&gt;    then&lt;br /&gt;     tar -zcvf 0$MONTH.tar.gz 0$MONTH&lt;br /&gt;     rm -rf /var/www/$f/log/$YEAR/0$MONTH&lt;br /&gt;  fi&lt;br /&gt;fi&lt;br /&gt;done&lt;/pre&gt;Then you run this script in your crontab the first day of each month:&lt;br /&gt;&lt;pre&gt;05 03 1 * * sh /root/logclean.sh&lt;/pre&gt;</description><link>http://linux-info-center.blogspot.com/2008/06/apache-reduce-log-file-disk-usage.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-3556600667849333338</guid><pubDate>Tue, 10 Jun 2008 18:36:00 +0000</pubDate><atom:updated>2008-07-30T01:20:33.435-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Postfix</category><title>Guide :  Whitelist Hosts In Postfix</title><description>If you run a mail server and use blacklists to block spam, you probably know this problem from time to time your customers complain they can not receive e-mails from certain freemailers. Most often this occurs because a freemailer has been abused to send spam and thus obtained a blacklist. This little guide shows you how such a whitelist Postfix mail server to make your customers happy.&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;I&#39;m not issue any guarantee that it works for you!&lt;br /&gt;&lt;p&gt;If a blacklisted server tries to send mail to your server, you should find something like this in your mail log:&lt;/p&gt;&lt;span class=&quot;system&quot;&gt;SMTP error from remote mail server after RCPT TO:&amp;lt;bla@example.com&amp;gt;: host mail.example.com [4.3.2.1]: 554 5.7.1 Service unavailable; Client host [1.2.3.4] blocked using dnsbl.sorbs.net; Currently Sending Spam See: http://www.sorbs.net/lookup.shtml?1.2.3.4&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In this example, the mail server &lt;span class=&quot;system&quot;&gt;1.2.3.4&lt;/span&gt; is blacklisted and therefore blocked.&lt;br /&gt;&lt;p&gt;To whitelist that server, create the file &lt;span class=&quot;system&quot;&gt;/etc/postfix/rbl_override&lt;/span&gt; where you list all IP addresses or host names (one per line!) that you want to whitelist:&lt;/p&gt;vi /etc/postfix/rbl_override1.2.3.4 OK&lt;br /&gt;&lt;pre&gt;1.2.3.5 OK&lt;br /&gt;mail.freemailer.tld OK&lt;/pre&gt;After you&#39;ve created/modified that file, you must runpostmap /etc/postfix/rbl_override&lt;br /&gt;&lt;p&gt;Next open &lt;span class=&quot;system&quot;&gt;/etc/postfix/main.cf&lt;/span&gt; and search for the &lt;span class=&quot;system&quot;&gt;smtpd_recipient_restrictions&lt;/span&gt; parameter. Add &lt;span class=&quot;system&quot;&gt;check_client_access hash:/etc/postfix/rbl_override&lt;/span&gt; to that parameter, after &lt;span class=&quot;system&quot;&gt;reject_unauth_destination&lt;/span&gt;, but before the first blacklist. &lt;/p&gt;So if &lt;span class=&quot;system&quot;&gt;smtpd_recipient_restrictions&lt;/span&gt; looks like this now...&lt;br /&gt;&lt;p class=&quot;command&quot;&gt;vi /etc/postfix/main.cf&lt;/p&gt;&lt;br /&gt;&lt;pre&gt;[...]&lt;br /&gt;smtpd_recipient_restrictions = reject_invalid_hostname,&lt;br /&gt;   reject_unauth_pipelining,&lt;br /&gt;   permit_mynetworks,&lt;br /&gt;   permit_sasl_authenticated,&lt;br /&gt;   reject_unauth_destination,&lt;br /&gt;   reject_rbl_client multi.uribl.com,&lt;br /&gt;   reject_rbl_client dsn.rfc-ignorant.org,&lt;br /&gt;   reject_rbl_client dul.dnsbl.sorbs.net,&lt;br /&gt;   reject_rbl_client list.dsbl.org,&lt;br /&gt;   reject_rbl_client sbl-xbl.spamhaus.org,&lt;br /&gt;   reject_rbl_client bl.spamcop.net,&lt;br /&gt;   reject_rbl_client dnsbl.sorbs.net,&lt;br /&gt;   reject_rbl_client cbl.abuseat.org,&lt;br /&gt;   reject_rbl_client ix.dnsbl.manitu.net,&lt;br /&gt;   reject_rbl_client combined.rbl.msrbl.net,&lt;br /&gt;   reject_rbl_client rabl.nuclearelephant.com,&lt;br /&gt;   permit&lt;br /&gt;[...]&lt;/pre&gt;... modify it so that it looks as follows:&lt;br /&gt; &lt;pre&gt;[...]&lt;br /&gt;smtpd_recipient_restrictions = reject_invalid_hostname,&lt;br /&gt;   reject_unauth_pipelining,&lt;br /&gt;   permit_mynetworks,&lt;br /&gt;   permit_sasl_authenticated,&lt;br /&gt;   reject_unauth_destination,&lt;br /&gt;   check_client_access hash:/etc/postfix/rbl_override,&lt;br /&gt;   reject_rbl_client multi.uribl.com,&lt;br /&gt;   reject_rbl_client dsn.rfc-ignorant.org,&lt;br /&gt;   reject_rbl_client dul.dnsbl.sorbs.net,&lt;br /&gt;   reject_rbl_client list.dsbl.org,&lt;br /&gt;   reject_rbl_client sbl-xbl.spamhaus.org,&lt;br /&gt;   reject_rbl_client bl.spamcop.net,&lt;br /&gt;   reject_rbl_client dnsbl.sorbs.net,&lt;br /&gt;   reject_rbl_client cbl.abuseat.org,&lt;br /&gt;   reject_rbl_client ix.dnsbl.manitu.net,&lt;br /&gt;   reject_rbl_client combined.rbl.msrbl.net,&lt;br /&gt;   reject_rbl_client rabl.nuclearelephant.com,&lt;br /&gt;   permit&lt;br /&gt;[...]&lt;/pre&gt;That&#39;s it! Restart Postfix, and you&#39;re done:&lt;br /&gt;&lt;p class=&quot;command&quot;&gt;/etc/init.d/postfix restart &lt;/p&gt;&lt;/span&gt;</description><link>http://linux-info-center.blogspot.com/2008/06/guide-whitelist-hosts-in-postfix.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-5573155491922464965</guid><pubDate>Tue, 10 Jun 2008 18:12:00 +0000</pubDate><atom:updated>2008-07-30T01:33:06.977-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">MySQL</category><title>Guide : Fix MySQL Replication</title><description>If you set up replication MySQL, you probably know this problem: there are sometimes complaints that cause invalid MySQL replication does not work. In this small guide I explain how you can repair on the MySQL slave replication without the need to establish from scratch.&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;I&#39;m not issue any guarantee that it works for you!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;strong&gt;1 Identifying The Problem&lt;/strong&gt;&lt;/b&gt;&lt;br /&gt;&lt;div&gt;To find out whether replication is/is not working and what has caused to stop it, you can take a look at the logs. On Debian, for example, MySQL logs to &lt;span class=&quot;system&quot;&gt;/var/log/syslog&lt;/span&gt;:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;grep mysql /var/log/syslog&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;system&quot;&gt;server1:/home/admin# grep mysql /var/log/syslog&lt;br /&gt;&lt;br /&gt;May 29 09:56:08 http2 mysqld[1380]: 080529 9:56:08 [ERROR] Slave: Error &#39;Table &#39;mydb.taggregate_temp_1212047760&#39; doesn&#39;t exist&#39; on query. Default database: &#39;mydb&#39;. Query: &#39;UPDATE thread AS thread,taggregate_temp_1212047760 AS aggregate&lt;br /&gt;&lt;br /&gt;May 29 09:56:08 http2 mysqld[1380]: ^ISET thread.views = thread.views + aggregate.views&lt;br /&gt;&lt;br /&gt;May 29 09:56:08 http2 mysqld[1380]: ^IWHERE thread.threadid = aggregate.threadid&#39;, Error_code: 1146&lt;br /&gt;&lt;br /&gt;May 29 09:56:08 http2 mysqld[1380]: 080529 9:56:08 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with &quot;SLAVE START&quot;. We stopped at log &#39;mysql-bin.001079&#39; position 203015142&lt;br /&gt;&lt;br /&gt;server1:/home/admin#&lt;/div&gt;&lt;br /&gt;&lt;div&gt;You can see what query caused the error, and at what log position the replication stopped.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;To verify that the replication is really not working, log in to MySQL:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mysql -u root -p&lt;/div&gt;&lt;br /&gt;&lt;div&gt;On the MySQL shell, run:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mysql&amp;gt; SHOW SLAVE STATUS \G&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If one of &lt;span class=&quot;system&quot;&gt;Slave_IO_Running&lt;/span&gt; or &lt;span class=&quot;system&quot;&gt;Slave_SQL_Running&lt;/span&gt; is set to &lt;span class=&quot;system&quot;&gt;No&lt;/span&gt;, then the replication is broken:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;system&quot;&gt;mysql&amp;gt; SHOW SLAVE STATUS \G&lt;br /&gt;&lt;br /&gt;*************************** 1. row ***************************&lt;br /&gt;&lt;br /&gt;       Slave_IO_State: Waiting for master to send event&lt;br /&gt;&lt;br /&gt;          Master_Host: 1.2.3.4&lt;br /&gt;&lt;br /&gt;          Master_User: slave_user&lt;br /&gt;&lt;br /&gt;          Master_Port: 3306&lt;br /&gt;&lt;br /&gt;        Connect_Retry: 60&lt;br /&gt;&lt;br /&gt;      Master_Log_File: mysql-bin.001079&lt;br /&gt;&lt;br /&gt;  Read_Master_Log_Pos: 269214454&lt;br /&gt;&lt;br /&gt;       Relay_Log_File: slave-relay.000130&lt;br /&gt;&lt;br /&gt;        Relay_Log_Pos: 100125935&lt;br /&gt;&lt;br /&gt;Relay_Master_Log_File: mysql-bin.001079&lt;br /&gt;&lt;br /&gt;     Slave_IO_Running: Yes&lt;br /&gt;&lt;br /&gt;    Slave_SQL_Running: No&lt;br /&gt;&lt;br /&gt;      Replicate_Do_DB: mydb&lt;br /&gt;&lt;br /&gt;  Replicate_Ignore_DB:&lt;br /&gt;&lt;br /&gt;   Replicate_Do_Table:&lt;br /&gt;&lt;br /&gt;Replicate_Ignore_Table:&lt;br /&gt;&lt;br /&gt;Replicate_Wild_Do_Table:&lt;br /&gt;&lt;br /&gt;Replicate_Wild_Ignore_Table:&lt;br /&gt;&lt;br /&gt;           Last_Errno: 1146&lt;br /&gt;&lt;br /&gt;           Last_Error: Error &#39;Table &#39;mydb.taggregate_temp_1212047760&#39; doesn&#39;t exist&#39; on query. Default database: &#39;mydb&#39;.&lt;br /&gt;Query: &#39;UPDATE thread AS thread,taggregate_temp_1212047760 AS aggregate&lt;br /&gt;&lt;br /&gt;  SET thread.views = thread.views + aggregate.views&lt;br /&gt;&lt;br /&gt;  WHERE thread.threadid = aggregate.threadid&#39;&lt;br /&gt;&lt;br /&gt;         Skip_Counter: 0&lt;br /&gt;&lt;br /&gt;  Exec_Master_Log_Pos: 203015142&lt;br /&gt;&lt;br /&gt;      Relay_Log_Space: 166325247&lt;br /&gt;&lt;br /&gt;      Until_Condition: None&lt;br /&gt;&lt;br /&gt;       Until_Log_File:&lt;br /&gt;&lt;br /&gt;        Until_Log_Pos: 0&lt;br /&gt;&lt;br /&gt;   Master_SSL_Allowed: No&lt;br /&gt;&lt;br /&gt;   Master_SSL_CA_File:&lt;br /&gt;&lt;br /&gt;   Master_SSL_CA_Path:&lt;br /&gt;&lt;br /&gt;      Master_SSL_Cert:&lt;br /&gt;&lt;br /&gt;    Master_SSL_Cipher:&lt;br /&gt;&lt;br /&gt;       Master_SSL_Key:&lt;br /&gt;&lt;br /&gt;Seconds_Behind_Master: NULL&lt;br /&gt;&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;mysql&amp;gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;strong&gt;2 Repairing The Replication&lt;/strong&gt;&lt;/b&gt;&lt;br /&gt;&lt;div&gt;Just to go sure, we stop the slave:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mysql&amp;gt; STOP SLAVE;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Fixing the problem is actually quite easy. We tell the slave to simply skip the invalid SQL query:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mysql&amp;gt; SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;This tells the slave to skip one query (which is the invalid one that caused the replication to stop). If you&#39;d like to skip two queries, you&#39;d use &lt;span class=&quot;system&quot;&gt;SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 2;&lt;/span&gt; instead and so on.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;That&#39;s it already. Now we can start the slave again...&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mysql&amp;gt; START SLAVE;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;... and check if replication is working again:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mysql&amp;gt; SHOW SLAVE STATUS \G&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;system&quot;&gt;mysql&amp;gt; SHOW SLAVE STATUS \G&lt;br /&gt;&lt;br /&gt;*************************** 1. row ***************************&lt;br /&gt;&lt;br /&gt;       Slave_IO_State: Waiting for master to send event&lt;br /&gt;&lt;br /&gt;          Master_Host: 1.2.3.4&lt;br /&gt;&lt;br /&gt;          Master_User: slave_user&lt;br /&gt;&lt;br /&gt;          Master_Port: 3306&lt;br /&gt;&lt;br /&gt;        Connect_Retry: 60&lt;br /&gt;&lt;br /&gt;      Master_Log_File: mysql-bin.001079&lt;br /&gt;&lt;br /&gt;  Read_Master_Log_Pos: 447560366&lt;br /&gt;&lt;br /&gt;       Relay_Log_File: slave-relay.000130&lt;br /&gt;&lt;br /&gt;        Relay_Log_Pos: 225644062&lt;br /&gt;&lt;br /&gt;Relay_Master_Log_File: mysql-bin.001079&lt;br /&gt;&lt;br /&gt;     Slave_IO_Running: Yes&lt;br /&gt;&lt;br /&gt;    Slave_SQL_Running: Yes&lt;br /&gt;&lt;br /&gt;      Replicate_Do_DB: mydb&lt;br /&gt;&lt;br /&gt;  Replicate_Ignore_DB:&lt;br /&gt;&lt;br /&gt;   Replicate_Do_Table:&lt;br /&gt;&lt;br /&gt;Replicate_Ignore_Table:&lt;br /&gt;&lt;br /&gt;Replicate_Wild_Do_Table:&lt;br /&gt;&lt;br /&gt;Replicate_Wild_Ignore_Table:&lt;br /&gt;&lt;br /&gt;           Last_Errno: 0&lt;br /&gt;&lt;br /&gt;           Last_Error:&lt;br /&gt;&lt;br /&gt;         Skip_Counter: 0&lt;br /&gt;&lt;br /&gt;  Exec_Master_Log_Pos: 447560366&lt;br /&gt;&lt;br /&gt;      Relay_Log_Space: 225644062&lt;br /&gt;&lt;br /&gt;      Until_Condition: None&lt;br /&gt;&lt;br /&gt;       Until_Log_File:&lt;br /&gt;&lt;br /&gt;        Until_Log_Pos: 0&lt;br /&gt;&lt;br /&gt;   Master_SSL_Allowed: No&lt;br /&gt;&lt;br /&gt;   Master_SSL_CA_File:&lt;br /&gt;&lt;br /&gt;   Master_SSL_CA_Path:&lt;br /&gt;&lt;br /&gt;      Master_SSL_Cert:&lt;br /&gt;&lt;br /&gt;    Master_SSL_Cipher:&lt;br /&gt;&lt;br /&gt;       Master_SSL_Key:&lt;br /&gt;&lt;br /&gt;Seconds_Behind_Master: 0&lt;br /&gt;&lt;br /&gt;1 row in set (0.00 sec)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;mysql&amp;gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;As you see, both &lt;span class=&quot;system&quot;&gt;Slave_IO_Running&lt;/span&gt; and &lt;span class=&quot;system&quot;&gt;Slave_SQL_Running&lt;/span&gt; are set to &lt;span class=&quot;system&quot;&gt;Yes&lt;/span&gt; now.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Now leave the MySQL shell...&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mysql&amp;gt; quit;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;... and check the log again:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;grep mysql /var/log/syslog&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;system&quot;&gt;server1:/home/admin# grep mysql /var/log/syslog&lt;br /&gt;&lt;br /&gt;May 29 09:56:08 http2 mysqld[1380]: 080529 9:56:08 [ERROR] Slave: Error &#39;Table &#39;mydb.taggregate_temp_1212047760&#39; doesn&#39;t exist&#39; on query. Default database: &#39;mydb&#39;. Query: &#39;UPDATE thread AS thread,taggregate_temp_1212047760 AS aggregate&lt;br /&gt;&lt;br /&gt;May 29 09:56:08 http2 mysqld[1380]: ^ISET thread.views = thread.views + aggregate.views&lt;br /&gt;&lt;br /&gt;May 29 09:56:08 http2 mysqld[1380]: ^IWHERE thread.threadid = aggregate.threadid&#39;, Error_code: 1146&lt;br /&gt;&lt;br /&gt;May 29 09:56:08 http2 mysqld[1380]: 080529 9:56:08 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with &quot;SLAVE START&quot;. We stopped at log &#39;mysql-bin.001079&#39; position 203015142&lt;br /&gt;&lt;br /&gt;May 29 11:42:13 http2 mysqld[1380]: 080529 11:42:13 [Note] Slave SQL thread initialized, starting replication in log &#39;mysql-bin.001079&#39; at position 203015142, relay log &#39;/var/lib/mysql/slave-relay.000130&#39; position: 100125935&lt;br /&gt;&lt;br /&gt;server1:/home/admin#&lt;/div&gt;&lt;br /&gt;&lt;div&gt;The last line says that replication has started again, and if you see no errors after that line, everything is ok.&lt;/div&gt;&lt;/span&gt;</description><link>http://linux-info-center.blogspot.com/2008/06/guide-fix-mysql-replication.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-7838350891971003898</guid><pubDate>Mon, 09 Jun 2008 16:05:00 +0000</pubDate><atom:updated>2008-07-30T01:34:13.089-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Mono</category><title>Using Mono To Set Up A Shockvoice Server</title><description>It is a step-by-step instructions on how to install Shockvoice on a Linux machine. Shockvoice is a voice-over-IP communication tool. This tool is slightly different in its characteristics. It is simply a code in C # and, therefore, works on almost any platform of interest, whether Windows, Unix, Macintosh or Solaris. The customer will only be available for Windows at first.&lt;br /&gt;&lt;br /&gt;First you need the latest version. NET interpreter for&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;a target=&quot;_blank&quot; mce_real_href=&quot;http://www.go-mono.com/mono-downloads/download.html&quot; href=&quot;http://www.go-mono.com/mono-downloads/download.html&quot;&gt;http://www.go-mono.com/mono-downloads/download.html&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If your system is not listed you can download a complete binary package&lt;br /&gt;which can be found here:&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;a target=&quot;_blank&quot; mce_real_href=&quot;http://www.mono-project.com/Other_Downloads&quot; href=&quot;http://www.mono-project.com/Other_Downloads&quot;&gt;http://www.mono-project.com/Other_Downloads&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;In our case we will install Mono by using the packaged installer from&lt;br /&gt;this source:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;wget&lt;br /&gt;http://ftp.novell.com/pub/mono/archive/1.9.1/linux-installer/2/mono-1.9.1_2-installer.bin&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Make it executable:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;chmod +x mono-1.9.1_2-installer.bin&lt;/div&gt;&lt;br /&gt;&lt;div&gt;... and run it:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;./mono-1.9.1_2-installer.bin&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Follow the instructions on the screen. In our case we will install the&lt;br /&gt;binary to &lt;span class=&quot;system&quot;&gt;/opt&lt;/span&gt;. Once&lt;br /&gt;Mono is installed we need to get the latest server version of&lt;br /&gt;Shockvoice. Download the latest version from the Shockvoice&lt;br /&gt;downloadserver:&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;a target=&quot;_blank&quot; mce_real_href=&quot;http://www.shockvoice.net/downloads.php&quot; href=&quot;http://www.shockvoice.net/downloads.php&quot;&gt;http://www.shockvoice.net/downloads.php&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;&lt;div&gt;In our case we will download the Linux &lt;span class=&quot;system&quot;&gt;Server_v0.8.0pre2&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Create the directory where you want to install Shockvoice.&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mkdir -p /usr/share/shockvoice&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Download the package:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;wget&lt;br /&gt;ftp://ftp.shockvoice.org/shockvoice/0.8.x/svserver-0.8.0pre2-linux.tar.gz&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Unpack the package into the newly created directory:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;tar -C /usr/share/shockvoice -xvzf&lt;br /&gt;svserver-0.8.0pre2-linux.tar.gz&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Before we will run the &lt;span class=&quot;system&quot;&gt;install.sh&lt;/span&gt; script, we have to choose our database type.&lt;br /&gt;In this example&lt;br /&gt;we choose MySQL as our favorite database. We have to do&lt;br /&gt;some stuff before that.&lt;br /&gt;If you want to use Sqlite as your favorite database you can have to use the&lt;br /&gt;&lt;span class=&quot;system&quot;&gt;shockvoice.s3db&lt;/span&gt; file as&lt;br /&gt;your database. Now set up the MySQL part. &lt;/div&gt;&lt;br /&gt;&lt;div&gt;Create the database:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mysql -uroot -p create shockvoice&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Now import the tables to the database.&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mysql -uroot -p shockvoice &amp;lt;&lt;br /&gt;/usr/share/shockvoice.mysql.sql&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Now we need to create a database user (we will name him svuser) and&lt;br /&gt;grant him permissions to use the shockvoice database.&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;mysql -uroot -p&lt;br /&gt;&lt;br /&gt;Enter Password:&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;GRANT USAGE ON shockvoice.* TO&lt;br /&gt;svuser@localhost&lt;br /&gt;IDENTIFIED BY &#39;&amp;lt;yourpassword&amp;gt;&#39;;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;GRANT ALL ON shockvoice.* TO&lt;br /&gt;svuser@localhost IDENTIFIED&lt;br /&gt;BY &quot;&amp;lt;yourpassword&amp;gt;&quot;;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;FLUSH PRIVILEGES;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Change to the directory and start the &lt;span class=&quot;system&quot;&gt;install.sh&lt;/span&gt;&lt;br /&gt;script.&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;cd /usr/share/shockvoice&lt;br /&gt;&amp;amp;&amp;amp; ./install.sh&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Follow the instructions on the screen.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span class=&quot;system&quot;&gt;This script will create and configure the service_start, service_stop&lt;br /&gt;and the config.xml file. It will try to locate the necessary files from your Mono installation. Please make sure you have mono installed before running this script.&lt;br /&gt;&lt;br /&gt;Continue? (y/n) &lt;/span&gt;&lt;span class=&quot;highlight&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;system&quot;&gt;&lt;br /&gt;&lt;br /&gt;Do you have unpacked Shockvoice in /usr/share/shockvoice? (y/n) &lt;/span&gt;&lt;span class=&quot;highlight&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;system&quot;&gt;&lt;br /&gt;&lt;br /&gt;Do you want to create the service_start and service_stop file?&lt;br /&gt;(recommend) (y/n) &lt;/span&gt;&lt;span class=&quot;highlight&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;system&quot;&gt;&lt;br /&gt;&lt;br /&gt;searching for mono...&lt;br /&gt;&lt;br /&gt;Found mono binary in /opt/mono-1.9/bin/mono .. good&lt;br /&gt;&lt;br /&gt;searching for mono-service.exe...&lt;br /&gt;&lt;br /&gt;Found mono-service.exe binary in&lt;br /&gt;/opt/mono-1.9/lib/mono/gac/mono-service/2.0.0.0__0738eb9f132ed756/mono-service.exe&lt;br /&gt;.. good&lt;br /&gt;&lt;br /&gt;Creating startscript&lt;br /&gt;&lt;br /&gt;Creating stopscript&lt;br /&gt;&lt;br /&gt;Do you want to create the config.xml file? (y/n) &lt;/span&gt;&lt;span class=&quot;highlight&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;system&quot;&gt;&lt;br /&gt;&lt;br /&gt;Creating config.xml&lt;br /&gt;&lt;br /&gt;Please enter type of database you want to use. (e.g. sqlite, mysql or&lt;br /&gt;postgres)&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;highlight&quot;&gt;&lt;br /&gt;mysql&lt;/span&gt;&lt;span class=&quot;system&quot;&gt;&lt;br /&gt;&lt;br /&gt;Please enter server which stores the database Shockvoice. (e.g.&lt;br /&gt;shockvoice.s3db for sqlite or localhost for mysql)&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;highlight&quot;&gt;&lt;br /&gt;localhost&lt;/span&gt;&lt;span class=&quot;system&quot;&gt;&lt;br /&gt;&lt;br /&gt;Please enter name of the database. (leave empty for sqlite)&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;highlight&quot;&gt;&lt;br /&gt;shockvoice&lt;/span&gt;&lt;span class=&quot;system&quot;&gt;&lt;br /&gt;&lt;br /&gt;Please enter username who connects to the database. (leave empty for&lt;br /&gt;sqlite)&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;highlight&quot;&gt;&lt;br /&gt;svuser&lt;/span&gt;&lt;span class=&quot;system&quot;&gt;&lt;br /&gt;&lt;br /&gt;Please enter password for database user. (leave empty for sqlite)&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;highlight&quot;&gt;&lt;br /&gt;&amp;lt;yourpassword&amp;gt;&lt;/span&gt;&lt;span class=&quot;system&quot;&gt;&lt;br /&gt;&lt;br /&gt;Database type: mysql&lt;br /&gt;&lt;br /&gt;Database server: localhost&lt;br /&gt;&lt;br /&gt;Database name: shockvoice&lt;br /&gt;&lt;br /&gt;Database user: svuser&lt;br /&gt;&lt;br /&gt;Database password: &amp;lt;yourpassword&amp;gt;&lt;br /&gt;&lt;br /&gt;Is this Correct? (y/n) &lt;/span&gt;&lt;span class=&quot;highlight&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;system&quot;&gt;&lt;br /&gt;&lt;br /&gt;Remember to setup the MySql database and User!&lt;br /&gt;&lt;br /&gt;Configfile created!&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;highlight&quot;&gt;Note: If you get an error like &#39;==:&lt;br /&gt;unexpected operator&#39; try changing the first line of the install.sh&lt;br /&gt;script to&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;divre&gt;#!/bin/bash&lt;/divre&gt;&lt;br /&gt;&lt;div&gt;The next thing we have&lt;br /&gt;to do is to copy the &lt;span class=&quot;system&quot;&gt;libMonoPosixHelper.so&lt;/span&gt;&lt;br /&gt;and &lt;span class=&quot;system&quot;&gt;libsvcodec.so&lt;/span&gt; to a&lt;br /&gt;location where Mono will find them. e.g. &lt;span class=&quot;system&quot;&gt;/usr/lib&lt;/span&gt;:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;cp libMonoPosixHelper.so libsvcodec.so&lt;br /&gt;/usr/lib&lt;/div&gt;&lt;br /&gt;&lt;div&gt;That&#39;s it. Now start the server with:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;./service_start&lt;/div&gt;&lt;/span&gt;</description><link>http://linux-info-center.blogspot.com/2008/06/using-mono-to-set-up-shockvoice-server.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-7752931257882908745</guid><pubDate>Sun, 08 Jun 2008 12:35:00 +0000</pubDate><atom:updated>2008-07-30T01:37:43.405-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Fedora</category><title>Fedora : mod_geoip For Apache2</title><description>The guide explains how to set up &lt;a href=&quot;http://www.maxmind.com/app/mod_geoip&quot;&gt;mod_geoip&lt;/a&gt; with Apache2 on a Fedora 9. mod_geoip looks up at the client IP address end-user. This allows you to redirect or prevent users based on their country. You can also use this technology for your &lt;a href=&quot;http://www.openx.org/&quot;&gt;Openx&lt;/a&gt; (formerly known as OpenAds or phpAdsNew) ad server to allow &lt;a href=&quot;http://en.wikipedia.org/wiki/Geo_targeting&quot;&gt;geographical targeting&lt;/a&gt;.&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;br /&gt;I&#39;m not issue any guarantee that it works for you!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;strong&gt;1 Preliminary Note&lt;/strong&gt;&lt;/b&gt;&lt;br /&gt;&lt;div&gt;I&#39;m assuming that you have a running Fedora 9 system with a working Apache2 + PHP&lt;/div&gt;&lt;br /&gt;&lt;b&gt;&lt;strong&gt;2 Installing mod_geoip&lt;/strong&gt;&lt;/b&gt;&lt;br /&gt;&lt;div&gt;To install mod_geoip, we simply run:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;yum install mod_geoip&lt;/div&gt;&lt;br /&gt;&lt;div&gt;You will then find the GeoIP database (&lt;span class=&quot;system&quot;&gt;GeoIP.dat&lt;/span&gt;) in the &lt;span class=&quot;system&quot;&gt;/usr/share/GeoIP&lt;/span&gt; directory. As the geographic allocation of IP addresses can change over time, it&#39;s a good idea to download the newest &lt;span class=&quot;system&quot;&gt;GeoIP.dat&lt;/span&gt; now:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;cd /usr/share/GeoIP/&lt;br /&gt;&lt;br /&gt;mv GeoIP.dat GeoIP.dat_orig&lt;br /&gt;&lt;br /&gt;wget http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz&lt;br /&gt;&lt;br /&gt;gunzip GeoIP.dat.gz&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Next we restart Apache:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;/etc/init.d/httpd restart&lt;/div&gt;&lt;br /&gt;&lt;div&gt;That&#39;s it already!&lt;/div&gt;&lt;br /&gt;&lt;b&gt;&lt;strong&gt;3 A Short Test&lt;/strong&gt;&lt;/b&gt;&lt;br /&gt;&lt;div&gt;To see if mod_geoip is working correctly, we can create a small PHP file in one of our web spaces (e.g. &lt;span class=&quot;system&quot;&gt;/var/www/html&lt;/span&gt;):&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;vi /var/www/html/geoiptest.php&lt;/div&gt;&lt;br /&gt;&lt;divre&gt;&amp;lt;?php&lt;br /&gt;print_r($_SERVER);&lt;br /&gt;?&amp;gt;&lt;/divre&gt;&lt;br /&gt;&lt;div&gt;Call that file in a browser, and it should display the &lt;span class=&quot;system&quot;&gt;SERVER&lt;/span&gt; array including values for &lt;span class=&quot;system&quot;&gt;GEOIP_COUNTRY_CODE&lt;/span&gt;, &lt;span class=&quot;system&quot;&gt;GEOIP_CONTINENT_CODE&lt;/span&gt;, and &lt;span class=&quot;system&quot;&gt;GEOIP_COUNTRY_NAME&lt;/span&gt; &lt;span class=&quot;highlight&quot;&gt;(make sure that you&#39;re calling the file from a public IP address, not a local one)&lt;/span&gt;.&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;system&quot;&gt;Array&lt;br /&gt;&lt;br /&gt;(&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;highlight&quot;&gt;[GEOIP_CONTINENT_CODE] =&amp;gt; EU&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;highlight&quot;&gt;[GEOIP_COUNTRY_CODE] =&amp;gt; DE&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;highlight&quot;&gt;[GEOIP_COUNTRY_NAME] =&amp;gt; Germany&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;[HTTP_HOST] =&amp;gt; 84.143.142.69&lt;br /&gt;&lt;br /&gt;[HTTP_USER_AGENT] =&amp;gt; Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14&lt;br /&gt;&lt;br /&gt;[HTTP_ACCEPT] =&amp;gt; text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5&lt;br /&gt;&lt;br /&gt;[HTTP_ACCEPT_LANGUAGE] =&amp;gt; en-us,en;q=0.5&lt;br /&gt;&lt;br /&gt;[HTTP_ACCEPT_ENCODING] =&amp;gt; gzip,deflate&lt;br /&gt;&lt;br /&gt;[HTTP_ACCEPT_CHARSET] =&amp;gt; ISO-8859-1,utf-8;q=0.7,*;q=0.7&lt;br /&gt;&lt;br /&gt;[HTTP_KEEP_ALIVE] =&amp;gt; 300&lt;br /&gt;&lt;br /&gt;[HTTP_CONNECTION] =&amp;gt; keep-alive&lt;br /&gt;&lt;br /&gt;[PATH] =&amp;gt; /sbin:/usr/sbin:/bin:/usr/bin&lt;br /&gt;&lt;br /&gt;[SERVER_SIGNATURE] =&amp;gt; &amp;lt;address&amp;gt;Apache/2.2.8 (Fedora) Server at 84.143.142.69 Port 80&amp;lt;/address&amp;gt;&lt;br /&gt;&lt;br /&gt;[SERVER_SOFTWARE] =&amp;gt; Apache/2.2.8 (Fedora)&lt;br /&gt;&lt;br /&gt;[SERVER_NAME] =&amp;gt; 84.143.142.69&lt;br /&gt;&lt;br /&gt;[SERVER_ADDR] =&amp;gt; 192.168.0.100&lt;br /&gt;&lt;br /&gt;[SERVER_PORT] =&amp;gt; 80&lt;br /&gt;&lt;br /&gt;[REMOTE_ADDR] =&amp;gt; 84.143.142.69&lt;br /&gt;&lt;br /&gt;[DOCUMENT_ROOT] =&amp;gt; /var/www/html&lt;br /&gt;&lt;br /&gt;[SERVER_ADMIN] =&amp;gt; root@localhost&lt;br /&gt;&lt;br /&gt;[SCRIPT_FILENAME] =&amp;gt; /var/www/html/geoiptest.php&lt;br /&gt;&lt;br /&gt;[REMOTE_PORT] =&amp;gt; 57421&lt;br /&gt;&lt;br /&gt;[GATEWAY_INTERFACE] =&amp;gt; CGI/1.1&lt;br /&gt;&lt;br /&gt;[SERVER_PROTOCOL] =&amp;gt; HTTP/1.1&lt;br /&gt;&lt;br /&gt;[REQUEST_METHOD] =&amp;gt; GET&lt;br /&gt;&lt;br /&gt;[QUERY_STRING] =&amp;gt;&lt;br /&gt;&lt;br /&gt;[REQUEST_URI] =&amp;gt; /geoiptest.php&lt;br /&gt;&lt;br /&gt;[SCRIPT_NAME] =&amp;gt; /geoiptest.php&lt;br /&gt;&lt;br /&gt;[PHP_SELF] =&amp;gt; /geoiptest.php&lt;br /&gt;&lt;br /&gt;[REQUEST_TIME] =&amp;gt; 1211819286&lt;br /&gt;&lt;br /&gt;)&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If you want to use Apache2 + mod_geoip for your OpenX ad server, make sure you select &lt;span class=&quot;system&quot;&gt;MaxMind mod_apache GeoIP&lt;/span&gt; under &lt;span class=&quot;system&quot;&gt;Settings &amp;gt; Main Settings &amp;gt; Geotargeting Settings&lt;/span&gt;:&lt;/div&gt;&lt;br /&gt;&lt;b&gt;&lt;strong&gt;4 Use Cases&lt;/strong&gt;&lt;/b&gt;&lt;br /&gt;&lt;div&gt;You can use mod_geoip to redirect or block/allow users based on their country. You can find some useful examples for this here: &lt;a href=&quot;http://www.maxmind.com/app/mod_geoip&quot; target=&quot;_blank&quot;&gt;http://www.maxmind.com/app/mod_geoip&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;b&gt;&lt;strong&gt;5 Links&lt;/strong&gt;&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;mod_geoip: &lt;a href=&quot;http://www.maxmind.com/app/mod_geoip&quot; target=&quot;_blank&quot;&gt;http://www.maxmind.com/app/mod_geoip&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Apache: &lt;a href=&quot;http://httpd.apache.org/&quot; target=&quot;_blank&quot;&gt;http://httpd.apache.org&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Fedora: &lt;a href=&quot;http://fedoraproject.org/&quot; target=&quot;_blank&quot;&gt;http://fedoraproject.org&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;/span&gt;</description><link>http://linux-info-center.blogspot.com/2008/06/fedora-modgeoip-for-apache2.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-7314753860754985437</guid><pubDate>Fri, 06 Jun 2008 02:23:00 +0000</pubDate><atom:updated>2008-07-30T04:59:41.809-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Fedora</category><title>Trick: Fedora 9 &quot;Sulphur&quot; - The Perfect Server</title><description>It is a detailed description on how to set up a server Fedora 9, which offers all services needed by ISPs and hosters: Apache web server (SSL compatible) with PHP5 and Ruby, server Postfix mail with SMTP AUTH and TLS, BIND DNS server, Proftpd FTP server, MySQL, dovecote POP3/IMAP, Quota, Firewall, etc. This tutorial is written for 32-bit version of Fedora 9, but should apply to 64-bit version with very few changes.&lt;br /&gt;&lt;br /&gt;I&#39;ll use the following software:&lt;br /&gt;&lt;br /&gt;      * Web Server: Apache 2.2.8&lt;br /&gt;      * PHP 5.2.5&lt;br /&gt;      * Ruby&lt;br /&gt;      * Server database: MySQL 5.0.51&lt;br /&gt;      * Mail Server: Postfix&lt;br /&gt;      * DNS: BIND9 (chroot)&lt;br /&gt;      * FTP server: proftpd&lt;br /&gt;      * POP3/IMAP server: dovecote&lt;br /&gt;      * Webalizer statistics for website&lt;br /&gt;&lt;br /&gt;In the end, you should have a system that works reliably, and if you want, you can install free control panel hosting &lt;a href=&quot;http://www.ispconfig.org/&quot;&gt;ISPConfig&lt;/a&gt; (ie, ISPConfig runs on it out of the box).&lt;br /&gt;&lt;br /&gt;Read more at &lt;a href=&quot;http://www.howtoforge.com/perfect-server-fedora9&quot;&gt;Howtoforge.com&lt;/a&gt;</description><link>http://linux-info-center.blogspot.com/2008/06/trick-fedora-9-sulphur-perfect-server.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-8706201140765855687</guid><pubDate>Fri, 06 Jun 2008 01:32:00 +0000</pubDate><atom:updated>2008-07-30T05:00:34.285-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Linux</category><title>Tip: Anatomy of &quot;SELinux&quot; or Security-Enhanced Linux</title><description>Linux ® has been described as one of the most secure operating systems available, but the National Security Agency (NSA) took Linux to the next level with the introduction of Security-Enhanced Linux (SELinux). SELinux takes the GNU / Linux operating system and extends it with a kernel and user space, changes to make bullet-proof. If you use a 2.6 kernel today, you might be surprised to know that you are using SELinux now! This article explores the ideas behind SELinux and how it is implemented.&lt;br /&gt;&lt;br /&gt;The public networks like the Internet are dangerous places. Anyone who has a computer connected to the Internet (even temporarily) understands these dangers. Hackers can exploit the insecurity to access a system, to obtain unauthorized access to information, repurpose or a computer to send spam or participate in attacks on other high-profile systems ( using the SYN flood, as part of a Distributed Denial of Service attacks).&lt;br /&gt;&lt;br /&gt;Read more at &lt;a href=&quot;http://www.ibm.com/developerworks/linux/library/l-selinux/?ca=dgr-lnxw16SELinuxAnat&amp;amp;S_TACT=105AGX59&amp;amp;S_CMP=GR&quot;&gt;IBM.com&lt;/a&gt;</description><link>http://linux-info-center.blogspot.com/2008/06/tip-anatomy-of-selinux-or-security.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-1636722617164210497</guid><pubDate>Wed, 04 Jun 2008 19:13:00 +0000</pubDate><atom:updated>2008-07-30T05:20:45.170-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Book Review</category><title>Book Review of &quot;C++ GUI Programming with Qt4&quot;</title><description>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqdvzORA4S1PNWizOBl3zP6x0VziW31jh4LsHbdY-c8mSemsAWtx4uXLVxBvU_4xCLjJvNBRuDNuZecMs0wy-0RRgSMQcGW08VC42Hth0P6GraXWzYTjV1KtScl_Q6GKjjrnWSEc5W01y_/s1600-h/c+plus+plus+gui+programming+with+qt4.jpg&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqdvzORA4S1PNWizOBl3zP6x0VziW31jh4LsHbdY-c8mSemsAWtx4uXLVxBvU_4xCLjJvNBRuDNuZecMs0wy-0RRgSMQcGW08VC42Hth0P6GraXWzYTjV1KtScl_Q6GKjjrnWSEc5W01y_/s320/c+plus+plus+gui+programming+with+qt4.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5208108336513748882&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Qt is a multi application development platform that is widely used for the development of a GUI and non-GUI programs. Among the most visible products that were developed using Qt are KDE, the Opera Web browser, Google Earth, Skype and Photoshop Elements to name a few. Some of the reasons relevant to the use of Qt are --&lt;br /&gt;&lt;br /&gt;Library Qt is published under a dual licensing business model means that you can develop open source or source applications closed. If you develop the first case, then you do not have to pay money for the use of the library.&lt;br /&gt;&lt;br /&gt;Two: It is truly multi platform - which filter through the fact that you can write code for your application in a platform - say Linux, then copy the code for Windows and recompile the code, without making any changes and that your application is guaranteed to run on Windows.&lt;br /&gt;&lt;br /&gt;Three: Mobile phone giant Nokia&#39;s recent acquisition of Trolltech certainly has infused fresh energy and magnitude in the future Qt The latest version of Qt namely version 4.3 has many improvements that make the development of GUI applications using this library for a joy for most C + + programmers.&lt;br /&gt;&lt;br /&gt;&quot;C + + GUI Programming with Qt4&quot; from Jasmin Blanchette and Mark Summerfield, published in the Prentice Hall Open source software development series is in its second edition. This book is presented as the &quot;official book of Trolltech Qt.&quot;&lt;br /&gt;&lt;br /&gt;The main objective of this book is to learn to write programs using graphical interface Qt4 and addresses the entry-level and advanced C + + programmer. Thus, he started on a curve, hand holding the reader of the first rudimentary steps in preparing a simple C + + GUI Qt4 program using. And on chapters gradually up steam and providing readers with complex scenarios such as creating plugins, 3D graphics, application script and more. Through the book, I did not feel like I&#39;ve been studying a framework rather I found the language used to explain things quite lucid, clear and interesting nonetheless.&lt;br /&gt;&lt;br /&gt;The book is divided into three parts. A new programmer in Qt find the first part really useful, as it covers the basic concepts and practices necessary for programming in Qt The second and third part of this book comprises 12 chapters and 7 respectively specialized subjects and can be read in any order. For example, if I want to build a GUI program that needs to connect to a database at the back, so I can immediately read chapter 13: &quot;Databases&quot;, this book provided I am aware of Part I of this book covers the basics of programming in Qt 4.&lt;br /&gt;&lt;br /&gt;The second edition of this book is based on the first edition and contains many changes. On the one hand, a couple of new chapters have been included as &quot;Look and Feel Personalize&quot; and &quot;Application Scripting.&quot; The book has been thoroughly revised to include changes incorporated in Qt 4.2 and 4.3 qt The original &quot;Graphics&quot; chapter has been divided into 2D and 3D graphics chapters respectively. The small chapter on Embedded programming has been expanded to include programming in Qtopia, which makes it not smaller.&lt;br /&gt;&lt;br /&gt;What I really liked this book is realistic examples which are used to introduce each Qt control or concept. There are many images scattered inside, impart visual appeal to the pound. Moreover, these images will hopefully give the reader an idea on how to design their software.&lt;br /&gt;&lt;br /&gt;Through this book, I find that the authors have explained the different scenarios of development programmes in Qt 4 overwhelming exhaustively, without a player. Each program is divided into digestible pieces of code with detailed explanation succeed. It is therefore very easy to understand what each line of code is doing.&lt;br /&gt;&lt;br /&gt;The appendices contain a new section namely &quot;Introduction to Qt Jambi.&quot; Qt Jambi is publishing Java application Qt development framework. Beyond that, there are of course other sections in the annex to the Qt installation, construction applications Qt and concise an article listing the main nuances of programming in C + + to Java and C # programmers.&lt;br /&gt;&lt;br /&gt;One thing I noticed is that the hard book, I received did not have a CD containing the Qt library, and FDI used for the design of your applications. Then again, you can always visit the Trolltech and obtain library Qt 4.3 and applications which is &lt;a href=&quot;http://trolltech.com/downloads/opensource&quot;&gt;available for free download&lt;/a&gt;. Even better, if you develop your Qt applications on Linux, it is very easy to install all necessary libraries based on the Linux distribution you use.&lt;br /&gt;&lt;br /&gt;On the whole, this is a great book not only for any newcomer in Qt but also for the programmer made Qt to use as a reference.&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;fullpost&quot;&gt;&lt;span style=&quot;color: rgb(255, 255, 255);font-size:130%;&quot; &gt;Book Specifications&lt;/span&gt;&lt;br /&gt;Name : &lt;span style=&quot;font-weight: bold;&quot;&gt;C++ GUI Programming with Qt4&lt;/span&gt; - &lt;span style=&quot;color: rgb(255, 255, 255);&quot;&gt;Second edition&lt;/span&gt;&lt;br /&gt;ISBN No :  0-13-235416-0&lt;br /&gt;Authors : &lt;span style=&quot;font-weight: bold;&quot;&gt;Jasmin Blanchette&lt;/span&gt;  &amp;amp;  &lt;span style=&quot;font-weight: bold;&quot;&gt;Mark Summerfield&lt;/span&gt;&lt;br /&gt;No of pages : 720&lt;br /&gt;Publisher : Prentice Hall&lt;br /&gt;Price : $ 59.99 (US), $ 65.99 (Canada)&lt;br /&gt;Rating : &lt;span style=&quot;font-weight: bold;&quot;&gt;9&lt;/span&gt;/10&lt;/span&gt;</description><link>http://linux-info-center.blogspot.com/2008/06/book-review-of-c-gui-programming-with.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqdvzORA4S1PNWizOBl3zP6x0VziW31jh4LsHbdY-c8mSemsAWtx4uXLVxBvU_4xCLjJvNBRuDNuZecMs0wy-0RRgSMQcGW08VC42Hth0P6GraXWzYTjV1KtScl_Q6GKjjrnWSEc5W01y_/s72-c/c+plus+plus+gui+programming+with+qt4.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-8692928192936563584</guid><pubDate>Wed, 04 Jun 2008 12:01:00 +0000</pubDate><atom:updated>2008-07-30T05:04:07.680-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Ubuntu</category><title>High Performance XEN On Ubuntu 8.04</title><description>This tutorial provides step-by-step instructions on how to install XEN on a Ubuntu 8.04 Server System amd64 without compromising on the disk I / O and network bandwidth. You can find all software used in the Ubuntu repositories, so no external files or source of compilation are needed.&lt;br /&gt;&lt;br /&gt;Xen is an open-source para-virtualization virtual machine monitor (WWW), or &quot;hypervisor&quot;, for the x86 processor architecture. Xen can run safely several VMs on a single physical system with near-Native Performance. Xen allows corporate quality functions, including:&lt;br /&gt;&lt;div&gt;- Virtual Machines with performance relatives of equipment.&lt;/div&gt;&lt;div&gt;- Live migration management VMs between physical hosts.&lt;/div&gt;&lt;div&gt;- Up to 32 virtual processors by guest virtual machine, with VCPU hotplug.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;- x86/32, x86/32 with EAP, and x86/64 platform support.&lt;/div&gt;&lt;div&gt;- The virtualization technology Intel (VT-x) for unmodified guest operating systems (Microsoft Windows).&lt;br /&gt;&lt;/div&gt;&lt;div&gt;- The virtualization technology AMD (aka Pacifica SVM) on strengthening AM2 and F Opterons (2006H2)&lt;/div&gt;&lt;div&gt;- Excellent support equipment (supports almost all Linux device drivers).&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;&lt;strong&gt;1. Partition And Primary OS Installation &lt;/strong&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I will use Ubuntu Hardy Heron (x86_64) for the two host OS (dom0) and customers operating systems (Domu). Before that, you must have a ready target system partitions as in the following example:&lt;br /&gt;&lt;br /&gt;&lt;div&gt;For example, we have 120 gigabytes of disk space and we want to use 2 guest operating systems on:&lt;/div&gt;&lt;div&gt;- Take as the minimum required for host operating system (dom0), say 10-12GB =&gt; to create the first partition accordingly.&lt;/div&gt;&lt;div&gt;- We will divide the rest of the free space in 2 partitions, each for 2 guest OS (Domu) =&gt; to create the next two partitions accordingly.&lt;br /&gt;&lt;/div&gt;Install Ubuntu Hardy Heron (x86_64) Server Edition (http://www.ubuntu.com/products/whatisubuntu/serveredition) on the first score. Then, on this we will install Xen things and use what OS host (dom0). As a best practice, dom0 should not be used for any purpose in production, except for the control guest OS. While select &quot;ssh&quot; in the selection of packages during the OS installation.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;After the OS installation the first job is to update/upgrade the OS. Login to the system as root and type following commands:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# apt-get update&lt;br /&gt;&lt;br /&gt;# apt-get upgrade&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;b&gt;&lt;strong&gt;2. Host OS And Xen Installation&lt;/strong&gt;&lt;/b&gt;&lt;br /&gt;&lt;div&gt;To install Xen and all needed dependencies, all we have to do is run the following command:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# apt-get install ubuntu-xen-server&lt;/div&gt;&lt;br /&gt;&lt;div&gt;The &lt;span class=&quot;system&quot;&gt;ubuntu-xen-server&lt;/span&gt; package installs the Ubuntu kernel &lt;span class=&quot;system&quot;&gt;2.6.24-17-xen&lt;/span&gt; and other dependent xen packages.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Also upgrade the vi editor as follows:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# apt-get install vim &lt;/div&gt;&lt;br /&gt;&lt;div&gt;We also need to add the &lt;span class=&quot;system&quot;&gt;loop&lt;/span&gt; module to the kernel every time we boot our system, so we edit &lt;span class=&quot;system&quot;&gt;/etc/modules&lt;/span&gt;. If you already have a &lt;span class=&quot;system&quot;&gt;loop&lt;/span&gt; line in there, make it look like this, otherwise add it at the bottom of the file:  &lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# vi /etc/modules &lt;/div&gt;&lt;br /&gt;&lt;divre&gt;loop max_loop=64&lt;/divre&gt;&lt;br /&gt;&lt;div&gt;That&#39;s all. Now reboot the system. And after the reboot check the OS and xen service as follows:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# uname -a&lt;br /&gt;&lt;br /&gt;# xm list&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;b&gt;&lt;strong&gt;3 Creating Filesystem For Guest OS (&lt;span class=&quot;system&quot;&gt;domU&lt;/span&gt;)&lt;/strong&gt;&lt;/b&gt;&lt;br /&gt;&lt;div&gt;For the creation of domU we will be using &quot;&lt;b&gt;debootstrap&lt;/b&gt;&quot;. Here we will be using direct physical disk partitions and no filesystem images for better disk I/O for the guest OS. So format the partition for your filesystem choice. If you are interested in the xfs filesystem then you must install the &quot;xfsprogs&quot; package on dom0 like this:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# apt-get install xfsprogs&lt;/div&gt;class&lt;br /&gt;&lt;div&gt; To create a filesystem on the second partition we use the following command:&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If you are choosing ext3 then:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# mkfs.ext3 /dev/sda2&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If you are choosing  xfs then:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# mkfs.xfs /dev/sda2 &lt;/div&gt;&lt;br /&gt;&lt;div&gt;Post creation of filesystem in target partition mount it to &lt;span class=&quot;system&quot;&gt;/mnt&lt;/span&gt;:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# mount /dev/sda2 /mnt &lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;b&gt;&lt;strong&gt;4. Installing The Guest OS&lt;/strong&gt;&lt;/b&gt;&lt;br /&gt;&lt;div&gt;Install the base OS stuff in &lt;span class=&quot;system&quot;&gt;/mnt&lt;/span&gt; using &quot;debootstrap&quot;: &lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# debootstrap --arch amd64 hardy /mnt http://archive.ubuntu.com/ubuntu&lt;/div&gt;&lt;br /&gt;&lt;div&gt;This is going to take sometime depending on your Internet connection speed.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Once done, prepare the chroot environment for &lt;span class=&quot;system&quot;&gt;/mnt&lt;/span&gt;:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# mount --bind /dev /mnt/dev&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# mount proc /mnt/proc -t proc&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# chroot /mnt /bin/bash &lt;/div&gt;&lt;br /&gt;&lt;div&gt;Open another terminal and copy a couple of files from dom0 to &lt;span class=&quot;system&quot;&gt;/mnt&lt;/span&gt;&#39;s respective folder:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# cp /etc/resolv.conf /mnt/etc/resolv.conf&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# cp /etc/network/interface /mnt/network/interface&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# cp /etc/apt/source.list /mnt/etc/apt/sources.list&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# cp -R /lib/modules/2.6.24-17-xen/* /mnt/lib/modules/2.6.24-17-xen/&lt;/div&gt;&lt;br /&gt;&lt;div&gt;(If the respective folder is not present, then please create it before copying.) &lt;/div&gt;&lt;br /&gt;&lt;div&gt;Now again from the domU chroot environment use the following commands:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# apt-get update&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# apt-get upgrade&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# apt-get install vim ssh&lt;/div&gt;&lt;br /&gt;&lt;div&gt;If you are using the xfs filesystem then also install &lt;span class=&quot;system&quot;&gt;xfsprogs&lt;/span&gt; as follows:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# apt-get install xfsprogs &lt;/div&gt;&lt;br /&gt;Update &lt;span class=&quot;system&quot;&gt;/etc/fstab&lt;/span&gt; as follows:&lt;br /&gt;&lt;div&gt;If you are using the ext3 filesystem then:&lt;/div&gt;&lt;br /&gt;&lt;divre&gt;/dev/hda1               /               ext3 defaults        1       2&lt;/divre&gt;&lt;br /&gt;&lt;div&gt;If you are using the xfs filesystem then:&lt;/div&gt;&lt;br /&gt;&lt;divre&gt;/dev/hda1               /               xfs defaults        1       2&lt;/divre&gt;&lt;br /&gt;&lt;div&gt;This is the minimal setup of the domU environment. Not set the root password as:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# passwd&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;It&#39;s going to prompt you for root&#39;s password, so provide some secret for it.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Now exit from the chroot environment:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# exit&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Now umount all partitions:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# umount  /mnt/dev /mnt/proc /mnt&lt;/div&gt;&lt;br /&gt;&lt;div&gt; &lt;/div&gt;&lt;br /&gt;&lt;b&gt;&lt;strong&gt;5. Creation Of Xen Config File&lt;/strong&gt;&lt;/b&gt;&lt;br /&gt;&lt;div&gt;Now create the first guest OS&#39;s xen config file named &lt;span class=&quot;system&quot;&gt;domu1.cfg&lt;/span&gt; in the &lt;span class=&quot;system&quot;&gt;/etc/xen/&lt;/span&gt; folder like this:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;vi /etc/xen/domu1.cfg &lt;/div&gt;&lt;br /&gt;&lt;divre&gt;kernel      = &#39;/boot/vmlinuz-2.6.24-17-xen&#39;&lt;br /&gt;ramdisk     = &#39;/boot/initrd.img-2.6.24-17-xen&#39;&lt;br /&gt;memory      = &#39;512&#39;&lt;br /&gt;#&lt;br /&gt;#  Disk device(s).&lt;br /&gt;#&lt;br /&gt;root        = &#39;/dev/hda1 ro&#39;&lt;br /&gt;disk        = [&lt;br /&gt;                &#39;phy:/dev/sda2,hda1,w&#39;,&lt;br /&gt;     ]&lt;br /&gt;#&lt;br /&gt;#  Hostname&lt;br /&gt;#&lt;br /&gt;name        = &#39;domu1&#39;&lt;br /&gt;#&lt;br /&gt;#  Networking&lt;br /&gt;#&lt;br /&gt;vif         = [ &#39;ip=192.168.1.102,mac=00:16:3E:62:DA:BB&#39; ]&lt;br /&gt;#&lt;br /&gt;#  Behaviour&lt;br /&gt;#&lt;br /&gt;on_poweroff = &#39;destroy&#39;&lt;br /&gt;on_reboot   = &#39;restart&#39;&lt;br /&gt;on_crash    = &#39;restart&#39;&lt;br /&gt;vcpus     = &#39;2&#39;&lt;br /&gt;extra = &#39;xencons=tty1&#39;&lt;/divre&gt;&lt;br /&gt;&lt;div&gt;You must use a free and different IP for each guest OS. &lt;/div&gt;&lt;br /&gt;&lt;div&gt;Then start the first domU like this:&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# xm create /etc/xen/domu1.cfg -c&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Log in using root and that&#39;s all... your first guest OS (domu1) is ready now.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;In dom0, to list running OS&#39;s, type: &lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;command&quot;&gt;# xm list &lt;/div&gt;&lt;br /&gt;&lt;div&gt;The steps  to create &lt;span class=&quot;system&quot;&gt;/dev/sda3&lt;/span&gt; for the second domU are similar...&lt;/div&gt;&lt;br /&gt;&lt;div&gt;The same steps can be followed for i386 also...&lt;/div&gt;</description><link>http://linux-info-center.blogspot.com/2008/06/high-performance-xen-on-ubuntu-804.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-6395168143772503177</guid><pubDate>Tue, 03 Jun 2008 17:58:00 +0000</pubDate><atom:updated>2008-07-30T05:05:33.932-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Oracle</category><title>Oracle - Free Linux DVD set</title><description>First, it was Ubuntu and now it is the turn of Oracle. That&#39;s right, here is a wonderful chance to get a DVD of Oracle Unbreakable Linux. Essentially Unbreakable Linux is Red Hat Enterprise Linux without the trademarks of Red Hat.&lt;br /&gt;&lt;br /&gt;Oracle Unbreakable Linux book claims enterprise-class support for Linux with Prime Minister backports, comprehensive management, the group of software, compensation, testing and more, all at a lower cost significantly.&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhszzc8QfdKoImGz-NTjR4KJYv2UhRbFMehlVlQMfqWczvb_puoCqrSewLEPpUd8FjuF2XFAwMnXK1Q18cLyTQ7S576vBpYjHdNeiqu3oVJZhyVV-_zxvB2ziIk6x9X09aCY_iKhN0nFgPH/s1600-h/create-new-account.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhszzc8QfdKoImGz-NTjR4KJYv2UhRbFMehlVlQMfqWczvb_puoCqrSewLEPpUd8FjuF2XFAwMnXK1Q18cLyTQ7S576vBpYjHdNeiqu3oVJZhyVV-_zxvB2ziIk6x9X09aCY_iKhN0nFgPH/s320/create-new-account.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5208088729988042610&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;font-weight: bold;font-size:85%;&quot; &gt;Figure 1. Enter Your Email&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiF-ES1LZudoJytau6gRv3XV6iku-YtPnqMOKO9zPrZUbzgMtZHbAqClshwjNhyphenhyphen1tnR3fXLkYbZVHKp55FhgVcGhfWh-NHoMGTe3UuemouNvnCVo6AyVQyizj37O2HshuBOXY_x3rq__SR_/s1600-h/create-new-account1.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiF-ES1LZudoJytau6gRv3XV6iku-YtPnqMOKO9zPrZUbzgMtZHbAqClshwjNhyphenhyphen1tnR3fXLkYbZVHKp55FhgVcGhfWh-NHoMGTe3UuemouNvnCVo6AyVQyizj37O2HshuBOXY_x3rq__SR_/s320/create-new-account1.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5208089674880847746&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Figure 2. Enter Your Contact Detail&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;/span&gt;To order your free DVD Oracle Unbreakable Linux with free delivery and all, &lt;a href=&quot;http://www.oracle.com/webapps/dialogue/dlgpage.jsp?p_ext=Y&amp;amp;p_dlg_id=5659298&amp;amp;src=5634329&amp;amp;Act=44&quot;&gt;visit this page&lt;/a&gt; and click on &quot;Sign Up&quot;. If this is your first visit to the site of Oracle, you must create an account Oracle. Next enter your shipping address, which is the address to which you wish to receive the DVD and click on &quot;Submit&quot;. That&#39;s it. Oracle will ship a new DVD Unbreakable Linux.&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://linux-info-center.blogspot.com/2008/06/oracle-free-linux-dvd-set.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhszzc8QfdKoImGz-NTjR4KJYv2UhRbFMehlVlQMfqWczvb_puoCqrSewLEPpUd8FjuF2XFAwMnXK1Q18cLyTQ7S576vBpYjHdNeiqu3oVJZhyVV-_zxvB2ziIk6x9X09aCY_iKhN0nFgPH/s72-c/create-new-account.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-7169323209181451575</guid><pubDate>Sun, 01 Jun 2008 15:24:00 +0000</pubDate><atom:updated>2008-07-30T05:07:31.426-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Linux</category><title>Screen for Power Session</title><description>&lt;p&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size:180%;&quot;&gt;S&lt;/span&gt;creen is a full-screen window manager of the console, which comes with every flavor of UNIX and Linux. He is best known for multiplexing a physical terminal between several processes. By using it, you can run any number of console-based applications within a single hotel.&lt;br /&gt;For example, suppose I want to launch the &#39;top&#39; to keep track of the system load, change my programming code and check my mail at the same time ... Usually, I must open at least 3 terminals to do that. But using the screen utility, I can run all these programs at the same time and physical terminal. Another feature of this wonderful utility is its ability to separate the terminal emulator program running, which ensures your work is in progress, even if you inadvertently close your window, or where you disconnect. After detaching, you can once again over the same session and resume control of the management jobs.&lt;br /&gt;Here how to use this utility. &lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;1)&lt;/span&gt; First open a terminal and type :&lt;br /&gt;&lt;pre&gt;$ &lt;span style=&quot;font-weight: bold;&quot;&gt;screen&lt;/span&gt;&lt;/pre&gt; &lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;2)&lt;/span&gt; Screen starts and creates a new single window with a shell, pretty much like what you had before. The path name of the shell is taken from the &lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;$SHELL&lt;/span&gt; variable. New windows can be created within the same physical terminal using the screen commands.&lt;br /&gt;&lt;/div&gt; &lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;3)&lt;/span&gt; Now that you have started &lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;screen &lt;/span&gt;in a terminal, suppose you want to run the &#39;&lt;span style=&quot;font-family:courier new;&quot;&gt;top&lt;/span&gt;&#39; program to check the System load and at the same time you want to compile a program too - Also you would like to switch between the two to see the progress made by both.&lt;br /&gt;&lt;/div&gt; For that, first execute the first program to be run (say &#39;&lt;span style=&quot;font-family:courier new;&quot;&gt;top&lt;/span&gt;&#39;). now &#39;&lt;span style=&quot;font-family:courier new;&quot;&gt;top&lt;/span&gt;&#39; will start in the terminal.&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Now open a new window in screen by pressing the &#39;&lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;[Ctrl + a]  c&lt;/span&gt;&#39; - which I will state as &#39;&lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;C-a c&lt;/span&gt;&#39; . This will create a new window in the same terminal. Here, you can give  commands to compile your program.&lt;br /&gt;&lt;/div&gt; &lt;div style=&quot;text-align: justify;&quot;&gt;In screen, each window is given a unique identifier. The first window is numbered &lt;span style=&quot;font-weight: bold;&quot;&gt;0&lt;/span&gt;, the next window is &lt;span style=&quot;font-weight: bold;&quot;&gt;1&lt;/span&gt; and so on. Now to switch between your &#39;&lt;span style=&quot;font-family:courier new;&quot;&gt;top&lt;/span&gt;&#39; and the compiling program, you can use the key &#39;&lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;C-a 0&lt;/span&gt;&#39; and &#39;&lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;C-a 1&lt;/span&gt;&#39; respectively.&lt;br /&gt;&lt;/div&gt; &lt;div style=&quot;text-align: justify;&quot;&gt;You can also associate names with each running window - use &#39;&lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;C-a A&lt;/span&gt;&#39; to give a name to the current window.&lt;br /&gt;&lt;/div&gt; &lt;div style=&quot;text-align: justify;&quot;&gt;Here are a few other commands that might come in handy while toggling between various running windows :&lt;br /&gt;&lt;/div&gt; &lt;ul&gt;   &lt;li&gt;&#39;&lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;C-a p&lt;/span&gt;&#39; and &#39;&lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;C-a n&lt;/span&gt;&#39; can be used to &lt;span style=&quot;font-weight: bold;&quot;&gt;switch to the next or previous window&lt;/span&gt; respectively.&lt;/li&gt;   &lt;li style=&quot;text-align: justify;&quot;&gt;&#39;&lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;C-a N&lt;/span&gt;&#39; - where&lt;span style=&quot;font-family:courier new;&quot;&gt; N&lt;/span&gt; is the number from 0 to 9, that can be used to &lt;span style=&quot;font-weight: bold;&quot;&gt;jump to the corresponding window&lt;/span&gt;.&lt;/li&gt;   &lt;li style=&quot;text-align: justify;&quot;&gt;&#39;&lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;C-a w&lt;/span&gt;&#39; &lt;span style=&quot;font-weight: bold;&quot;&gt;displays a list of all windows&lt;/span&gt;. The unique ID of each window with its name and running process is displayed, for each window. The current window is marked with an asterisk(&lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;*&lt;/span&gt;).&lt;/li&gt;   &lt;li style=&quot;text-align: justify;&quot;&gt;&#39;&lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;C-a k&lt;/span&gt;&#39;  - can be used to &lt;span style=&quot;font-weight: bold;&quot;&gt;kill the current window&lt;/span&gt;. You can also type &#39;&lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;exit&lt;/span&gt;&#39; to kill the current window. If no more windows are open, then screen exits. &#39;&lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;C-a \&lt;/span&gt;&#39; also does the same thing.&lt;/li&gt;   &lt;li style=&quot;text-align: justify;&quot;&gt;&#39;&lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;C-a d&lt;/span&gt;&#39; &lt;span style=&quot;font-weight: bold;&quot;&gt;- detaches the present screen session&lt;/span&gt;. You can also detach by closing the terminal running your screen utility. Though, this appears to close your terminal session, in reality this does not happen. It only unbinds your session from the current terminal. All the programs started under screen will still keep running.&lt;br /&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div style=&quot;text-align: justify;&quot;&gt;You can also log out from the machine and re-login. Then start any terminal session and type &#39;&lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;screen -r&lt;/span&gt;&#39; to once again be connected from where you left.&lt;br /&gt;&lt;/div&gt; &lt;div style=&quot;text-align: justify;&quot;&gt;In case, there were more than one screen sessions running on the machine, Screen prompts for a &lt;span style=&quot;font-weight: bold;font-family:courier new;&quot; &gt;host.tty.pid&lt;/span&gt;.&lt;br /&gt;&lt;/div&gt; &lt;div style=&quot;text-align: justify;&quot;&gt;For example, say I have two screen sessions. So when I type &#39;&lt;span style=&quot;font-family:courier new;&quot;&gt;screen -r&lt;/span&gt;&#39; command, it gives the following message:&lt;br /&gt;&lt;/div&gt; &lt;pre&gt;$ &lt;span style=&quot;font-weight: bold;&quot;&gt;screen -r&lt;/span&gt;&lt;br /&gt;There are several suitable screens on:&lt;br /&gt;2999.pts-6.localhost  (Detached)&lt;br /&gt;1920.PTS-6.localhost  (Detached)&lt;br /&gt;Type &lt;br /&gt;&quot;screen [-d] -r [pid].tty.host&quot; to resume one of them.&lt;/pre&gt; &lt;div style=&quot;text-align: justify;&quot;&gt;Choose the right tty.host to connect and you control your program. You can also share your screen session with others as the use of &lt;a href=&quot;http://www.realvnc.com/&quot;&gt;VNC&lt;/a&gt;. Imagine that you are having a problem with your code and you want to share with your boss which is located in another office. You can use the screen to share your session with your boss, and he can see what you are referring. The first user launches the screen in normal mode and executes the following ...&lt;/div&gt; &lt;pre&gt;User1:&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;[Ctrl-A]:multiuser on [RET]&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;[Ctrl-A]:acladd &lt;user2&gt;&lt;/user2&gt;&lt;/span&gt;&lt;/pre&gt;The second user starts a new screen session and connects it to the first session using ...&lt;br /&gt;&lt;pre&gt;User2:&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;screen -x &lt;user1&gt;&lt;/user1&gt;&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt; &lt;div style=&quot;text-align: justify;&quot;&gt;Screen website at &lt;a href=&quot;http://www.gnu.org/software/screen/screen.html&quot;&gt;Official Screen Home Page&lt;/a&gt;&lt;/div&gt;</description><link>http://linux-info-center.blogspot.com/2008/06/power-sessions-with-screen.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-528008343244561190</guid><pubDate>Thu, 29 May 2008 12:58:00 +0000</pubDate><atom:updated>2008-07-30T05:08:05.886-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">News</category><title>BBC take on the Open Source alternative</title><description>Of course, you know what open source and free software means. Or you would not visit this blog and reading his articles in the first place. But it is always nice to get the viewpoint of one of the main stream media. And if the media in question is the BBC, then it is all the more sweet.&lt;br /&gt;&lt;br /&gt;I was an avid fan of the technology of the BBC program called &quot;Click&quot; formerly known as the &quot;Click Online&quot;. In the last episode, Spencer Kelly - Click on the presenter shows you how to build a functional machine working for nothing. The BBC published an article by Kelly called &quot;Open Source alternative&quot; which gives an overview of how FOSS can enrich our lives for information zilch. The article also a short interview with Paul Allen who is the editor of Computer Active magazine.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://news.bbc.co.uk/2/hi/programmes/click_online/7404387.stm&quot;&gt;Read the article&lt;/a&gt; to bbc.co.uk.</description><link>http://linux-info-center.blogspot.com/2008/06/bbc-take-on-open-source-alternative.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-8870919157075241584</guid><pubDate>Thu, 29 May 2008 07:15:00 +0000</pubDate><atom:updated>2008-07-30T05:09:12.735-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tips</category><title>Only takes 15 seconds to Understanding XML</title><description>XML also known as Extensible Markup Language is a language created the structure, transporting and storing data or information. But who is the simplest explanation. In reality, there is still much to the semantics of XML. When you embark on the path to mastery of XML, you&#39;re still having terms such as XLink, naming, DTD, Schema, and so forth.&lt;br /&gt;&lt;br /&gt;To obtain a fair idea of what it means XML, &lt;a href=&quot;http://www.w3.org/XML/1999/XML-in-10-points.html&quot;&gt;see the following article explaining XML&lt;/a&gt; in 10 points. It took only 15 seconds to read the article. Put in a word, they are the main points without explanation -&lt;br /&gt;&lt;br /&gt;     1. XML is for structuring data&lt;br /&gt;     2. It looks a bit like HTML&lt;br /&gt;     3. It is text, but is not intended to be read&lt;br /&gt;     4. It is wordy by design&lt;br /&gt;     5. XML is a family of technologies&lt;br /&gt;     6. XML is new, but not that new&lt;br /&gt;     7. He led the HTML to XHTML&lt;br /&gt;     8. XML is modular&lt;br /&gt;     9. XML is the basis for RDF and the semantic web&lt;br /&gt;    10. It is without a licence, platform-independent and well supported.</description><link>http://linux-info-center.blogspot.com/2008/05/only-takes-15-seconds-to-understanding.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5209171088164792990.post-3669773318580880931</guid><pubDate>Wed, 28 May 2008 12:48:00 +0000</pubDate><atom:updated>2008-07-30T05:11:07.181-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Fedora</category><title>Fedora 9 code name &quot;sulphur&quot; released</title><description>There is still time for a major new version of Fedora Linux. The latest avatar of Fedora namely version 9 is the code name of sulphur. If you are bitten by the strange name of Fedora, then you should &lt;a href=&quot;http://fedoraproject.org/wiki/Releases/Names&quot;&gt;read this article&lt;/a&gt; to get a better perspective. So what is in store for all fans of Fedora? A number of things.&lt;br /&gt;&lt;br /&gt;To begin with, Fedora has obtained what is known as PackageKit. It is a cross distribution management solution packages with a complete backend Yum. Then, Fedora comes with the latest and greatest version Gnome Desktop namely 2.22. KDE 4.0.3 is also the repository and can be installed on the hard core fans of KDE. But the biggest news is that Fedora is now shipped with the Sun Java that Sun has released Java under an open source license. For the full set of features, &lt;a href=&quot;http://fedoraproject.org/wiki/Releases/9/ReleaseSummary&quot;&gt;read this article&lt;/a&gt; that explains all the features in more detail.&lt;br /&gt;&lt;br /&gt;And after reading the features, if you&#39;re quite excited (which you will be), then visit the &lt;a href=&quot;http://fedoraproject.org/get-fedora&quot;&gt;download page&lt;/a&gt; and start your download Linux distribution Fedora alias 9 sulphur.</description><link>http://linux-info-center.blogspot.com/2008/06/fedora-9-code-name-sulphur-released.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item></channel></rss>