<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Tony Bhimani's Blog</title>
	<atom:link href="http://www.tonybhimani.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tonybhimani.com</link>
	<description>Where I Share my Linux and Programming Experiences</description>
	<pubDate>Sun, 01 Jun 2008 02:48:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5</generator>
	<language>en</language>
			<item>
		<title>Dovecot IMAP SquirrelMail Cannot Append Error</title>
		<link>http://www.tonybhimani.com/2008/05/31/dovecot-imap-squirrelmail-cannot-append-error/</link>
		<comments>http://www.tonybhimani.com/2008/05/31/dovecot-imap-squirrelmail-cannot-append-error/#comments</comments>
		<pubDate>Sun, 01 Jun 2008 02:48:34 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
		
		<category><![CDATA[Dovecot]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[SquirrelMail]]></category>

		<category><![CDATA[IMAP]]></category>

		<guid isPermaLink="false">http://www.tonybhimani.com/?p=29</guid>
		<description><![CDATA[If you&#8217;re a user of SquirrelMail and Dovecot 1.x, you may run across this error &#8220;ERROR: Bad or malformed request.  Server responded: Error in IMAP command APPEND:&#8221; after sending a message. The composed email message still sends, but you get that annoying error. I don&#8217;t know exactly what caused it other than a possible [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re a user of SquirrelMail and Dovecot 1.x, you may run across this error &#8220;<strong>ERROR: Bad or malformed request.  Server responded: Error in IMAP command APPEND:</strong>&#8221; after sending a message. The composed email message still sends, but you get that annoying error. I don&#8217;t know exactly what caused it other than a possible Dovecot upgrade, but nevertheless, this is how to alter SquirrelMail to resolve the issue.</p>
<p>In the <em>functions</em> directory of your SquirrelMail install, open the <strong>imap_general.php</strong> file.</p>
<p>Alter the <strong>sqimap_append</strong> PHP function by commenting out the line that starts with the fputs function and type in the replacement so it reads as:</p>
<pre class="code">function sqimap_append ($imap_stream, $sent_folder, $length) {
//    fputs ($imap_stream, sqimap_session_id() . " APPEND \"$sent_folder\" (\\Seen) \{$length}\r\n");
    fputs ($imap_stream, sqimap_session_id() . " APPEND \"$sent_folder\" (\\Seen) {" . $length . "}\r\n");
    $tmp = fgets ($imap_stream, 1024);
    sqimap_append_checkresponse($tmp, $sent_folder);
}</pre>
<p>Save the changes and the problem should be solved. FYI: Upgrading to the latest version of SquirrelMail will resolve this issue as well, but applying this code change is less of a hassle.</p>
<p><strong>Fix Source:</strong> <a href="http://xmailforum.homelinux.net/index.php?showtopic=3023" title="XMail Forum -&gt; dovecot imap cannot append">XMail Forum -&gt; dovecot imap cannot append</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tonybhimani.com/2008/05/31/dovecot-imap-squirrelmail-cannot-append-error/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Problems upgrading old PEAR versions</title>
		<link>http://www.tonybhimani.com/2008/04/30/problems-upgrading-old-pear-versions/</link>
		<comments>http://www.tonybhimani.com/2008/04/30/problems-upgrading-old-pear-versions/#comments</comments>
		<pubDate>Thu, 01 May 2008 04:37:33 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[PEAR]]></category>

		<guid isPermaLink="false">http://www.tonybhimani.com/?p=28</guid>
		<description><![CDATA[On some old servers I&#8217;ve had problems upgrading PEAR. I don&#8217;t remember the exact error message but I used it for a quick Google search to find one solution. If you have problems upgrading old versions of PEAR, you can try these steps to force an upgrade from PEAR 1.3.2 and up.
You can use these [...]]]></description>
			<content:encoded><![CDATA[<p>On some old servers I&#8217;ve had problems upgrading PEAR. I don&#8217;t remember the exact error message but I used it for a quick Google search to find one solution. If you have problems upgrading old versions of PEAR, you can try these steps to force an upgrade from PEAR 1.3.2 and up.</p>
<p>You can use these commands to force the upgrade.</p>
<pre class="code">pear upgrade --force http://pear.php.net/get/Archive_Tar http://pear.php.net/get/XML_Parser http://pear.php.net/get/Console_Getopt-1.2.2
pear upgrade --force http://pear.php.net/get/PEAR-1.3.3 (use only if your PEAR is older than v1.3.3)
pear upgrade --force http://pear.php.net/get/PEAR-1.4.3
pear upgrade PEAR</pre>
<p>Here you can see the upgrade in action (fun fun fun).</p>
<pre class="code">[root@linux ~]# pear upgrade --force http://pear.php.net/get/Archive_Tar http://pear.php.net/get/XML_Parser http://pear.php.net/get/Console_Getopt-1.2.2
downloading Archive_Tar-1.3.2.tgz ...
Starting to download Archive_Tar-1.3.2.tgz (17,150 bytes)
......done: 17,150 bytes
WARNING: channel "pear.php.net" has updated its protocols, use "channel-update pear.php.net" to update
downloading XML_Parser-1.2.8.tgz ...
Starting to download XML_Parser-1.2.8.tgz (13,476 bytes)
...done: 13,476 bytes
downloading Console_Getopt-1.2.2.tgz ...
Starting to download Console_Getopt-1.2.2.tgz (4,252 bytes)
...done: 4,252 bytes
Did not download optional dependencies: pear/XML_RPC, use --alldeps to download automatically
warning: pear/PEAR dependency package "pear/Console_Getopt" downloaded version 1.2.2 is not the recommended version 1.2.3
downloading PEAR-1.7.1.tgz ...
Starting to download PEAR-1.7.1.tgz (302,377 bytes)
...done: 302,377 bytes
upgrade ok: channel://pear.php.net/PEAR-1.7.1
PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
upgrade ok: channel://pear.php.net/Console_Getopt-1.2.2
upgrade ok: channel://pear.php.net/XML_Parser-1.2.8
upgrade ok: channel://pear.php.net/Archive_Tar-1.3.2
To install use "pear install pear/PEAR#featurename"
[root@linux ~]# pear upgrade --force http://pear.php.net/get/PEAR-1.4.3
downloading PEAR-1.4.3.tgz ...
Starting to download PEAR-1.4.3.tgz (276,859 bytes)
.........................................................done: 276,859 bytes
WARNING: channel "pear.php.net" has updated its protocols, use "channel-update pear.php.net" to update
Did not download optional dependencies: pear/XML_RPC, use --alldeps to download automatically
downloading Console_Getopt-1.2.3.tgz ...
Starting to download Console_Getopt-1.2.3.tgz (4,011 bytes)
...done: 4,011 bytes
upgrade ok: channel://pear.php.net/Console_Getopt-1.2.3
upgrade ok: channel://pear.php.net/PEAR-1.4.3
PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: To install optional features use "pear install pear/PEAR#featurename"
[root@linux ~]# pear upgrade PEAR
WARNING: channel "pear.php.net" has updated its protocols, use "channel-update pear.php.net" to update
Did not download optional dependencies: pear/XML_RPC, use --alldeps to download automatically
downloading PEAR-1.7.1.tgz ...
Starting to download PEAR-1.7.1.tgz (302,377 bytes)
..............................................................done: 302,377 bytes
upgrade ok: channel://pear.php.net/PEAR-1.7.1
PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
To install use "pear install PEAR#featurename"</pre>
<p>This article is based entirely from this PEAR Bug posting:<br />
<a href="http://pear.php.net/bugs/bug.php?id=12990" title="PEAR :: Bug #12990 :: Issues with PEAR Upgrade News Item from 1/3/08">PEAR :: Bug #12990 :: Issues with PEAR Upgrade News Item from 1/3/08</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tonybhimani.com/2008/04/30/problems-upgrading-old-pear-versions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Creating Multi-Volume Archives and Checksums</title>
		<link>http://www.tonybhimani.com/2008/04/30/creating-multi-volume-archives-and-checksums/</link>
		<comments>http://www.tonybhimani.com/2008/04/30/creating-multi-volume-archives-and-checksums/#comments</comments>
		<pubDate>Thu, 01 May 2008 03:59:08 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
		
		<category><![CDATA[HOWTOs]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[cat]]></category>

		<category><![CDATA[Checksum]]></category>

		<category><![CDATA[gzip]]></category>

		<category><![CDATA[md5sum]]></category>

		<category><![CDATA[Multi-Volume]]></category>

		<category><![CDATA[sha1sum]]></category>

		<category><![CDATA[split]]></category>

		<category><![CDATA[tar]]></category>

		<category><![CDATA[Volume Archive]]></category>

		<guid isPermaLink="false">http://www.tonybhimani.com/?p=27</guid>
		<description><![CDATA[The goal of this article is to help you create multi-volume archives and generate checksums to validate integrity. Why? You have data larger than any single CD-R disc or DVD and you need to split it into pieces, or you have to transfer gigabytes of data over the net and would rather send smaller segments [...]]]></description>
			<content:encoded><![CDATA[<p>The goal of this article is to help you create multi-volume archives and generate checksums to validate integrity. Why? You have data larger than any single CD-R disc or DVD and you need to split it into pieces, or you have to transfer gigabytes of data over the net and would rather send smaller segments instead of a giant glob. As an example, I&#8217;ll create a multi-volume gzip archive of /home with a MD5 checksum using tar, gzip, split, and md5sum.</p>
<h3>Creating Volumes from your Data</h3>
<p>1. Create a single TAR archive of all your data using tar to preserve permissions, directory structures, etc.</p>
<pre class="code">[root@linux archive]# tar -cf home.tar /home
tar: Removing leading `/' from member names
[root@linux archive]# ls -la home.tar
-rw-r--r-- 1 root root 304220160 Apr 30 13:34 home.tar</pre>
<p>2. Compress your TAR archive using gzip (or any other compressing program of your choice).</p>
<pre class="code">[root@linux archive]# gzip home.tar
[root@linux archive]# ls -la home.tar.gz
-rw-r--r-- 1 root root 284859091 Apr 30 13:34 home.tar.gz</pre>
<p>3. Use the split command to chop the compressed archive into smaller segments (I&#8217;ll be using 100MB pieces).</p>
<pre class="code">[root@linux archive]# split -d -b100m home.tar.gz home.tar.gz.
[root@linux archive]# ls -la
total 556940
drwxr-xr-x 2 root root      4096 Apr 30 13:56 .
drwxr-x--- 6 root root      4096 Apr 30 13:31 ..
-rw-r--r-- 1 root root 284859091 Apr 30 13:34 home.tar.gz
-rw-r--r-- 1 root root 104857600 Apr 30 13:56 home.tar.gz.00
-rw-r--r-- 1 root root 104857600 Apr 30 13:56 home.tar.gz.01
-rw-r--r-- 1 root root  75143891 Apr 30 13:57 home.tar.gz.02</pre>
<p>4. Create a MD5 checksum (or a SHA1 checksum).</p>
<pre class="code">[root@linux archive]# md5sum home.tar.gz* > MD5SUM
[root@linux archive]# cat MD5SUM
cb16175f4acad02f977f74d5c142879b  home.tar.gz
33c745ca49ab6e63b727658ec148cf67  home.tar.gz.00
14e6952b632fbb7f4c0731067afdb46c  home.tar.gz.01
386655357f8553c7730fd792c22fde2a  home.tar.gz.02</pre>
<p>Same thing but creating a SHA1 checksum instead (you don&#8217;t need two checksums, I just illustrate to use both types &#8212; pick one).</p>
<pre class="code">[root@linux archive]# sha1sum home.tar.gz* > SHA1SUM
[root@linux archive]# cat SHA1SUM
3858b51622dc9135c192a7c98dec24ccd35c63d6  home.tar.gz
6bc12b26dc1388d70d1a7cc0290dc6c9e8e0f97e  home.tar.gz.00
0683a44538ac65330fe103440e4f2a4a3a652be5  home.tar.gz.01
eb0f65fd0f4b3d98221e3ae8600f1691b536ad1d  home.tar.gz.02</pre>
<h3>Restoring your Data from the Volumes</h3>
<p>You&#8217;ve burned or transferred your volumes and now want to restore them to the original. Here are the steps.</p>
<p>1. Verify the checksum against the volumes (ignore the error on the original file).</p>
<pre class="code">[root@linux resurrection]# md5sum --check MD5SUM
md5sum: home.tar.gz: No such file or directory
home.tar.gz: FAILED open or read
home.tar.gz.00: OK
home.tar.gz.01: OK
home.tar.gz.02: OK
md5sum: WARNING: 1 of 4 listed files could not be read</pre>
<p>Once again, same deal but with the SHA1SUM file.</p>
<pre class="code">[root@linux resurrection]# sha1sum --check SHA1SUM
sha1sum: home.tar.gz: No such file or directory
home.tar.gz: FAILED open or read
home.tar.gz.00: OK
home.tar.gz.01: OK
home.tar.gz.02: OK
sha1sum: WARNING: 1 of 4 listed files could not be read</pre>
<p>2. Join the volume pieces together using cat (after you finish you can validate the checksum *again* to see if the original file passes an integrity check).</p>
<pre class="code">[root@node2 resurrection]# cat home.tar.gz.* > home.tar.gz
[root@node2 resurrection]# ls -la home.tar.gz
-rw-r--r-- 1 root root 284859091 Apr 30 15:23 home.tar.gz</pre>
<p>3. Decompress and extract the tar.gz file contents and you&#8217;re done.</p>
<pre class="code">[root@linux resurrection]# tar zxvf home.tar.gz
<em>&#8230; verbose file list &#8230;</em>
[root@linux resurrection]# ls -la
total 556952
drwxr-xr-x 3 root root      4096 Apr 30 15:33 .
drwxr-x&#8212; 7 root root      4096 Apr 30 15:02 ..
drwxr-xr-x 4 root root      4096 Apr 30 13:06 home
-rw-r&#8211;r&#8211; 1 root root 284859091 Apr 30 15:23 home.tar.gz
-rw-r&#8211;r&#8211; 1 root root 104857600 Apr 30 15:04 home.tar.gz.00
-rw-r&#8211;r&#8211; 1 root root 104857600 Apr 30 15:04 home.tar.gz.01
-rw-r&#8211;r&#8211; 1 root root  75143891 Apr 30 15:04 home.tar.gz.02
-rw-r&#8211;r&#8211; 1 root root       193 Apr 30 15:05 MD5SUM
-rw-r&#8211;r&#8211; 1 root root       225 Apr 30 15:05 SHA1SUM</pre>
<p>Contents extracted and there is the <em>home</em> directory. The End.</p>
<p>I got the idea of using the split command from this post on the <a href="http://ubuntuforums.org/showthread.php?t=455033" title="Ubuntu Forum (how to create multi zip files)">Ubuntu Forum (how to create multi zip files)</a> because I couldn&#8217;t get tar or gzip to create multi-volume archives.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tonybhimani.com/2008/04/30/creating-multi-volume-archives-and-checksums/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Anti-Spam Techniques: DNSBL in Sendmail</title>
		<link>http://www.tonybhimani.com/2008/03/30/anti-spam-techniques-dnsbl-in-sendmail/</link>
		<comments>http://www.tonybhimani.com/2008/03/30/anti-spam-techniques-dnsbl-in-sendmail/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 03:27:04 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
		
		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Sendmail]]></category>

		<category><![CDATA[DNSBL]]></category>

		<category><![CDATA[MTA]]></category>

		<guid isPermaLink="false">http://www.tonybhimani.com/2008/03/30/anti-spam-techniques-dnsbl-in-sendmail/</guid>
		<description><![CDATA[This topic is nothing new as there are many tutorials out there covering it, but I figured I&#8217;d write a post for the hell of it. If you use Sendmail as your MTA and get vast amounts of spam you can try using DNSBL to cut the amount you receive by rejecting them at the [...]]]></description>
			<content:encoded><![CDATA[<p>This topic is nothing new as there are many tutorials out there covering it, but I figured I&#8217;d write a post for the hell of it. If you use Sendmail as your MTA and get vast amounts of spam you can try using <a href="http://en.wikipedia.org/wiki/DNSBL" title="Learn more about DNSBL on Wikipedia" target="_blank">DNSBL</a> to cut the amount you receive by rejecting them at the point of connection. This helps save on your bandwidth consumption by not accepting the full message and then sorting it later as spam or ham. I&#8217;ve had DNSBL implemented for quite some time and also use it in conjunction with MailScanner and Spamassassin to block and filter the thousands of junk messages my server is bombarded with daily. The amount of spam has been reduced significantly.</p>
<p>I don&#8217;t happen to know what versions of Sendmail started to include DNSBL as a feature, but if you have anything from version 8.12 or higher then you shouldn&#8217;t have any problems enabling DNSBL in the sendmail.mc file. For those of you using an older version of Sendmail, the <a href="http://dnsbl-milter.sourceforge.net/" title="dnsbl-milter - Sendmail DNSBL &amp; DNSWL milter" target="_blank">dnsbl-milter</a> project may be of interest to you.</p>
<p>To start using DNSBL, open your sendmail.mc file in a text editor.</p>
<pre class="code">[root@linux ~]# cd /etc/mail
[root@linux mail]# nano sendmail.mc</pre>
<p>You&#8217;ll need to acquire your list of DNSBL servers you want to use, but here is an example of a few that I use. You can add these files to the end of your sendmail.mc file.</p>
<pre class="code">FEATURE(`dnsbl', `bl.spamcop.net', `"Rejected - see http://spamcop.net/bl.shtml?"$&amp;{client_addr}')dnl
FEATURE(`dnsbl', `zen.spamhaus.org', `Rejected - see http://www.spamhaus.org/')dnl
FEATURE(`dnsbl', `dnsbl.sorbs.net', `Rejected - see http://www.sorbs.net/')dnl</pre>
<p>I use <a href="http://www.spamcop.net/" title="spamcop.net" target="_blank">SpamCop</a>, <a href="http://www.spamhaus.org/" title="The Spamhaus Project" target="_blank">Spamhaus</a>, and <a href="http://www.de.sorbs.net/" title="SORBS (Spam and Open-Relay Blocking System)" target="_blank">SORBS</a> to block most of the junk mail hitting my server. After you&#8217;ve added your changes, save your sendmail.mc file and rebuild it.</p>
<pre class="code">[root@linux mail]# make -C /etc/mail
make: Entering directory `/etc/mail'
make: Leaving directory `/etc/mail'
[root@linux mail]#</pre>
<p>Sendmail should automatically read in the changes therefore you won&#8217;t need to restart it. To verify that Sendmail DNSBL is working, check your maillog and look for lines like these.</p>
<pre class="code">[root@linux mail]# tail -n 100 /var/log/maillog
...
Mar 30 22:59:04 linux sendmail[7702]: ruleset=check_relay, arg1=72-249-20-190.adsl.terra.cl, arg2=127.0.0.11, relay=72-249-20-190.adsl.terra.cl [190.20.249.72], reject=553 5.3.0 Rejected - see http://www.spamhaus.org/
Mar 30 23:02:20 linux sendmail[7781]: ruleset=check_relay, arg1=[58.87.60.104], arg2=127.0.0.2, relay=nat1.hyundai.net [58.87.60.104] (may be forged), reject=553 5.3.0 Rejected - see http://spamcop.net/bl.shtml?58.87.60.104
Mar 30 23:04:33 linux sendmail[7808]: ruleset=check_relay, arg1=[200.78.212.70], arg2=127.0.0.2, relay=na-200-78-212-70.na.avantel.net.mx [200.78.212.70] (may be forged), reject=553 5.3.0 Rejected - see http://spamcop.net/bl.shtml?200.78.212.70
Mar 30 23:04:40 linux sendmail[7809]: ruleset=check_relay, arg1=[61.108.132.122], arg2=127.0.0.2, relay=[61.108.132.122], reject=553 5.3.0 Rejected - see http://spamcop.net/bl.shtml?61.108.132.122</pre>
<p>For a list of DNSBL servers you can use this site as a reference: <a href="http://spamlinks.net/filter-dnsbl-lists.htm" title="Spam Links - dns &amp; rhs blackhole lists" target="_blank">http://spamlinks.net/filter-dnsbl-lists.htm</a></p>
<p>Other Sources for DNSBL in Sendmail:<br />
<a href="http://www.sdsc.edu/~jeff/spam/Sendmail.html" title="Sendmail Configuration" target="_blank">Sendmail Configuration (8.11.6 specific)</a><br />
<a href="http://www.technoids.org/dnsbl.html" title="DNSBL: Configuring Sendmail for DNS-Based Blacklisting" target="_blank">DNSBL: Configuring Sendmail for DNS-Based Blacklisting</a></p>
<p>DNSBL for Other MTA&#8217;s:<br />
<a href="http://www.exim.org/howto/rbl.html" title="HOWTO - Using DNS Block Lists (DNSBLs)" target="_blank">HOWTO - Using DNS Block Lists (DNSBLs) (Exim)</a><br />
<a href="http://howtoforge.com/block_spam_at_mta_level_postfix" title="How To Block Spam Before It Enters The Server (Postfix)" target="_blank">How To Block Spam Before It Enters The Server (Postfix)</a><br />
<a href="http://www.greens.org/about/software/dnsbl.shtml" title="Protecting Qmail from known spam sources" target="_blank">Protecting Qmail from known spam sources</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tonybhimani.com/2008/03/30/anti-spam-techniques-dnsbl-in-sendmail/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Excluding Packages from Yum Updates</title>
		<link>http://www.tonybhimani.com/2008/03/30/excluding-packages-from-yum-updates/</link>
		<comments>http://www.tonybhimani.com/2008/03/30/excluding-packages-from-yum-updates/#comments</comments>
		<pubDate>Sun, 30 Mar 2008 23:19:28 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
		
		<category><![CDATA[CentOS]]></category>

		<category><![CDATA[Fedora]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Yum]]></category>

		<guid isPermaLink="false">http://www.tonybhimani.com/2008/03/30/excluding-packages-from-yum-updates/</guid>
		<description><![CDATA[There may be times when you may need to exclude packages from yum updates &#8212; e.g. package conflicts, etc. I always like to give an example of why I would do this or that, so for an example pertaining to excluding packages it&#8217;s as simple as something is installed and the RPM&#8217;s of that conflict [...]]]></description>
			<content:encoded><![CDATA[<p>There may be times when you may need to exclude packages from yum updates &#8212; e.g. package conflicts, etc. I always like to give an example of why I would do this or that, so for an example pertaining to excluding packages it&#8217;s as simple as something is installed and the RPM&#8217;s of that conflict with the RPM&#8217;s yum wants to install and yum won&#8217;t install them because it doesn&#8217;t want to break the system. This in turn can keep unrelated packages from installing and then it can become one big mess. Did that run-on sentence make any sense? Ok, this is it in action&#8230;</p>
<pre class="code">[root@linux ~]# yum update
fedora                    100% |=========================| 2.1 kB    00:00
primary.sqlite.bz2        100% |=========================| 3.8 MB    00:03
updates                   100% |=========================| 2.3 kB    00:00
primary.sqlite.bz2        100% |=========================| 2.4 MB    00:02
Setting up Update Process
Resolving Dependencies
--&gt; Running transaction check
---&gt; Package perl.i386 4:5.8.8-28.fc7 set to be updated
---&gt; Package perl-libs.i386 4:5.8.8-28.fc7 set to be updated
---&gt; Package perl-ExtUtils-MakeMaker.i386 0:6.30-28.fc7 set to be updated
---&gt; Package perl-CPAN.i386 0:1.76_02-28.fc7 set to be updated
---&gt; Package perl-ExtUtils-Embed.i386 0:1.26-28.fc7 set to be updated
---&gt; Package perl-Test-Simple.i386 0:0.62-28.fc7 set to be updated
---&gt; Package perl-devel.i386 4:5.8.8-28.fc7 set to be updated
---&gt; Package perl-Test-Harness.i386 0:2.56-28.fc7 set to be updated
filelists.sqlite.bz2      100% |=========================| 6.4 MB    00:05
filelists.sqlite.bz2      100% |=========================| 5.3 MB    00:04
--&gt; Finished Dependency Resolution

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Updating:
 perl                    i386       4:5.8.8-28.fc7   updates            10 M
 perl-CPAN               i386       1.76_02-28.fc7   updates           127 k
 perl-ExtUtils-Embed     i386       1.26-28.fc7      updates            34 k
 perl-ExtUtils-MakeMaker  i386       6.30-28.fc7      updates           288 k
 perl-Test-Harness       i386       2.56-28.fc7      updates            78 k
 perl-Test-Simple        i386       0.62-28.fc7      updates           109 k
 perl-devel              i386       4:5.8.8-28.fc7   updates           384 k
 perl-libs               i386       4:5.8.8-28.fc7   updates           567 k

Transaction Summary
=============================================================================
Install      0 Package(s)
Update       8 Package(s)
Remove       0 Package(s)

Total download size: 12 M
Is this ok [y/N]: y
Downloading Packages:
(1/8): perl-Test-Harness- 100% |=========================|  78 kB    00:00
(2/8): perl-devel-5.8.8-2 100% |=========================| 384 kB    00:00
(3/8): perl-Test-Simple-0 100% |=========================| 109 kB    00:00
(4/8): perl-ExtUtils-Embe 100% |=========================|  34 kB    00:00
(5/8): perl-CPAN-1.76_02- 100% |=========================| 127 kB    00:00
(6/8): perl-ExtUtils-Make 100% |=========================| 288 kB    00:00
(7/8): perl-libs-5.8.8-28 100% |=========================| 567 kB    00:00
(8/8): perl-5.8.8-28.fc7. 100% |=========================|  10 MB    00:09
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test

Transaction Check Error:
  file /usr/lib/perl5/5.8.8/i386-linux-thread-multi/auto/MIME/Base64/Base64.so from install of perl-5.8.8-28.fc7 conflicts with file from package perl-MIME-Base64-3.07-1
  file /usr/share/man/man3/MIME::Base64.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-MIME-Base64-3.07-1
  file /usr/share/man/man3/MIME::QuotedPrint.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-MIME-Base64-3.07-1
  file /usr/lib/perl5/5.8.8/Getopt/Long.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Getopt-Long-2.36-1
  file /usr/lib/perl5/5.8.8/newgetopt.pl from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Getopt-Long-2.36-1
  file /usr/share/man/man3/Getopt::Long.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Getopt-Long-2.36-1
  file /usr/lib/perl5/5.8.8/Math/BigFloat.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigInt-1.86-1
  file /usr/lib/perl5/5.8.8/Math/BigInt.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigInt-1.86-1
  file /usr/lib/perl5/5.8.8/Math/BigInt/Calc.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigInt-1.86-1
  file /usr/lib/perl5/5.8.8/Math/BigInt/CalcEmu.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigInt-1.86-1
  file /usr/share/man/man3/Math::BigFloat.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigInt-1.86-1
  file /usr/share/man/man3/Math::BigInt.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigInt-1.86-1
  file /usr/share/man/man3/Math::BigInt::Calc.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigInt-1.86-1
  file /usr/share/man/man3/Math::BigInt::CalcEmu.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigInt-1.86-1
  file /usr/lib/perl5/5.8.8/Math/BigRat.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigRat-0.19-1
  file /usr/share/man/man3/Math::BigRat.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Math-BigRat-0.19-1
  file /usr/lib/perl5/5.8.8/bigint.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-bignum-0.21-1
  file /usr/lib/perl5/5.8.8/bignum.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-bignum-0.21-1
  file /usr/lib/perl5/5.8.8/bigrat.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-bignum-0.21-1
  file /usr/share/man/man3/bigint.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-bignum-0.21-1
  file /usr/share/man/man3/bignum.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-bignum-0.21-1
  file /usr/share/man/man3/bigrat.3pm.gz from install of perl-5.8.8-28.fc7 conflicts with file from package perl-bignum-0.21-1
  file /usr/lib/perl5/5.8.8/i386-linux-thread-multi/Sys/Syslog.pm from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Sys-Syslog-0.18-1
  file /usr/lib/perl5/5.8.8/i386-linux-thread-multi/auto/Sys/Syslog/Syslog.so from install of perl-5.8.8-28.fc7 conflicts with file from package perl-Sys-Syslog-0.18-1

Error Summary
-------------

[root@linux ~]#</pre>
<p>I ran a yum update and a bunch of perl updates crapped out. MailScanner is the only application I installed that loaded a series of perl RPM dependencies, so it&#8217;s safe to assume that MailScanner is the culprit. With that said, I&#8217;ll get to the point of this post. If you have a similar problem with yum updates failing, you can exclude those updates.</p>
<p>For RedHat based systems (Fedora &amp; CentOS), you&#8217;ll want to edit the updates repository file.</p>
<pre class="code">[root@linux ~]# cd /etc/yum.repos.d/
[root@linux yum.repos.d]# ls
fedora-development.repo  fedora.repo  fedora-updates.repo  fedora-updates-testing.repo
[root@linux yum.repos.d]# nano fedora-updates.repo</pre>
<p>On my Fedora 7 system, the file I want to edit is fedora-updates.repo (your file name may be different depending on the distro and release you&#8217;re using).</p>
<p>In the updates section, add an exclude line like in the example below. I&#8217;m excluding all updates that begin with the word perl (note the wildcard *). To exclude more than one set, enter each package name on the same line and separate them with a space.</p>
<pre class="code">[updates]
name=Fedora $releasever - $basearch - Updates
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/updates/$releasever/$basearch/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&amp;arch=$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
<span style="background-color: #ffff00">exclude=perl*</span></pre>
<p>Now if I run the yum update, all packages beginning with &#8220;perl&#8221; should be excluded.</p>
<pre class="code">[root@linux yum.repos.d]# yum update
updates                   100% |=========================| 2.3 kB    00:00
<span style="background-color: #ffff00">Excluding Packages from Fedora 7 - i386 - Updates</span>
Finished
Setting up Update Process
No Packages marked for Update
[root@linux yum.repos.d]#</pre>
<p>Now we&#8217;re cool. If you didn&#8217;t know how to exclude packages from yum updates, well now you know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tonybhimani.com/2008/03/30/excluding-packages-from-yum-updates/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Creating Captcha Images with PHP and the GD Library</title>
		<link>http://www.tonybhimani.com/2008/02/01/creating-captcha-images-with-php-and-the-gd-library/</link>
		<comments>http://www.tonybhimani.com/2008/02/01/creating-captcha-images-with-php-and-the-gd-library/#comments</comments>
		<pubDate>Sat, 02 Feb 2008 06:34:01 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
		
		<category><![CDATA[HOWTOs]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[captcha]]></category>

		<category><![CDATA[gd]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[security images]]></category>

		<guid isPermaLink="false">http://www.tonybhimani.com/2008/02/01/creating-captcha-images-with-php-and-the-gd-library/</guid>
		<description><![CDATA[A long time ago I wrote some code to create captcha images using PHP. The goal was to create similar or exact representations of the captcha&#8217;s used on Yahoo&#8217;s Overture. I really don&#8217;t have an answer why I chose their style except that it&#8217;s possible I liked the way they looked. I am sharing this [...]]]></description>
			<content:encoded><![CDATA[<p>A long time ago I wrote some code to create <a href="http://en.wikipedia.org/wiki/Captcha" title="Captcha definition on Wikipedia" target="_blank">captcha</a> images using PHP. The goal was to create similar or exact representations of the captcha&#8217;s used on Yahoo&#8217;s Overture. I really don&#8217;t have an answer why I chose their style except that it&#8217;s possible I liked the way they looked. I am sharing this code for creating the images but it&#8217;s up to you to create some logic in applying their use with HTML forms (I&#8217;ll give some hints at the end of this post).</p>
<p>This is the code to create the image. It returns an image resource identifier.  Note the use of a custom TrueType font &#8212;  you&#8217;ll need to change that line to the path of a font on your system.</p>
<pre class="code">&lt;?php
// generate captcha image - returns image handle
function captcha_image($code_string, $img_width=150, $img_height=40) {
  // seed srand
  srand((double)microtime()*1000000);

  // create image
  $im = @imagecreate($img_width, $img_height) or die("Cannot Initialize new GD image stream");

  // security code
  $security_code = $code_string;

  // define font
  $font = "/usr/fonts/ttf/Georgia.ttf";

  // create some colors
  $black = imagecolorallocate($im, 0, 0, 0);
  $white = imagecolorallocate($im, 255, 255, 255);
  $grey = imagecolorallocate($im, 128, 128, 128);

  // randomness, we need lots of randomness <img src='http://www.tonybhimani.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
  // background color -&gt; 1=black, 2=white, 3=grey (more colors can be added)
  // lines -&gt; black bg (1=white or 2=grey), white bg (1=black or 2=grey), grey bg (black only)
  $randval = rand(1, 3);
  if ($randval == 1) {
    $bgcolor = $black;
    $fontcolor = $white;
    $linecolor = ((rand(0, 1) == 0) ? $black : $white);
  } elseif ($randval == 2) {
    $bgcolor = $white;
    $fontcolor = $black;
    $linecolor = ((rand(0, 1) == 0) ? $black : $white);
  } else {
    $bgcolor = $grey;
    $fontcolor = $black;
    $linecolor = ((rand(0, 1) == 0) ? $black : $grey);
  }

  // line positioning and increment
  $x_start = rand(0, 10);
  $x_size = rand(5, 10);
  $y_start = rand(0, 10);
  $y_size = rand(5, 10);

  // fill with background color
  imagefill($im, 0, 0, $bgcolor);

  // initial x position
  $font_x = 10;

  // write text
  for ($i = 0; $i &lt; strlen($security_code); $i++) {
    // font size -&gt; 20 to 35
    $font_size = rand(25, 35);
    // font angle -&gt; -20 to +20
    $font_angle = rand(0, 20);
    if ($font_angle != 0) { if (rand(0, 1) == 0) { $font_angle = -$fone_angle; } }
    // font y position -&gt; if font_size &lt;= 27 then 30 to 35, if font_size &gt; 27 then 30 to 35
    if ($font_size &lt;= 27) { $font_y = rand(25, 30); } else { $font_y = rand(30, 35); }
    // write the text
    imagettftext($im, $font_size, $font_angle, $font_x, $font_y, $fontcolor, $font, $security_code{$i});
    // one more time to make it bolder
    imagettftext($im, $font_size, $font_angle, $font_x+1, $font_y+1, $fontcolor, $font, $security_code{$i});
    // next font x position
    $font_x += ($font_size + 5);
  }

  // draw horizontal lines
  for ($y = $y_start; $y &lt; $img_height; $y += $y_size) {
    imageline($im, 0, $y, $img_width, $y, $linecolor);
  }
  // draw vertical lines
  for ($x = $x_start; $x &lt; $img_width; $x += $x_size) {
    imageline($im, $x, 0, $x, $img_height, $linecolor);
  }

  // return captcha image handle
  return $im;
}
?&gt;</pre>
<p>We need a method for generating random four character strings when the captcha is created and displayed to the user. This function will do the trick.</p>
<pre class="code">&lt;?php
function secret_key($length=4) {
  $salt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
  srand((double)microtime()*1000000);
  $i = 0;
  $skey = "";
  while ($i &lt; $length) {
    $num = rand() % strlen($salt);
    $tmp = substr($salt, $num, 1);
    $skey .= $tmp;
    $i++;
  }
  return $skey;
}
?&gt;</pre>
<p>With everything in place, we can generate the secret key, create the captcha, and finally display it to the user using this code.</p>
<pre class="code">&lt;?php
// set headers
header("Content-type: image/png");
header("Cache-Control: no-cache");
header("Pragma: no-cache");

// generate secret
$skey = secret_key();

// create captcha and output to browser as PNG image
$im = captcha_image($skey);
@imagepng($im);
@imagedestroy($im);
?&gt;</pre>
<p>Here is an example of the code in action. The style looks very similar to the images used on <a href="https://secure.overture.com/login.do" title="Yahoo's Overture" target="_blank">Yahoo&#8217;s Overture</a>.</p>
<p><strong><font size="+1">Captcha Demo »</font></strong>   <img src="http://www.tonybhimani.com/files/captcha/captcha.php" alt="Captcha" /></p>
<p>Now you know how to create a captcha, so what about verifying the input against the captcha value? This can be accomplished a variety of ways and everyone tends to have their preference.</p>
<ul>
<li>One method is to save the secret key in a session variable. As the image is created, store the key in a session variable and once the form is submitted, check the user&#8217;s value against the one stored in the session. If they match, proceed but if they fail, return an error and don&#8217;t process the form data.</li>
<li>If you don&#8217;t want to use sessions, you could try using temp files. Store the key in a temp file and pass some value as a query string identifying to the script that the key is in that file. Read in the key and <a href="http://www.php.net/manual/en/function.md5.php" title="PHP: md5 function reference" target="_blank">MD5</a> or <a href="http://www.php.net/manual/en/function.sha1.php" title="PHP: sha1 function reference" target="_blank">SHA1</a> crypt the key and save it in a hidden form field. When the form is submitted, compare the hashed key against the user input (which you will also hash). Process the form data if the keys match.</li>
</ul>
<p>You can download the provided source file. Use the PHP file as an image source in your HTML IMG tag.</p>
<pre class="code">&lt;img src="<span style="background-color: #ffff00">http://www.yourdomain.com/captcha.php</span>&#8220;&gt;</pre>
<p>Don&#8217;t forget to edit the path to the TrueType font you want to use in the <em>captcha_image</em> function. Failure to do so will lead to missing image characters.</p>
<p><strong>Source Files:</strong> <a href="http://www.tonybhimani.com/files/2008/02/captcha.zip" title="Captcha PHP Source Code">captcha.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tonybhimani.com/2008/02/01/creating-captcha-images-with-php-and-the-gd-library/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Domain Redirection using Apache mod_rewrite and .htaccess</title>
		<link>http://www.tonybhimani.com/2008/01/26/domain-redirection-using-apache-mod_rewrite-and-htaccess/</link>
		<comments>http://www.tonybhimani.com/2008/01/26/domain-redirection-using-apache-mod_rewrite-and-htaccess/#comments</comments>
		<pubDate>Sun, 27 Jan 2008 04:21:49 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[BIND]]></category>

		<category><![CDATA[HOWTOs]]></category>

		<category><![CDATA[domain redirection]]></category>

		<category><![CDATA[htaccess]]></category>

		<category><![CDATA[mod_rewrite]]></category>

		<category><![CDATA[URL rewrite]]></category>

		<guid isPermaLink="false">http://www.tonybhimani.com/2008/01/26/domain-redirection-using-apache-mod_rewrite-and-htaccess/</guid>
		<description><![CDATA[I recently acquired more XenoCafe domains (xenocafe.info, xenocafe.net, and xenocafe.org) and finally got around to adding them to my server. Instead of them being their own sites (well, point to my primary site,  but the URL in the browser address bar is taken over by the new domain name), I wanted them to redirect [...]]]></description>
			<content:encoded><![CDATA[<p>I recently acquired more XenoCafe domains (<a href="http://xenocafe.info/" title="XenoCafe Linux Tutorials for Beginners" target="_blank">xenocafe.info</a>, <a href="http://xenocafe.net/" title="XenoCafe Linux Tutorials for Beginners" target="_blank">xenocafe.net</a>, and <a href="http://xenocafe.org/" title="XenoCafe Linux Tutorials for Beginners" target="_blank">xenocafe.org</a>) and finally got around to adding them to my server. Instead of them being their own sites (well, point to my primary site,  but the URL in the browser address bar is taken over by the new domain name), I wanted them to redirect to my primary domain (<a href="http://xenocafe.com/" title="XenoCafe Linux Tutorials for Beginners" target="_blank">xenocafe.com</a>).</p>
<p>If you want to achieve the same effect, here is how I did it (to see it in action, click on the first three XenoCafe links above). All you need is Apache, mod_rewrite, and htaccess. I&#8217;m going to skip the step-by-step configuration stuff to cut down the length of this article. If you need help, you can register for an account and post a question to the comments section for this post.</p>
<p>In this mock setup, I&#8217;ll use 10.10.100.34 as the IP address of my web server, example.com as the primary domain I want to redirect to, and ourexamples.com as the domain I want to redirect from (to example.com). This is a three step process that involves creating the zone file(s), adding the redirect domains to your Apache httpd.conf VirtualHost configuration, and finally creating the htaccess mod_rewrite rules to redirect all requests for the new domains to your desired domain.</p>
<p><strong>Create a New Zone File for each Domain you Acquired</strong></p>
<p>The primary domain example.com already has a zone file and is a functioning web site, but for ourexamples.com to work we need to create a zone file for it. Here is an example (we only need the minimum - SOA, NS, and the host for web).</p>
<pre class="code">$TTL   21600
$ORIGIN ourexamples.com.
@       IN      SOA     ns1.example.com. hostmaster.example.com. (
                        2008012601      ; serial
                        3600            ; refresh
                        600             ; retry
                        86400           ; expiry
                        21600 )         ; minimum

        IN      NS      ns1.example.com.
        IN      NS      ns2.example.com.

        IN      A       10.10.100.34
www     IN      A       10.10.100.34</pre>
<p>Now reload the zone(s) for changes to take effect.</p>
<p><strong>Add the Redirect Domains to the Primary Domain&#8217;s VirtualHost Definition (using the ServerAlias directive)</strong></p>
<p>Edit your primary domain&#8217;s virtual host entry and add the new domain(s) using the <a href="http://httpd.apache.org/docs/2.0/mod/core.html#serveralias" title="Apache ServerAlias Directive" target="_blank">ServerAlias</a> directive. Below is an example of editing the example.com virtual host and adding the new redirection domain ourexamples.com (highlighted line).</p>
<pre class="code">&lt;VirtualHost *:80&gt;
    ServerAdmin hostmaster@example.com
    ServerName example.com
    ServerAlias www.example.com
    <span style="background-color: #ffff00">ServerAlias ourexamples.com www.ourexamples.com</span>
    DocumentRoot /web/example/html
    ScriptAlias /cgi-bin/ /web/example/html/cgi-bin/
    ErrorLog /web/example/logs/error_log
    CustomLog /web/example/logs/access_log combined
    &lt;Directory &#8220;/web/example/html&#8221;&gt;
        AllowOverride All
    &lt;/Directory&gt;
&lt;/VirtualHost&gt;</pre>
<p>Restart Apache to reload the virtual host changes. Next we&#8217;ll need to create the htaccess file to configure domain redirection.</p>
<p><strong>Using mod_rewrite to Redirect the Domain Requests</strong></p>
<p>If we were to stop here, the new domain would work, however there is no redirection to your primary domain name. It will simply use the same document root and serve the files without any changes to the URL in the browser address bar. If this is what you desire, then stop here, otherwise continue on to bounce all requests from ourexamples.com to example.com.</p>
<p>In the document root of where your HTML files are stored (where DocumentRoot points to in your Apache VirtualHost definition), create a .htaccess with a text editor. Here is the example.</p>
<pre class="code">&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule (.*) http://www.example.com/$1 [L,R=301]
&lt;/IfModule&gt;</pre>
<p>In short, what this code does is turn on mod_rewrite&#8217;s engine, check the HTTP host to see if it matches www.example.com and also checks for empty references; if either case is a yes it rewrites the URL to http://www.example.com using a permanent redirect (HTTP 301 Redirection header). The $1 appends any portion trailing the domain name from the original (directories and/or pages being accessed). This code also forces the &#8216;www&#8217; prefix on all requests &#8212; <em>http://example.com </em>=&gt;<em> http://www.example.com</em> and <em>http://ourexamples.com </em>=&gt;<em> http://www.example.com</em> and so on</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tonybhimani.com/2008/01/26/domain-redirection-using-apache-mod_rewrite-and-htaccess/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Openfire Jabber/XMPP Server on CentOS mini-Howto</title>
		<link>http://www.tonybhimani.com/2007/12/31/openfire-jabberxmpp-server-on-centos-mini-howto/</link>
		<comments>http://www.tonybhimani.com/2007/12/31/openfire-jabberxmpp-server-on-centos-mini-howto/#comments</comments>
		<pubDate>Tue, 01 Jan 2008 06:13:38 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
		
		<category><![CDATA[CentOS]]></category>

		<category><![CDATA[HOWTOs]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[jabber]]></category>

		<category><![CDATA[openfire]]></category>

		<category><![CDATA[xmpp]]></category>

		<guid isPermaLink="false">http://www.tonybhimani.com/2007/12/31/openfire-jabberxmpp-server-on-centos-mini-howto/</guid>
		<description><![CDATA[So you want to set up your own private chat network for friends or family, or maybe your company uses the major chat providers like AIM, Yahoo, MSN, or Google for interoffice communication, but you want more control and to keep the network traffic inside your LAN. Whatever your case may be, this guide will [...]]]></description>
			<content:encoded><![CDATA[<p>So you want to set up your own private chat network for friends or family, or maybe your company uses the major chat providers like AIM, Yahoo, MSN, or Google for interoffice communication, but you want more control and to keep the network traffic inside your LAN. Whatever your case may be, this guide will show you how to do it with Ignite Realtime&#8217;s Openfire Jabber Server for Linux.</p>
<p><strong>Before we get started&#8230;</strong></p>
<p>There are two preliminary steps to complete before we install Openfire. They aren&#8217;t essential to its functionality (you can skip them if you&#8217;d like), but they&#8217;ll make things easier when it comes to managing the administration for you and your users. Those two steps are setting up a DNS alias for the server host name and creating a MySQL database for the backend instead of using the included embedded database.</p>
<p><strong>» Create a DNS Host Name for your Jabber Server</strong></p>
<p>For this guide I&#8217;ll use the host name &#8216;jabber&#8217; for my Openfire server. I run my own DNS server so I&#8217;ll be editing my zone file to add the new alias. If you use a third party service for DNS on your domain then you should know how to add new aliases. If you don&#8217;t then you should consult their Support documentation for more information.</p>
<p>Open your zone file in a text editor and add your new alias. Yours may look something like this example when you&#8217;re done. The highlighted line is what I added.</p>
<pre class="code">$TTL    21600
$ORIGIN mydomain.com.

@       IN      SOA     ns1.my-name-server.com. admin.my-name-server.com. (
                        2007122301      ; serial
                        3600            ; refresh
                        600             ; retry
                        86400           ; expiry
                        21600 )         ; minimum

                IN      NS      ns1.my-name-server.com.
                IN      NS      ns2.my-name-server.com.

                IN      MX      10      mx1.my-mail-server.com.
                IN      MX      20      mx2.my-mail-server.com.

                IN      A       10.0.0.100

www             IN      A       10.0.0.100
ftp             IN      A       10.0.0.100
<span style="background-color: #ffff00">jabber          IN      A       10.0.0.100</span></pre>
<p>Save your changes, flush the cache and reload the zone.</p>
<pre class="code">[root@node1 ~]# rndc flush
[root@node1 ~]# rndc reload</pre>
<p><strong>» Create the MySQL Database for Openfire Data</strong></p>
<p>Sometimes a tool like <a href="http://www.phpmyadmin.net/">phpMyAdmin</a> comes in handy for managing MySQL databases, however I don&#8217;t have it installed on this server. Instead I&#8217;ll be adding my Openfire database from the MySQL console. All we need to do is create the database, add an user account that has full control over that database, and reload (flush) the privileges.</p>
<pre class="code">[root@node1 ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 3 to server version: 5.0.22

Type 'help;' or 'h' for help. Type 'c' to clear the buffer.

mysql&gt; CREATE DATABASE `openfire`;
Query OK, 1 row affected (0.00 sec)

mysql&gt; CREATE USER 'openfire'@'localhost' IDENTIFIED BY 'password';
Query OK, 0 rows affected (0.01 sec)

mysql&gt; GRANT USAGE ON *.* TO 'openfire'@'localhost' IDENTIFIED BY 'password' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
Query OK, 0 rows affected (0.00 sec)

mysql&gt; GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON `openfire`.* TO 'openfire'@'localhost';
Query OK, 0 rows affected (0.01 sec)

mysql&gt; FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.02 sec)

mysql&gt; quit
Bye
[root@node1 ~]#</pre>
<p>Now that all the preliminaries are out of the way, we can move onto installing Openfire.</p>
<p><strong>Download and Install the Openfire Software</strong></p>
<p>Openfire can be downloaded from the <a href="http://www.igniterealtime.org/">Ignite Realtime</a> web site. As of this writing, the latest version available for download is <a href="http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire-3.4.2-1.i386.rpm">Openfire 3.4.2 for Linux</a>.</p>
<p>We&#8217;ll start by downloading the Openfire RPM via wget.</p>
<pre class="code">[root@node1 ~]# wget -O openfire-3.4.2-1.i386.rpm http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire-3.4.2-1.i386.rpm
--12:18:13-- http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire-3.4.2-1.i386.rpm
Resolving www.igniterealtime.org... 63.246.20.125
Connecting to www.igniterealtime.org|63.246.20.125|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 40451331 (39M) [application/x-rpm]
Saving to: `openfire-3.4.2-1.i386.rpm'

100%[=====================================================================&gt;] 40,451,331   368K/s   in 1m 52s

12:20:05 (354 KB/s) - `openfire-3.4.2-1.i386.rpm' saved [40451331/40451331]

[root@node1 ~]#</pre>
<p>Now install the RPM, start the Openfire service, verify it is actively running, and set it to auto-start whenever your server is rebooted.</p>
<pre class="code">[root@node1 ~]# rpm -ivh openfire-3.4.2-1.i386.rpm
Preparing...                ########################################### [100%]
   1:openfire               ########################################### [100%]
[root@node1 ~]# /etc/init.d/openfire start
Starting openfire:
[root@node1 ~]# ps -ef | grep -i openfire
root      2508     1  0 07:35 pts/0    00:00:00 su -s /bin/sh -c /opt/openfire/jre/bin/java -server  -DopenfireHome=/opt/openfire -Dopenfire.lib.dir=/opt/openfire/lib -classpath "/opt/openfire/lib/startup.jar" -jar "/opt/openfire/lib/startup.jar" daemon
daemon    2511  2508 37 07:35 ?        00:00:07 /opt/openfire/jre/bin/java -server -DopenfireHome=/opt/openfire -Dopenfire.lib.dir=/opt/openfire/lib -classpath /opt/openfire/lib/startup.jar -jar /opt/openfire/lib/startup.jar
root      2526  2414  1 07:35 pts/0    00:00:00 grep -i openfire
[root@node1 ~]# chkconfig --level 235 openfire on
[root@node1 ~]#</pre>
<p><strong>Open Ports in your Firewall</strong></p>
<p>If you have a firewall in place you&#8217;ll need to open some ports before we can start configuring Openfire through its web interface. Openfire uses ports 5222, 7777, 9090, 9091 for client connections, file transfer proxy, http web administration and the secured administration respectively. If you use iptables tables like I do, add these lines to your <em>/etc/sysconfig/iptables</em> rules file and reload. See my <a href="http://www.xenocafe.com/tutorials/linux/redhat/iptables/iptables_linux_redhat-part1.php" title="RedHat IPTables Tutorial on XenoCafe" target="_blank">RedHat IPTables Tutorial on XenoCafe</a> for more information on configuring iptables from the ground up.</p>
<pre class="code">-A INPUT -p tcp -i eth0 --dport 5222 -j ACCEPT
-A INPUT -p udp -i eth0 --dport 5222 -j ACCEPT
-A INPUT -p tcp -i eth0 --dport 7777 -j ACCEPT
-A INPUT -p udp -i eth0 --dport 7777 -j ACCEPT
-A INPUT -p tcp -i eth0 --dport 9090 -j ACCEPT
-A INPUT -p udp -i eth0 --dport 9090 -j ACCEPT
-A INPUT -p tcp -i eth0 --dport 9091 -j ACCEPT
-A INPUT -p udp -i eth0 --dport 9091 -j ACCEPT</pre>
<p>Then reload iptables to accept the new directives.</p>
<pre class="code">[root@node1 ~]# iptables-restore &lt; /etc/sysconfig/iptables</pre>
<p><strong>Configure Openfire through its Web Interface</strong></p>
<p>1. Launch your favorite browser and go to <em>http://your_jabber_server_ip_address:9090</em> or if you set up a DNS alias <em>http://jabber.mydomain.com:9090</em> to go to the Openfire web interface. You&#8217;ll be greeted by Openfire&#8217;s setup tool. In the first step, select your language. Here we choose English.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/language.jpg" title="Openfire Setup: Language Selection Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_language.jpg" alt="Openfire Setup: Language Selection Screen" border="0" height="261" width="425" /></a></p>
<p>2. The next step is to set the server domain. If you opted for an IP address name, enter your server&#8217;s IP. If you opted to create a DNS alias, enter the DNS server domain. Here we created jabber.mydomain.com so we&#8217;ll enter that. By default the Openfire web interface console ports are 9090 and 9091 for standard and secure respectively. You can use other ports if you wish (NOTE: you&#8217;ll have to change your firewall settings if you use different ports), but for this guide we&#8217;re sticking with the default values.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/server.jpg" title="Openfire Setup: Server Settings Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_server.jpg" alt="Openfire Setup: Server Settings Screen" border="0" height="187" width="425" /></a></p>
<p>3. You have two choices regarding which database to use for Openfire to store its data: an external database like MySQL, MSSQL, PostgreSQL, etc&#8230; or to use the bundled embedded database. If you setup a MySQL database like we did in this guide then select the Standard Database Connection option. If you didn&#8217;t, the only choice is to use the Embedded Database.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/database.jpg" title="Openfire Setup: Language Selection Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_database.jpg" alt="Openfire Setup: Database Settings Screen" border="0" height="200" width="425" /></a></p>
<p>4. To set up your database connection, select the appropriate driver from the Database Driver Presets list (we set up a MySQL database so we&#8217;ll select MySQL). The page will refresh and you need to fill in the necessary information (the database host, name, username, and password). You should have this information from when you setup your MySQL database. Per this guide, MySQL is on the same server as my Openfire installation (localhost) and I created a database called &#8216;openfire&#8217; with a username of &#8216;openfire&#8217; and set a password.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/dbsettings.jpg" title="Openfire Setup: Database Settings Configuration Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_dbsettings.jpg" alt="Openfire Setup: Database Settings Configuration Screen" border="0" height="319" width="425" /></a></p>
<p>5. The profile step has to do with the users and groups of chat members and where Openfire will store that information (new users, user groups, etc&#8230;). We won&#8217;t opt for LDAP to store this information. It is much more convenient to save it in our in our database.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/profile.jpg" title="Openfire Setup: Profile Settings Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_profile.jpg" alt="Openfire Setup: Profile Settings Configuration Screen" border="0" height="187" width="425" /></a></p>
<p>6. We&#8217;re almost done. Enter the administrator email address (your email address) and set a password for your Openfire server.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/admin.jpg" title="Openfire Setup: Admin Account Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_admin.jpg" alt="Openfire Setup: Admin Account Screen" border="0" height="204" width="425" /></a></p>
<p>7. Now you&#8217;re done! Pat yourself on the back. Click the <strong>Login to admin console</strong> button.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/setupcomplete.jpg" title="Openfire Setup: Setup Complete Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_setupcomplete.jpg" alt="Openfire Setup: Setup Complete Screen" border="0" height="276" width="425" /></a></p>
<p>8. Type in the Openfire admin password you entered in Step 6 and click the <strong>Login</strong> button.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/login.jpg" title="Openfire Setup: Admin Login Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_login.jpg" alt="Openfire Setup: Admin Login Screen" border="0" height="274" width="425" /></a></p>
<p>Welcome to the Openfire Administration Console. Take a look around and get familiar with the layout.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/console.jpg" title="Openfire: Administration Console Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_console.jpg" alt="Openfire: Administration Console Screen" border="0" height="309" width="425" /></a></p>
<p><strong>Time to Make Some Openfire Configuration Changes</strong></p>
<p>Your Openfire installation will work out of the box and you can skip this section if you want, but for this tutorial I wanted to make some changes. Namely, I want my server to follow some rules so there is no chaos.</p>
<ol>
<li>I don&#8217;t want any other servers to be able to communicate with mine (it&#8217;s private and self sufficient)</li>
<li>I define the member base so anonymous users cannot create accounts (ideal for an office environment)</li>
<li>Finally, all communication between clients and the server is encrypted (force jabber clients to use SSL)</li>
</ol>
<p>Follow along if you want to use any of these features or jump ahead to the <a href="#cugjc" title="Creating Users and Groups for Jabber Clients">Creating Users and Groups for Jabber Clients</a> section.</p>
<p>1. On the left under <strong>Server Settings</strong>, click the <strong>Server to Server</strong> link. In the top panel <strong>Service Enabled</strong>, choose the <strong>Disabled</strong> option and click <strong>Save Settings</strong>.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/srv2srv.jpg" title="Openfire: Administration Console 'Server to Server' Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_srv2srv.jpg" alt="Openfire: Administration Console 'Server to Server' Screen" border="0" height="191" width="425" /></a></p>
<p>2. Click the <strong>Registration &amp; Login</strong> link in the left side menu. Disable both options under <strong>Inband Account Registration</strong> and <strong>Anonymous Login</strong>. We&#8217;ll leave the <strong>Change Password</strong> option alone to let users update their passwords as they see fit. Click the <strong>Save Settings</strong> button at the bottom of the page.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/reglogin.jpg" title="Openfire: Administration Console 'Registration &amp; Login' Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_reglogin.jpg" alt="Openfire: Administration Console 'Registration &amp; Login' Screen" border="0" height="309" width="425" /></a></p>
<p>3. Click the <strong>Security Settings</strong> link on the left. Under <strong>Client Connection Security</strong>, choose the <strong>Required</strong> option to force jabber clients to use SSL (NOTE: If the client doesn&#8217;t support SSL and this option is enabled, the client will not be able to connect to the server). Click the <strong>Save Settings</strong> button.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/security.jpg" title="Openfire: Administration Console 'Security Settings' Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_security.jpg" alt="Openfire: Administration Console 'Security Settings' Screen" border="0" height="277" width="425" /></a></p>
<p><strong>Openfire SSL Certificates</strong></p>
<p>Openfire creates self-signed SSL Certificates by default. Remember the port 9091 from before? If you ever want to access this administration console from a Secure Connection, then you&#8217;ll need to restart the Openfire HTTP Server.</p>
<p>Click the <strong>Server Certificates</strong> link on the left menu.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/sslcerts.jpg" title="Openfire: Administration Console 'Server Certificates' Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_sslcerts.jpg" alt="Openfire: Administration Console 'Server Certificates' Screen" border="0" height="291" width="425" /></a></p>
<p>Click the link in the highlight section.</p>
<p><img src="http://www.tonybhimani.com/files/openfire_server/httprestart.jpg" alt="Openfire: HTTP Restart Link" border="0" height="20" width="425" /></p>
<p>Openfire will restart the HTTP Web Server and kick you back to the login screen. Log back in and the SSL Certificate should now be in use and you can access the console from SSL.</p>
<p><a title="cugjc" name="cugjc"></a><strong>Creating Users and Groups for Jabber Clients</strong></p>
<p>Since we&#8217;re creating a jabber server for a mock office environment, we prohibit anonymous users from creating accounts. Because of this, we will manage all users and groups on a global scale through our Openfire server. This means, all groups and users will be pushed to the clients that log in so they don&#8217;t have to add every single user account or group to their client. Also, any changes happen in real-time on the client (new users or groups added, removed, etc&#8230;). Kind of cool, huh? This is accomplished through Contact Group List Sharing.</p>
<p>We&#8217;ll be creating a mock Developer &#8220;Devel&#8221; group and add some users to it. Click on the <strong>Users/Groups</strong> tab on the top.</p>
<p>1. Go to <strong>Create New User</strong> under the <strong>Users</strong> section on the left. Fill in the <strong>Username</strong>, <strong>Password</strong>, and <strong>Confirm Password</strong>  fields and click the <strong>Create User</strong> button.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/newuser.jpg" title="Openfire: Administration Console 'Create New User' Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_newuser.jpg" alt="Openfire: Administration Console 'Create New User' Screen" border="0" height="292" width="425" /></a></p>
<p>Repeat this process to add all the users you want on your server.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/userprops.jpg" title="Openfire: Administration Console 'User Properties' Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_userprops.jpg" alt="Openfire: Administration Console 'User Properties' Screen" border="0" height="344" width="425" /></a></p>
<p>2. Go to <strong>Create New Group</strong> under the <strong>Groups</strong> section on the left. Fill in the <strong>Group Name</strong> and an optional <strong>Description</strong>. Click the <strong>Create Group</strong> button.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/newgroup.jpg" title="Openfire: Administration Console 'Create Group' Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_newgroup.jpg" alt="Openfire: Administration Console 'Create Group' Screen" border="0" height="283" width="425" /></a></p>
<p>3. The group has been added. Now we&#8217;ll share the contact list so it&#8217;s global to all jabber clients that connect to our server. Under the <strong>Contact List (Roster) Sharing</strong> section, click the <strong>Enable contact list group sharing</strong> option. In the name field, type in the same name as set for the group. Click the <strong>Save Contact List Settings</strong> button.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/editgroup.jpg" title="Openfire: Administration Console 'Edit Group' Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_editgroup.jpg" alt="Openfire: Administration Console 'Edit Group' Screen" border="0" height="261" width="425" /></a></p>
<p>4. Scroll down the page and type in an user name to the <strong>Add User</strong> field and click the <strong>Add</strong> button.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/addmembers.jpg" title="Openfire: Administration Console 'Members of This Group' Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_addmembers.jpg" alt="Openfire: Administration Console 'Members of This Group' Screen" border="0" height="110" width="425" /></a></p>
<p>Now we have one member in our group. Repeat this for each user you want assigned to this group.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/groupmembers.jpg" title="Openfire: Administration Console 'Members of This Group' Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_groupmembers.jpg" alt="Openfire: Administration Console 'Members of This Group' Screen" border="0" height="107" width="425" /></a></p>
<p><strong>Setting up a Jabber Client (Spark 2.5.8 for Windows)</strong></p>
<p>Our Openfire Jabber Server is useless unless we have clients connect to it and communicate through it. We&#8217;ll use <a href="http://www.igniterealtime.org/downloads/index.jsp" title="Spark Jabber Client" target="_blank">Spark </a>from Ignite Realtime. If that doesn&#8217;t suit you then you are open to use another jabber client since there are many of them out there (<a href="http://www.jabber.org/software/clients.shtml" title="Jabber Clients" target="_blank">see the client from jabber.org</a>).</p>
<p>1. Download <a href="http://www.igniterealtime.org/downloadServlet?filename=spark/spark_2_5_8.exe" title="Download Spark 2.5.8 for Windows">Spark</a>, install it, and launch it.</p>
<p>2. Type in your Openfire user credentials (<strong>Username</strong> and <strong>Password</strong>). In the <strong>Server</strong> field, type in the Openfire Servers IP address or DNS alias. Click the <strong>Login</strong> button.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/clientlogin.jpg" title="Spark: Client Login Screen" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_clientlogin.jpg" alt="Spark: Client Login Screen" border="0" height="348" width="425" /></a></p>
<p>3. The contact list will appear once you have successfully logged in. The shared group(s) will be visible (NOTE: groups with no online users will be hidden unless you select the <strong>Show empty groups</strong> option from the <strong>Contacts</strong> menu) along with the users of those groups. My contacts are not online as you can see from the picture below.</p>
<p><a href="http://www.tonybhimani.com/files/openfire_server/spark.jpg" title="Spark: Contact List Window" target="_blank"><img src="http://www.tonybhimani.com/files/openfire_server/small_spark.jpg" alt="Spark: Contact List Window" border="0" height="400" width="187" /></a></p>
<p>You&#8217;re done. You now have the essentials of configuring your own Jabber server and clients.</p>
<p>This is my last tutorial, guide, howto, whatever you want to call it for 2007. Happy New Year!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tonybhimani.com/2007/12/31/openfire-jabberxmpp-server-on-centos-mini-howto/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CentOS 5.1 Network Install Instructions</title>
		<link>http://www.tonybhimani.com/2007/12/20/centos-51-network-install-instructions/</link>
		<comments>http://www.tonybhimani.com/2007/12/20/centos-51-network-install-instructions/#comments</comments>
		<pubDate>Fri, 21 Dec 2007 05:56:08 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
		
		<category><![CDATA[CentOS]]></category>

		<category><![CDATA[HOWTOs]]></category>

		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.tonybhimani.com/2007/12/20/centos-51-network-install-instructions/</guid>
		<description><![CDATA[This is a simple guide to installing CentOS 5.1 via Network Install (netinstall). You can save yourself a lot of time by doing a network install and only installing the base packages rather than downloading a 3.6GB DVD ISO or the six CD-ROM images.
1. Start by downloading the small 7.3MB CentOS-5.1-i386-netinstall.iso image and burn it [...]]]></description>
			<content:encoded><![CDATA[<p>This is a simple guide to installing CentOS 5.1 via Network Install (netinstall). You can save yourself a lot of time by doing a network install and only installing the base packages rather than downloading a 3.6GB DVD ISO or the six CD-ROM images.</p>
<p>1. Start by downloading the small 7.3MB <a href="http://mirrors.kernel.org/centos/5.1/isos/i386/CentOS-5.1-i386-netinstall.iso">CentOS-5.1-i386-netinstall.iso</a> image and burn it to a disc. There&#8217;s also an x86_64 architecture image available that you can <a href="http://mirrors.kernel.org/centos/5.1/isos/x86_64/CentOS-5.1-x86_64-netinstall.iso">download</a> if that&#8217;s the type of hardware you&#8217;re using.</p>
<p>2. Boot up the designated CentOS PC with your netinstall disc and wait for it to get to boot screen.</p>
<p><a href="http://www.tonybhimani.com/files/centos_netinstall/boot.jpg" target="_blank"><img src="http://www.tonybhimani.com/files/centos_netinstall/small_boot.jpg" title="CentOS 5.1 Network Install Boot Screen" alt="CentOS 5.1 Network Install Boot Screen" border="0" height="319" width="425" /></a></p>
<p>Press <em>Enter</em> for the GUI install or type  <strong>linux text</strong> and press <em>Enter</em> for text mode installation.</p>
<p>3. Choose your language. The default selection is English.</p>
<p><a href="http://www.tonybhimani.com/files/centos_netinstall/language.jpg" target="_blank"><img src="http://www.tonybhimani.com/files/centos_netinstall/small_language.jpg" title="CentOS 5.1 Network Install Language Screen" alt="CentOS 5.1 Network Install Language Screen" border="0" height="266" width="425" /></a></p>
<p>Is English your primary language? It is for me.</p>
<p>4. Choose your keyboard type. The default is a US keyboard layout.</p>
<p><a href="http://www.tonybhimani.com/files/centos_netinstall/keyboard.jpg" target="_blank"><img src="http://www.tonybhimani.com/files/centos_netinstall/small_keyboard.jpg" title="CentOS 5.1 Network Install Keyboard Type Screen" alt="CentOS 5.1 Network Install Keyboard Type Screen" border="0" height="266" width="425" /></a></p>
<p>My keyboard is as basic as they come. So I&#8217;m choosing US.</p>
<p>5. Choose the installation method. For this guide I perform a HTTP install and get the packages from <a href="http://www.kernel.org/">kernel.org</a>.</p>
<p><a href="http://www.tonybhimani.com/files/centos_netinstall/installmethod.jpg" target="_blank"><img src="http://www.tonybhimani.com/files/centos_netinstall/small_installmethod.jpg" title="CentOS 5.1 Network Install Installation Method Screen" alt="CentOS 5.1 Network Install Installation Method Screen" border="0" height="266" width="425" /></a></p>
<p>6. Now it&#8217;s time to configure the TCP/IP settings. If you want to acquire an IP from a DHCP server or have no idea what your network settings are, then leave everything on the defaults. However, if you want to use a static IP and save yourself the trouble of editing <strong>/etc/sysconfig/network-scripts/ifcfg-eth0</strong> or running <strong>setup</strong> later, then choose <strong>Manual configuration</strong>. I don&#8217;t have an IPv6 network, so I&#8217;ll be using IPv4.</p>
<p><a href="http://www.tonybhimani.com/files/centos_netinstall/tcpip.jpg" target="_blank"><img src="http://www.tonybhimani.com/files/centos_netinstall/small_tcpip.jpg" title="CentOS 5.1 Network Install Configure TCP/IP Screen" alt="CentOS 5.1 Network Install Configure TCP/IP Screen" border="0" height="266" width="425" /></a></p>
<p>7. Skip this step if you chose DHCP. On this screen enter your network settings (IP address, subnet mask, default gateway, and a dns name server).</p>
<p><a href="http://www.tonybhimani.com/files/centos_netinstall/tcpip2.jpg" target="_blank"><img src="http://www.tonybhimani.com/files/centos_netinstall/small_tcpip2.jpg" title="CentOS 5.1 Network Install Manual TCP/IP Configuration Screen" alt="CentOS 5.1 Network Install Manual TCP/IP Configuration Screen" border="0" height="266" width="425" /></a></p>
<p>8. Enter the web server and directory path to the CentOS packages to get this installation started. I&#8217;ll be using the server mirrors.kernel.org. The directory path is centos/5.1/os/i386.</p>
<p><a href="http://www.tonybhimani.com/files/centos_netinstall/httpsetup.jpg" target="_blank"><img src="http://www.tonybhimani.com/files/centos_netinstall/small_httpsetup.jpg" title="CentOS 5.1 Network Install HTTP Setup Screen" alt="CentOS 5.1 Network Install HTTP Setup Screen" border="0" height="266" width="425" /></a></p>
<p>9. Go get something to drink. Retrieving the image may take a while.</p>
<p><a href="http://www.tonybhimani.com/files/centos_netinstall/retrieving.jpg" target="_blank"><img src="http://www.tonybhimani.com/files/centos_netinstall/small_retrieving.jpg" title="CentOS 5.1 Network Install Retrieving Image Screen" alt="CentOS 5.1 Network Install Retrieving Image Screen" border="0" height="266" width="425" /></a></p>
<p>10. Follow the rest of the prompts to install CentOS. It&#8217;s the same as if you&#8217;re doing it from DVD or CD&#8217;s, just takes longer because all packages are downloaded. So select your packages, set the root password, etc&#8230; The installation time will depend on how many packages you select.</p>
<p><a href="http://www.tonybhimani.com/files/centos_netinstall/welcome.jpg" target="_blank"><img src="http://www.tonybhimani.com/files/centos_netinstall/small_welcome.jpg" title="CentOS 5.1 Network Install Welcome to CentOS Screen" alt="CentOS 5.1 Network Install Welcome to CentOS Screen" border="0" height="266" width="425" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tonybhimani.com/2007/12/20/centos-51-network-install-instructions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>What happened to named.conf in ISC BIND DNS on Fedora 7?</title>
		<link>http://www.tonybhimani.com/2007/12/16/what-happened-to-namedconf-in-isc-bind-dns-on-fedora-7/</link>
		<comments>http://www.tonybhimani.com/2007/12/16/what-happened-to-namedconf-in-isc-bind-dns-on-fedora-7/#comments</comments>
		<pubDate>Mon, 17 Dec 2007 05:18:02 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
		
		<category><![CDATA[BIND]]></category>

		<category><![CDATA[Fedora]]></category>

		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.tonybhimani.com/2007/12/16/what-happened-to-namedconf-in-isc-bind-dns-on-fedora-7/</guid>
		<description><![CDATA[I&#8217;ve made the great leap this week by moving to a new colocation. This site and many others have moved to a new dedicated server because the old service I used provided by unnamed company was absolutely horrible. They boasted 99.99% uptime, HA! I was lucky to get 75% uptime out of those fools for [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made the great leap this week by moving to a new colocation. This site and many others have moved to a new dedicated server because the old service I used provided by <em>unnamed company</em> was absolutely horrible. They boasted 99.99% uptime, HA! I was lucky to get 75% uptime out of those fools for the year I was with them. Anyway&#8230;</p>
<p>The one thing I hate about moving is having to transfer gigs of data and reconfigure things. To cut it short, the old server was Fedora Core 4 and the new server is Fedora 7. Changes have been made between the three versions difference. One of these changes explains the title of this post. What happened to named.conf?</p>
<p>I checked the typical locations like <em>/etc</em> and <em>/var/named/chroot/etc</em> but it was nowhere to be found. I ran a <em>locate</em> and it didn&#8217;t exist. Thinking it was somewhat possible that maybe it was in a RPM I hadn&#8217;t installed, I checked the RPM list on a Fedora mirror site and compared those to the RPM&#8217;s I did have installed. No luck, everything was there.</p>
<p>I searched the net and didn&#8217;t find any reason for named.conf&#8217;s disappearance. I also discovered I wasn&#8217;t the only one seeking an explanation to its vanishing act. I came across a post on a forum mentioning the use of system-config-bind to create named.conf. A marvel idea, however it&#8217;s a GUI based tool and that leaves us text based users out in the cold &#8212; well sort of&#8230;</p>
<p>If you&#8217;re like me and want to set up a DNS Server on Fedora 7 to handle your zones, then follow these steps while as root.</p>
<p>1. Even though it&#8217;s a GUI dependent tool, install system-config-bind using yum. It contains template files you can use to get named up and running.</p>
<pre class="code">yum install system-config-bind</pre>
<p>2. The templates used by system-config-bind for generate named.conf and other essential files have been installed in  <em>/usr/share/system-config-bind/profiles/default</em>. We need to copy these files to where named would be expecting them (the assumption being that you&#8217;re running named in a chroot jail.</p>
<pre class="code">cd /usr/share/system-config-bind/profiles/default
cp -p named.conf /var/named/chroot/etc/
cp ./named/* /var/named/chroot/var/named/</pre>
<p>3. Now that named.conf is copied over we&#8217;ll need to make a change to the root hints file name. Right now our named.conf is looking for the file named.root instead of named.ca as in prior releases of bind. If you don&#8217;t make this change, named will fail to start and you&#8217;ll get an error like this in syslog <strong>named[20622]: could not configure root hints from &#8216;named.root&#8217;: file not found</strong>. Open named.conf in a text editor and look for this section (it should be right below <em>options</em>).</p>
<pre class="code">zone "." IN {
        type hint;
        file "<span style="background-color: yellow">named.root</span>&#8220;;
};</pre>
<p>Change named.root to named.ca and save your changes.</p>
<p>4. Create a symlink to named.conf in /etc (optional but suggested).</p>
<pre class="code">ln -s /var/named/chroot/etc/named.conf /etc/named.conf</pre>
<p>5. Start the named service and you&#8217;re good to go.</p>
<pre class="code">service named start</pre>
<p>Now go ahead and create your zone files and add their references to named.conf. See my <a href="http://www.xenocafe.com/tutorials/dns_linux/redhat/dns_linux_redhat-part2.php">RedHat Bind Tutorial on XenoCafe</a> for more information on DNS and Zones.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tonybhimani.com/2007/12/16/what-happened-to-namedconf-in-isc-bind-dns-on-fedora-7/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
