<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Technology: Learn and Share &#187; Redhat</title>
	<atom:link href="http://crazytoon.com/category/redhat/feed/" rel="self" type="application/rss+xml" />
	<link>http://crazytoon.com</link>
	<description>Enterprise level solutions, LAMP, Linux, Apache, MySQL, PHP, Perl, Windows, Cache, Optimization</description>
	<lastBuildDate>Fri, 16 Jul 2010 20:24:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>sshfs: How do you install sshfs and fuse? [CentOS/Linux/Redhat]</title>
		<link>http://crazytoon.com/2008/10/07/sshfs-how-do-you-install-sshfs-and-fuse-centoslinuxredhat/</link>
		<comments>http://crazytoon.com/2008/10/07/sshfs-how-do-you-install-sshfs-and-fuse-centoslinuxredhat/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 23:06:50 +0000</pubDate>
		<dc:creator>Sunny Walia</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Enterprise level solutions]]></category>
		<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[System admin]]></category>
		<category><![CDATA[fuse]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[sshfs]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=84</guid>
		<description><![CDATA[One may wonder what is sshfs and why would you want it?  Well simply put, sshfs allows you to mount another server&#8217;s filesystem into a folder on your local system which in the background is doing ssh commands and transfers.  As a mounted folder, you are able to move about and copy files back and [...]]]></description>
			<content:encoded><![CDATA[<p>One may wonder what is sshfs and why would you want it?  Well simply put, sshfs allows you to mount another server&#8217;s filesystem into a folder on your local system which in the background is doing ssh commands and transfers.  As a mounted folder, you are able to move about and copy files back and forth as everything was on local server.  As you can see this makes it very easy for you to work with files on multiple servers.</p>
<p><strong>Note</strong>:  you only have to do the following installations on the server where you are doing the mounts on.</p>
<p>Let us download and install the filesystem framework which is a requirement for sshfs called fuse.</p>
<p><code>wget http://voxel.dl.sourceforge.net/sourceforge/fuse/fuse-2.7.4.tar.gz<br />
tar zxpfv fuse-*.gz<br />
cd fuse*<br />
./configure</code></p>
<p>If you get the following error, you will either have to point to the location of the kernel source or install it if needed.</p>
<p><code>checking kernel source directory... Not found<br />
configure: error:<br />
*** Please specify the location of the kernel source with<br />
*** the '--with-kernel=SRCDIR' option<br />
configure: error: ./configure failed for kernel</code></p>
<p>In our case here, we will be installing the source using yum.</p>
<p><code>yum -y install kernel-devel</code></p>
<p>Once installed, you will have to find out the directory it is installed in</p>
<p><code>ls -l /usr/src/kernels/<br />
total 4.0K<br />
drwxr-xr-x 18 root root 4.0K Oct  7 14:50 <strong>2.6.18-92.1.13.el5-x86_64</strong>/</code></p>
<p><code>./configure --with-kernel=/usr/src/kernels/<strong>2.6.18-92.1.13.el5-x86_64</strong><br />
make &amp;&amp; make install<br />
cd ..</code></p>
<p>Now let us get sshfs source and install it.</p>
<p><code>wget http://voxel.dl.sourceforge.net/sourceforge/fuse/sshfs-fuse-2.1.tar.gz<br />
tar zxpfv sshfs*<br />
cd sshfs-fuse-*<br />
./configure</code></p>
<p>If you get the following error:</p>
<p><code>checking for SSHFS... configure: error: The pkg-config script could not be found or is too old.  Make sure it<br />
is in your PATH or set the PKG_CONFIG environment variable to the full<br />
path to pkg-config.</code></p>
<p>OR</p>
<p><code>checking for SSHFS... configure: error: Package requirements (fuse &gt;= 2.2 glib-2.0 gthread-2.0) were not met:</code></p>
<p>No package &#8216;glib-2.0&#8242; found<br />
No package &#8216;gthread-2.0&#8242; found</p>
<p>You need to install glib2.  Do the following:</p>
<p><code>yum install glib2-devel</code></p>
<p>Once installation is done, continue with configure.</p>
<p><code>./configure<br />
make &amp;&amp; make install</code></p>
<p>After installation is done, we can move on with testing the installation:</p>
<p><code>cd /mnt<br />
mkdir test<br />
sshfs 10.0.0.2:/ test</code></p>
<p>If you get the following error,<br />
<code>sshfs: error while loading shared libraries: libfuse.so.2: cannot open shared object file: No such file or directory</code><br />
execute this:  NOTE:  this is for x64 system.  If you have 32 bit system, you have to symlink to /lib instead.<br />
<code>ln -s /usr/local/lib/libfuse.so.2 /lib64/</code><br />
Let us try mounting again:<br />
<code>sshfs 10.0.0.2:/ test</code><br />
At this point it would be like if you were making a ssh connection to 10.0.0.2  You will have to type in a password to get the mount to happen.  You may get the following error:  <code>fuse: device not found, try 'modprobe fuse' first</code></p>
<p>If you do &#8216;modprobe fuse&#8217;, as they tell you to, and you get:<br />
<code>modprobe fuse<br />
FATAL: Module fuse not found.</code></p>
<p>That means your running kernel is not the same version as the one you compiled with.  You have two options here:<br />
1) you can upgrade your kernel by typing:  yum update kernel<br />
2) find the source files for the kernel you have running and recompile fuse.</p>
<p>I went with option 1.  Once you do the update, reboot and try doing <em>modprobe fuse</em> again.</p>
<p>At this point we can try doing the mount again.<br />
<code>cd /mnt<br />
sshfs 10.0.0.2:/ test</code></p>
<p>If you do not get any errors, do df -h to see the mount:<br />
<code>...<br />
sshfs#10.0.0.2:/  1000G     0 1000G   0% /mnt/test<br />
...</code></p>
<p>At this point you can browse 10.0.0.2 server filesystem as it was local on your server.</p>
<p>————————————-</p>
<p><small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/10/07/sshfs-how-do-you-install-sshfs-and-fuse-centoslinuxredhat/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Linux:  yum options you may not know exist.</title>
		<link>http://crazytoon.com/2008/06/16/linux-yum-options-you-may-not-know-exist/</link>
		<comments>http://crazytoon.com/2008/06/16/linux-yum-options-you-may-not-know-exist/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 15:18:17 +0000</pubDate>
		<dc:creator>Sunny Walia</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[System admin]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=85</guid>
		<description><![CDATA[Most of the users who work with distributions such as: centos, fedora, redhat, etc use yum as a package update/installer.  Most of them know how to do &#8220;yum update [packagename]&#8221; (to update all or [certain packages]) or they do &#8220;yum install packagename&#8221; to install certain package(s).  But yum can do so much more. [...]]]></description>
			<content:encoded><![CDATA[<p>Most of the users who work with distributions such as: centos, fedora, redhat, etc use yum as a package update/installer.  Most of them know how to do &#8220;yum update [packagename]&#8221; (to update all or [certain packages]) or they do &#8220;yum install packagename&#8221; to install certain package(s).  But yum can do so much more.  Here are some options you may find useful:</p>
<p>Following command will search for the string you specified.   Generally this will give you all of the packages which has specified string in title or description.  Most of the time you will have to look through a lot of output to find what you are looking for.</p>
<p><code>yum search string</code></p>
<p>Probably one of the most important options for yum is provides/whatprovides.  If you know what command you need, you can find out what package you have to install in order to have that command available to you.</p>
<p><code>yum provides (or whatprovides) command</code><br />
<code></code></p>
<p>Following command is same as above but with less output.</p>
<p><code> yum -d 1 provides command</code></p>
<p>So for example if you are trying to figure out what you need to install to use bunzip2, type:</p>
<p><code>yum -d 1 provides bunzip2</code></p>
<p>you will get a similar output as below.</p>
<p><code># yum -d 1 provides bunzip2<br />
bzip2.x86_64                             1.0.2-13.EL4.3         base<br />
bzip2.x86_64                             1.0.2-13.EL4.3         base<br />
man-pages-fr.noarch                      0.9.7-13.el4           base<br />
man-pages-ja.noarch                      20050215-2.EL4.3       base<br />
man-pages-pl.noarch                      0.23-5                 base</code></p>
<p>As you can see bunzip2 is part of bzip2 package.  So now you can you just install bzip2.x86_64 to get bunzip2.</p>
<p>To learn more about what else is available, <a title="man yum - man page for yum" href="http://www.lamp-tips.com/man-pages/yum/" target="_blank">read man yum</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/06/16/linux-yum-options-you-may-not-know-exist/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux:  How do you rename a user account in linux?</title>
		<link>http://crazytoon.com/2008/05/09/linux-how-do-you-rename-a-user-account-in-linux/</link>
		<comments>http://crazytoon.com/2008/05/09/linux-how-do-you-rename-a-user-account-in-linux/#comments</comments>
		<pubDate>Fri, 09 May 2008 11:13:19 +0000</pubDate>
		<dc:creator>Sunny Walia</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[System admin]]></category>

		<guid isPermaLink="false">http://crazytoon.com/?p=69</guid>
		<description><![CDATA[In Linux, there is no command which will rename a user account. If you make a mistake creating a user account, user changes their name or if user does not like his user name, there is no real easy way of going and making the change.  Only thing I know you can do is [...]]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration: line-through;">In Linux, there is no command which will rename a user account.</span> If you make a mistake creating a user account, user changes their name or if user does not like his user name, there is no real easy way of going and making the change.  Only thing I know you can do is to go through some files and rename user manually.  Let us say that we have a user who is named joe and we want to rename him to john.</p>
<p>Note:  you must be logged in as root to do following.</p>
<p>vi /etc/passwd<br />
find joe and change it to john, save/exit</p>
<p>vi /etc/group<br />
find joe and change it to john, save/exit</p>
<p>vi /etc/shadow<br />
find joe and change it to john.  This file is read only and you have to force overwrite it.  In vi it is :w!  once saved, quit.</p>
<p>cd /home<br />
mv joe john</p>
<p>And that should do the trick.</p>
<p>[Edited] Right after I posted this post, I was contacted and was told to look at utility called usermod.  Read more about it <a title="Man usermod:  man page for usermod" href="http://www.lamp-tips.com/man-pages/usermod/" target="_blank">man usermod</a>.  Got to love the quick responses.  </p>
<p>————————————-<br />
<small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/05/09/linux-how-do-you-rename-a-user-account-in-linux/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>MySQL: How do you set up master-master replication in MySQL? (CentOS, RHEL, Fedora)</title>
		<link>http://crazytoon.com/2008/02/29/mysql-how-do-you-set-up-mastermaster-replication-in-mysql-centos-rhel-fedora/</link>
		<comments>http://crazytoon.com/2008/02/29/mysql-how-do-you-set-up-mastermaster-replication-in-mysql-centos-rhel-fedora/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 21:40:02 +0000</pubDate>
		<dc:creator>Sunny Walia</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Enterprise level solutions]]></category>
		<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL cluster]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[System admin]]></category>

		<guid isPermaLink="false">http://crazytoon.com/2008/02/29/mysql-how-do-you-set-up-mastermaster-replication-in-mysql-centos-rhel-fedora/</guid>
		<description><![CDATA[Setting up master-master replication in MySQL is very similar to how we set up master/slave replication.  You can read up about how to setup master/slave replication in my previous post: How to set up master/slave replication in MySQL.  There is obviously pros and cons about using master/master replication.  But this is not [...]]]></description>
			<content:encoded><![CDATA[<p>Setting up master-master replication in MySQL is very similar to how we <a href="http://crazytoon.com/2008/01/29/mysql-how-do-you-set-up-masterslave-replication-in-mysql-centos-rhel-fedora/">set up master/slave replication</a>.  You can read up about how to setup master/slave replication in my previous post: <a href="http://crazytoon.com/2008/01/29/mysql-how-do-you-set-up-masterslave-replication-in-mysql-centos-rhel-fedora/" title="How to set up master/slave replication in MySQL" target="_blank">How to set up master/slave replication in MySQL</a>.  There is obviously pros and cons about using master/master replication.  But this is not a post which discuses advantages and disadvantages for using master/master replication. One of the differences between master/master set up and master/slave is that in master/master set up, you have true redundancy.  If one server dies, second server can take all the inserts/selects.  In master/slave setup, if master dies, you will have to go through steps to make slave become the master.  Master/master set up we are going to set up is essentially master/slave and slave/master.  Meaning, if you had two servers, db0 and db1, your setup will be db0(master)/db1(slave) and also db0(slave)/db1(master).  Here are some assumptions:</p>
<p><code>Master1 server ip:  10.0.0.1<br />
Master2 server ip:  10.0.0.2<br />
Slave username:  slaveuser<br />
Slave pw:  slavepw<br />
Your data directory is:  /usr/local/mysql/var/</code></p>
<p>Let us go through the steps you must take on Master1 to enable it to act as master and slave by using following configuration which goes  under [mysqld] section:</p>
<p><code># let's make it so auto increment columns behave by having different increments on both servers<br />
auto_increment_increment=2<br />
auto_increment_offset=1<br />
# Replication Master Server<br />
# binary logging is required for replication<br />
log-bin=master1-bin<br />
binlog-ignore-db=mysql<br />
binlog-ignore-db=test<br />
# required unique id between 1 and 2^32 - 1<br />
server-id       = 1<br />
#following is the slave settings so this server can connect to master2<br />
master-host = 10.0.0.2<br />
master-user = slaveuser<br />
master-password = slavepw<br />
master-port = 3306</code></p>
<p>Following is the configuration which goes on master2 under [mysqld] section:</p>
<p><code># let's make it so auto increment columns behave by having different increments on both servers<br />
auto_increment_increment=2<br />
auto_increment_offset=2<br />
# Replication Master Server<br />
# binary logging is required for replication<br />
log-bin=master2-bin<br />
binlog-ignore-db=mysql<br />
binlog-ignore-db=test<br />
# required unique id between 1 and 2^32 - 1<br />
server-id       = 2<br />
#following is the slave settings so this server can connect to master2<br />
master-host = 10.0.0.1<br />
master-user = slaveuser<br />
master-password = slavepw<br />
master-port = 3306</code></p>
<p>On master1 server, go to mysql&gt; prompt and add the appropriate user:</p>
<p><code>mysql&gt; grant replication slave on *.* to slaveuser@'10.0.0.2' identified by 'slavepw';</code></p>
<p>On master2 server do the same but allow right ip:</p>
<p><code>mysql&gt; grant replication slave on *.* to slaveuser@'10.0.0.1' identified by 'slavepw';</code></p>
<p>Restart both of the master servers and check slave status:</p>
<p><code>mysql&gt; show slave status\G</code></p>
<p>That is all you have to do to set up the replication.  Of course there are a lot more configuration options but this should get your replication going and you can tweak from here on.</p>
<p>————————————-<br />
<small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/02/29/mysql-how-do-you-set-up-mastermaster-replication-in-mysql-centos-rhel-fedora/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>MySQL:  How do you set up master-slave replication in MySQL? (CentOS, RHEL, Fedora)</title>
		<link>http://crazytoon.com/2008/01/29/mysql-how-do-you-set-up-masterslave-replication-in-mysql-centos-rhel-fedora/</link>
		<comments>http://crazytoon.com/2008/01/29/mysql-how-do-you-set-up-masterslave-replication-in-mysql-centos-rhel-fedora/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 03:12:57 +0000</pubDate>
		<dc:creator>Sunny Walia</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Data Backup]]></category>
		<category><![CDATA[Enterprise level solutions]]></category>
		<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL backup]]></category>
		<category><![CDATA[MySQL cluster]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[System admin]]></category>

		<guid isPermaLink="false">http://crazytoon.com/2008/01/29/mysql-how-do-you-set-up-masterslave-replication-in-mysql-centos-rhel-fedora/</guid>
		<description><![CDATA[Before we go into how to set up master-slave replication in MySQL, let us talk about some of the reasons I have set up master-slave replication using MySQL.
1)    Offload some of the queries from one server to another and spread the load:  One of the biggest advantages to have master-slave set [...]]]></description>
			<content:encoded><![CDATA[<p>Before we go into how to set up master-slave replication in MySQL, let us talk about some of the reasons I have set up master-slave replication using MySQL.</p>
<p>1)    Offload some of the queries from one server to another and spread the load:  One of the biggest advantages to have master-slave set up in MySQL is to be able to use master for all of the inserts and send some, if not all, select queries to slave.  This will most probably speed up your application without having to diving into optimizing all the queries or buying more hardware.</p>
<p>2)    Do backups from slave:  One of the advantages people overlook is that you can use MySQL slave to do backups from.  That way site is not affected at all when doing backups.  This becomes a big deal when your database has grown to multiple gigs and every time you do backups using mysqldump, site lags when table locks happen.  For some sites, this could mean that site goes down for few secs to minutes.  If you have slave, you just take slave out of rotation (should be built into code) and run backups off the slave.  You can even stop slave MySQL instance and copy the var folder instead of doing mysqldump.</p>
<p>Ok let us dive into how to setup master-slave replication under MySQL.  There are many configuration changes you can do to optimize your MySQL set up.  I will just touch on very basic ones to get the replication to work.  Here are some assumptions:</p>
<blockquote><p>Master server ip:  10.0.0.1<br />
Slave server ip:  10.0.0.2<br />
Slave username:  slaveuser<br />
Slave pw:  slavepw<br />
Your data directory is:  /usr/local/mysql/var/</p></blockquote>
<p>Put the following in your master my.cnf file under [mysqld] section:</p>
<p><code># changes made to do master<br />
server-id           = 1<br />
relay-log           = /usr/local/mysql/var/mysql-relay-bin<br />
relay-log-index     = /usr/local/mysql/var/mysql-relay-bin.index<br />
log-error           = /usr/local/mysql/var/mysql.err<br />
master-info-file    = /usr/local/mysql/var/mysql-master.info<br />
relay-log-info-file = /usr/local/mysql/var/mysql-relay-log.info<br />
datadir             = /usr/local/mysql/var<br />
log-bin             = /usr/local/mysql/var/mysql-bin<br />
# end master</code></p>
<p>Copy the following to slave&#8217;s my.cnf under [mysqld] section:</p>
<p><code># changes made to do slave<br />
server-id           = 2<br />
relay-log           = /usr/local/mysql/var/mysql-relay-bin<br />
relay-log-index     = /usr/local/mysql/var/mysql-relay-bin.index<br />
log-error           = /usr/local/mysql/var/mysql.err<br />
master-info-file    = /usr/local/mysql/var/mysql-master.info<br />
relay-log-info-file = /usr/local/mysql/var/mysql-relay-log.info<br />
datadir             = /usr/local/mysql/var<br />
# end slave setup</code></p>
<p>Create user on master:<br />
<code>mysql&gt; grant replication slave on *.* to slaveuser@'10.0.0.2' identified by 'slavepw';</code></p>
<p>Do a dump of data to move to slave<br />
<code>mysqldump -u root --all-databases --single-transaction --master-data=1 &gt; masterdump.sql</code></p>
<p>import dump on slave<br />
<code>mysql &lt; masterdump.sql</code></p>
<p>After dump is imported go in to mysql client by typing mysql.  Let us tell the slave which master to connect to and what login/password to use:<br />
<code>mysql&gt; CHANGE MASTER TO MASTER_HOST='10.0.0.1',  MASTER_USER='slaveuser', MASTER_PASSWORD='slavepw';</code></p>
<p>Let us start the slave:<br />
<code>mysql&gt; start slave;</code></p>
<p>You can check the status of the slave by typing<br />
<code>mysql&gt; show slave status\G</code></p>
<p>The last row tells you how many seconds its behind the master.  Don’t worry if it doesn’t say 0, the number should be going down over time until it catches up with master (at that time it will show Seconds_Behind_Master: 0)  If it shows NULL, it could be that slave is not started (you can start by typing:  start slave) or it could be that it ran into an error (shows up in Last_errno: and Last_error under show slave status\G).</p>
<p>Related posts:</p>
<ul>
<li><a href="http://crazytoon.com/2007/11/26/mysql-how-do-i-dump-all-tables-in-a-database-into-separate-files/" title="How do I dump all tables in a database into separate files?" target="_blank">How do I dump all tables in a database into separate files?</a></li>
<li><a href="http://crazytoon.com/2007/11/28/mysql-how-do-i-import-individual-table-dump-files-in-to-mysql-using-shell-script/" title="How do I import individual table dump files in to MySQL using shell script?" target="_blank">How do I import individual table dump files in to MySQL using shell script?</a></li>
<li><a href="http://crazytoon.com/2007/01/23/mysql-backups-using-mysqldump/" title="MySQL backups using mysqldump" target="_blank">MySQL backups using mysqldump</a></li>
</ul>
<p>————————————-<br />
<small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2008/01/29/mysql-how-do-you-set-up-masterslave-replication-in-mysql-centos-rhel-fedora/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>PHP:  How do I install phpsh, interactive shell prompt for php under CentOS or Fedora?</title>
		<link>http://crazytoon.com/2007/12/11/php-how-do-i-install-phpsh-interactive-shell-prompt-for-php-under-centos-or-fedora/</link>
		<comments>http://crazytoon.com/2007/12/11/php-how-do-i-install-phpsh-interactive-shell-prompt-for-php-under-centos-or-fedora/#comments</comments>
		<pubDate>Tue, 11 Dec 2007 08:26:48 +0000</pubDate>
		<dc:creator>Sunny Walia</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Enterprise level solutions]]></category>
		<category><![CDATA[Linux Apache MySQL PHP]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[System admin]]></category>

		<guid isPermaLink="false">http://crazytoon.com/2007/12/11/php-how-do-i-install-phpsh-interactive-shell-prompt-for-php-under-centos-or-fedora/</guid>
		<description><![CDATA[phpsh requires readline support built into python.  It also requires python version 2.4+. You can check which version of python you have installed by typing:
python -V
Let us download and install readline:
wget ftp://ftp.cwru.edu/pub/bash/readline-5.2.tar.gz
tar zxf readline-5.2.tar.gz
cd readline-5.2
./configure
make install
Now let us install python with readline support:

wget http://www.python.org/ftp/python/2.5.1/Python-2.5.1.tgz
tar zxf Python-2.5.1.tgz
cd Python-2.5.1

I had some problems on one of the [...]]]></description>
			<content:encoded><![CDATA[<p>phpsh requires readline support built into python.  It also requires python version 2.4+. You can check which version of python you have installed by typing:</p>
<p><code>python -V</code></p>
<p>Let us download and install readline:</p>
<p><code>wget ftp://ftp.cwru.edu/pub/bash/readline-5.2.tar.gz<br />
tar zxf readline-5.2.tar.gz<br />
cd readline-5.2<br />
./configure<br />
make install</code></p>
<p>Now let us install python with readline support:<br />
<code><br />
wget http://www.python.org/ftp/python/2.5.1/Python-2.5.1.tgz<br />
tar zxf Python-2.5.1.tgz<br />
cd Python-2.5.1<br />
</code></p>
<p>I had some problems on one of the servers where it would not compile readline support in to python.  I was able to compile reading support in to python by:</p>
<p><code>echo "readline readline.c -lreadline -ltermcap" &gt;&gt; Modules/Setup.local</code></p>
<p>Now let us continue with python installation.</p>
<p><code>./configure --prefix=/usr/local/python-2.5.1 --enable-readline<br />
make -i install</code></p>
<p>If you do not do &#8220;make -i install&#8221;, install may fail with following error (-i means ignore any errors):<br />
<code>Compiling /usr/lib/python2.5/zipfile.py ...<br />
make: *** [libinstall] Error 1</code></p>
<p>If you scroll up, you will find following error which seems to be the root cause:</p>
<p><code>Compiling /usr/lib/python2.5/test/test_multibytecodec.py ...<br />
Sorry: UnicodeError: ("\\N escapes not supported (can't load unicodedata module)",)</code></p>
<p>Once you do python install with make -i install, that library (unicodedata.so which is not built until later stage of build process) gets installed.  If you want, you can type make install once again (without ignoring errors) and it will complete without errors.</p>
<p>Once you have python installed, you would want to use the new version.  I like to keep a backup of old files in case I have to use older version for any reason.  Run following which creates symbolic links and makes backups of current files:</p>
<p><code>for binaries in `find /usr/local/python-2.5.1/bin/*` ; do<br />
mv /usr/bin/`basename ${binaries}` /usr/bin/`basename ${binaries}`.bak<br />
ln -s ${binaries} /usr/bin/`basename ${binaries}`<br />
done</code></p>
<p>Now let us get phpsh and try it out:</p>
<p><code>wget http://www.phpsh.org/phpsh-latest.tgz<br />
tar zxf phpsh-latest.tgz<br />
cd ../phpsh<br />
chmod +x phpsh<br />
./phpsh</code></p>
<p>At this point you should be at the shell:  php&gt;</p>
<p>Following is a snippet from README file which comes with phpsh.  You should take a look since it has more details on how to use phpsh:</p>
<p><code>Type php commands and they will be evaluated each time you hit enter. Ex:<br />
php&gt; $msg = "hello world"<br />
Put = at the beginning of a line as syntactic sugar for return. Ex:<br />
php&gt; = 2 + 2<br />
If you end a line with a backlash (\), you can enter multi-line input.<br />
For example,<br />
php&gt; print "like \<br />
... this"<br />
like   this<br />
php&gt;</code></p>
<p>There we go.  Now you have a great interactive php shell prompt.  Note that there is interactive mode built into php as well.  I personally do not like it as much but you can try it out for yourself by typing:</p>
<p><code>php -a<br />
Interactive mode enabled<br />
echo "Hello world";<br />
Hello world</code></p>
<p>————————————-<br />
<small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2007/12/11/php-how-do-i-install-phpsh-interactive-shell-prompt-for-php-under-centos-or-fedora/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>MySQL:  How do I import individual table dump files in to MySQL using shell script?</title>
		<link>http://crazytoon.com/2007/11/28/mysql-how-do-i-import-individual-table-dump-files-in-to-mysql-using-shell-script/</link>
		<comments>http://crazytoon.com/2007/11/28/mysql-how-do-i-import-individual-table-dump-files-in-to-mysql-using-shell-script/#comments</comments>
		<pubDate>Thu, 29 Nov 2007 03:35:49 +0000</pubDate>
		<dc:creator>Sunny Walia</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Enterprise level solutions]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL backup]]></category>
		<category><![CDATA[Notes for self]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[System admin]]></category>

		<guid isPermaLink="false">http://crazytoon.com/2007/11/28/mysql-how-do-i-import-individual-table-dump-files-in-to-mysql-using-shell-script/</guid>
		<description><![CDATA[After I wrote the post: How do I dump all tables in a database into separate files? I got emails from couple people asking how to import the individual table files back in to MySQL.  First way to import each sql file created by  the post is to import each file individually by [...]]]></description>
			<content:encoded><![CDATA[<p>After I wrote the post: <a href="http://crazytoon.com/2007/11/26/mysql-how-do-i-dump-all-tables-in-a-database-into-separate-files/" rel="bookmark" title="MySQL:  How do I dump all tables in a database into separate files?">How do I dump all tables in a database into separate files?</a> I got emails from couple people asking how to import the individual table files back in to MySQL.  First way to import each sql file created by  <a href="http://crazytoon.com/2007/11/26/mysql-how-do-i-dump-all-tables-in-a-database-into-separate-files/" rel="bookmark" title="MySQL:  How do I dump all tables in a database into separate files?">the post</a> is to import each file individually by typing:<code>mysql db_name &lt; table1.sql</code>  This will work as long as you are only importing few files.  But if you need to import all of the files in the directory, which could be in 100&#8217;s, this method does not scale well.  To achieve this I wrote a shell script which does the work for me.  Of course, there are other ways to do this and I am only showing you one way of doing it.  This works for me so here it is:</p>
<p><code>#!/bin/bash<br />
db=$1<br />
if [ "$db" = "" ]; then<br />
echo "Usage: $0 db_name"<br />
exit 1<br />
fi<br />
mkdir done<br />
clear<br />
for sql_file in *.sql; do<br />
echo "Importing $sql_file";<br />
mysql $db&lt; $sql_file;<br />
mv $sql_file done;<br />
done</code></p>
<p>Related posts:</p>
<ul>
<li><a href="http://crazytoon.com/2007/11/26/mysql-how-do-i-dump-all-tables-in-a-database-into-separate-files/" title="How do I dump all tables in a database into separate files?" target="_blank">How do I dump all tables in a database into separate files?</a></li>
<li><a href="http://crazytoon.com/2007/01/23/mysql-backups-using-mysqldump/" title="MySQL backups using mysqldump" target="_blank">MySQL backups using mysqldump</a></li>
</ul>
<p>————————————-<br />
<small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2007/11/28/mysql-how-do-i-import-individual-table-dump-files-in-to-mysql-using-shell-script/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Subversion (SVN):  How do you set up backup for your Subversion repositories?</title>
		<link>http://crazytoon.com/2007/08/16/subversion-svn-how-do-you-set-up-backup-for-your-subversion-repositories/</link>
		<comments>http://crazytoon.com/2007/08/16/subversion-svn-how-do-you-set-up-backup-for-your-subversion-repositories/#comments</comments>
		<pubDate>Fri, 17 Aug 2007 01:00:51 +0000</pubDate>
		<dc:creator>Sunny Walia</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Enterprise level solutions]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[System admin]]></category>

		<guid isPermaLink="false">http://crazytoon.com/2007/08/16/subversion-svn-how-do-you-set-up-backup-for-your-subversion-reposiotries/</guid>
		<description><![CDATA[Subversion is becoming more and more popular every day.  To get quick installation guide, see my post on installing Subversion.  Once you have Subversion set up, make sure you have backups of repository setup!  This is one of those things most people forget to do.  If you followed the installation guide [...]]]></description>
			<content:encoded><![CDATA[<p>Subversion is becoming more and more popular every day.  To get quick installation guide, see my post on <a href="http://crazytoon.com/2007/06/01/subversion-how-do-you-install-and-set-up-subversion-for-revision-control/" title="How do you install Subversion?">installing Subversion</a>.  Once you have Subversion set up, make sure you have backups of repository setup!  This is one of those things most people forget to do.  If you followed the installation guide and did source install, you already have a tool available to you.  You can find <span><strong class="command">hot-backup.py </strong></span>tool in the         <tt class="filename">tools/backup/</tt> directory of the Subversion         source distribution.   One thing about this script is that it doesn&#8217;t backup all your repositories.  Which might be an issue if you create more repositories but forget to create a script to backup that particular repository.  Here is a very simple shell script to help you backup all of your subversion repositories.  You can edit it to point to different /svn location if you didn&#8217;t install to default location.  Make sure you copy hot-backup.py to a location which is included in your path so your scripts will work.</p>
<p><code>mkdir /backups/repos -p<br />
for repostobackup in `ls /svn/` ; do<br />
filename=`basename ${repostobackup}`<br />
if [ ! $filename = "" ]; then<br />
hot-backup.py --archive-type=bz2 /svn/${filename} /backups/repos<br />
fi<br />
done</code></p>
<p>This will create your backup files and compress them using bzip2.  You can also use zip or gz if you prefer.  Another thing you should do is to edit the hot-backup.py script and change num_backups to be whatever you think is a good number.  I personally use:  num_backups = 10</p>
<p>That&#8217;s all there is to it.  Just add this script to your crons and your backups will be automated.  You may want to consider moving your backups to another server by adding ftp, scp or rsync at the end of the script.</p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2007/08/16/subversion-svn-how-do-you-set-up-backup-for-your-subversion-repositories/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>SSH:  Setting up public key authentication over SSH (CentOS, Redhat, Linux, Fedora)</title>
		<link>http://crazytoon.com/2007/08/05/ssh-setting-up-public-key-authentication-over-ssh-centos-redhat-linux-fedora/</link>
		<comments>http://crazytoon.com/2007/08/05/ssh-setting-up-public-key-authentication-over-ssh-centos-redhat-linux-fedora/#comments</comments>
		<pubDate>Sun, 05 Aug 2007 09:10:47 +0000</pubDate>
		<dc:creator>Sunny Walia</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Enterprise level solutions]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[System admin]]></category>

		<guid isPermaLink="false">http://crazytoon.com/2007/08/05/ssh-setting-up-public-key-authentication-over-ssh-centos-redhat-linux-fedora/</guid>
		<description><![CDATA[Before we go in to details on how to set up public key authentication, I would like to talk about pros and cons about doing this.  After you know the pros and cons, you can make an educated decision.  First, let us talk about biggest benefit about setting up public key authentication over [...]]]></description>
			<content:encoded><![CDATA[<p>Before we go in to details on how to set up public key authentication, I would like to talk about pros and cons about doing this.  After you know the pros and cons, you can make an educated decision.  First, let us talk about biggest benefit about setting up public key authentication over ssh.  Once you set up the keys correctly, you will not need to enter password to access the other server.  For example, you can just type <code>ssh example.com</code> and you will be logged in.  This is the method you must use if you want to set up scripts which are run from crontab.  For example, you may have rsync script running which does backups from one server to another every night.  With every good thing, comes a bad thing.  So let us say &#8220;somebody&#8221; has access to server1 as root.  This somebody could be designated user or it could be a hacker who has gain root access to server1.  Now since we have public key authentication over ssh setup between server1 and server2, this &#8220;somebody&#8221; now can access server2.  As you can see, this can be a problematic.   Now you know number one pro and con about setting up public key authentication over ssh.  Let us now go on and actually go through process to setup keys.</p>
<p>On server1, you type:   <code>ssh-keygen -t rsa</code> (just press enter to keep accepting defaults).  You should see something like this:</p>
<p><code>ssh-keygen -t rsa<br />
Generating public/private rsa key pair.<br />
Enter file in which to save the key (/root/.ssh/id_rsa):<br />
Created directory '/root/.ssh'.<br />
Enter passphrase (empty for no passphrase):<br />
Enter same passphrase again:<br />
Your identification has been saved in /root/.ssh/id_rsa.<br />
Your public key has been saved in /root/.ssh/id_rsa.pub.<br />
The key fingerprint is:<br />
a2:b2:aw:w2:63:25:2a:62:fs:d5:ff:fd:11:f1:aa:60 root@server1</code></p>
<p>Fingerprint for your server will be different.  Now <code>cat /root/.ssh/id_rsa.pub</code> Copy the contents it displays.  You will need this for server2.  Paste it into notepad or any other text editor and make sure it pastes as one line.  This is very crucial you check this.</p>
<p>Now login to server2.  Create the public key by typing:  <code>ssh-keygen -t rsa</code> (this is same thing we did on server1).  Once you are done, type <code>vi /root/.ssh/authorized_keys2</code></p>
<p>Paste the content you copied earlier on server1.  Make sure it is all on one line.  Save/exit.   At this point, we should change the permissions on the file to make sure sshd likes it:  <code>chmod 600 /root/.ssh/authorized_keys2 </code></p>
<p>Go back to server1 and type ssh server2  You should be logged in with out having to put in a password.  If you are prompted for password still, check server2 /root/.ssh/authorized_keys2 file and make sure everything you pasted is one line.</p>
<p>That is all you have to do set up public key authentication over ssh!</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2007/08/05/ssh-setting-up-public-key-authentication-over-ssh-centos-redhat-linux-fedora/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Bind:  Quick install guide to install and setup Bind (DNS server) in secure (chroot) environment in Linux (CentOS, Redhat Enterprise (RHEL), Fedora).</title>
		<link>http://crazytoon.com/2007/06/21/bind-quick-install-guide-to-install-and-setup-bind-dns-server-in-secure-chroot-environment-in-linux-centos-redhat-enterprise-rhel-fedora/</link>
		<comments>http://crazytoon.com/2007/06/21/bind-quick-install-guide-to-install-and-setup-bind-dns-server-in-secure-chroot-environment-in-linux-centos-redhat-enterprise-rhel-fedora/#comments</comments>
		<pubDate>Fri, 22 Jun 2007 06:55:02 +0000</pubDate>
		<dc:creator>Sunny Walia</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Enterprise level solutions]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[System admin]]></category>

		<guid isPermaLink="false">http://crazytoon.com/2007/06/21/bind-quick-install-guide-to-install-and-setup-bind-dns-server-in-secure-chroot-environment-in-linux-centos-redhat-enterprise-rhel-fedora/</guid>
		<description><![CDATA[There are a lot of great articles on setting up Bind and some of them even go in great details on setting up secure DNS server using Bind.  I have used one them time after time called:  Linux Howto:  Chroot Bind How To.  One of the things I do not like [...]]]></description>
			<content:encoded><![CDATA[<p>There are a lot of great articles on setting up Bind and some of them even go in great details on setting up secure DNS server using Bind.  I have used one them time after time called:  Linux Howto:  <a href="http://www.faqs.org/docs/Linux-HOWTO/Chroot-BIND-HOWTO.html" title="Chroot Bind How To" target="_blank">Chroot Bind How To</a>.  One of the things I do not like about it is that I had to read over things which I really do not need to know or already know.  So I have put together this quick wow To based on this great how to.  Setting up secure DNS server using bind is not very complicated.</p>
<p>Let us dive into this.  First we create user and set up directory structure.</p>
<p><code>echo "named:x:200:200:Nameserver:/chroot/named:/bin/false" &gt;&gt; /etc/passwd<br />
echo "named:x:200:" &gt;&gt; /etc/group<br />
mkdir -p /chroot/named<br />
cd /chroot/named<br />
mkdir -p dev etc/namedb/slave var/run<br />
chown -R named:named /chroot/named/etc/namedb/slave<br />
chown named:named /chroot/named/var/run<br />
mknod /chroot/named/dev/null c 1 3<br />
mknod /chroot/named/dev/random c 1 8<br />
chmod 666 /chroot/named/dev/{null,random}<br />
cp /etc/localtime /chroot/named/etc/</code></p>
<p><code>vi /etc/sysconfig/syslog</code><br />
edit the line which starts with SYSLOGD_OPTIONS and edit it to look like: SYSLOGD_OPTIONS=&#8221;-m 0 -a /chroot/named/dev/log&#8221;<br />
Let us restart syslog to use new settings and let us secure the physical files on the server.</p>
<p><code>/etc/rc.d/init.d/syslog stop<br />
/etc/rc.d/init.d/syslog start<br />
chown root /chroot<br />
chmod 700 /chroot<br />
chown named:named /chroot/named<br />
chmod 700 /chroot/named<br />
cd /chroot/named<br />
chattr +i etc/localtime var</code></p>
<p>Let us clean up previous bind install since most linux installations have named (bind)  pre-installed.<br />
<code><br />
rpm -qa |grep bind<br />
rpm -e --nodeps &lt;copy-paste-all-the-packages-separated-by-space&gt;</code></p>
<p>Let us get the source files for bind and install it.  At time of writing, bind 9.4.1 is the latest.</p>
<p><code>wget http://ftp.isc.org/isc/bind9/9.4.1/bind-9.4.1.tar.gz<br />
tar zxpfv bind-*.gz<br />
cd bind*<br />
./configure<br />
make &amp;&amp; make install</code></p>
<p>copy following content to <code>/etc/init.d/named</code></p>
<p><code>#!/bin/sh<br />
#<br />
# named           This shell script takes care of starting and stopping<br />
#                 named (BIND DNS server).<br />
#<br />
# chkconfig: 345 55 45<br />
# description: named (BIND) is a Domain Name Server (DNS) \<br />
# that is used to resolve host names to IP addresses.<br />
# probe: true<br />
#<br />
# Source function library.<br />
. /etc/rc.d/init.d/functions<br />
#<br />
# Source networking configuration.<br />
. /etc/sysconfig/network<br />
#<br />
# Check that networking is up.<br />
[ ${NETWORKING} = "no" ] &amp;&amp; exit 0<br />
#<br />
[ -f /usr/local/sbin/named ] || exit 0<br />
[ -f /chroot/named/etc/named.conf ] || exit 0<br />
#<br />
# See how we were called.<br />
case "$1" in<br />
start)<br />
# Start daemons.<br />
echo -n "Starting named: "<br />
daemon /usr/local/sbin/named -u named -t /chroot/named -c /etc/named.conf<br />
echo<br />
touch /var/lock/subsys/named<br />
;;<br />
stop)<br />
# Stop daemons.<br />
echo -n "Shutting down named: "<br />
kill `pidof named`<br />
echo<br />
rm -f /var/lock/subsys/named<br />
;;<br />
status)<br />
status named<br />
exit $?<br />
;;<br />
restart)<br />
$0 stop<br />
$0 start<br />
exit $?<br />
;;<br />
reload)<br />
/usr/local/sbin/rndc reload<br />
exit $?<br />
;;<br />
probe)<br />
# named knows how to reload intelligently; we don't want linuxconf<br />
# to offer to restart every time<br />
/usr/local/sbin/rndc reload &gt;/dev/null 2&gt;&amp;1 || echo start<br />
exit 0<br />
;;<br />
#<br />
*)<br />
echo "Usage: named {start|stop|status|restart|reload}"<br />
exit 1<br />
esac<br />
#<br />
exit 0</code></p>
<p>Make it executable:  <code>chmod +x /etc/init.d/named</code><br />
Let us set it so &#8220;named&#8221; will automatically start at boot up:  <code>chkconfig --add named</code></p>
<p>Save follow code into <code>/chroot/named/etc/named.conf</code><br />
<code>options {<br />
recursion no; // this will disable lookups against our server recursion no;<br />
directory "/etc/namedb"; // Working directory<br />
pid-file "/var/run/named.pid"; // Put pid file in working dir<br />
forwarders {<br />
10.10.10.10; //ip of dns server to forward requests to<br />
};<br />
statistics-file "/var/run/named.stats";<br />
query-source address * port 53;<br />
version "Bind 10";<br />
};<br />
controls {<br />
inet 127.0.0.1 port 953<br />
allow { 127.0.0.1; } keys { "rndc-key"; };<br />
};<br />
// Root server hints<br />
zone "." {<br />
type hint;<br />
file "root.hint";<br />
};<br />
// Provide a reverse mapping for the loopback address 127.0.0.1<br />
zone "0.0.127.in-addr.arpa" {<br />
type master;<br />
file "db.127.0.0";<br />
notify no;<br />
};</code></p>
<p>Save following in /chroot/named/etc/namedb/root.hint</p>
<p><code>;       This file holds the information on root name servers needed to<br />
;       initialize cache of Internet domain name servers<br />
;       (e.g. reference this file in the "cache  .  &lt;file&gt;"<br />
;       configuration file of BIND domain name servers).<br />
;<br />
;       This file is made available by InterNIC<br />
;       under anonymous FTP as<br />
;           file                /domain/named.root<br />
;           on server           FTP.INTERNIC.NET<br />
;<br />
;       last update:    Nov 5, 2002<br />
;       related version of root zone:   2002110501<br />
;<br />
;<br />
; formerly NS.INTERNIC.NET<br />
;<br />
.                        3600000  IN  NS    A.ROOT-SERVERS.NET.<br />
A.ROOT-SERVERS.NET.      3600000      A     198.41.0.4<br />
;<br />
; formerly NS1.ISI.EDU<br />
;<br />
.                        3600000      NS    B.ROOT-SERVERS.NET.<br />
B.ROOT-SERVERS.NET.      3600000      A     128.9.0.107<br />
;<br />
; formerly C.PSI.NET<br />
;<br />
.                        3600000      NS    C.ROOT-SERVERS.NET.<br />
C.ROOT-SERVERS.NET.      3600000      A     192.33.4.12<br />
;<br />
; formerly TERP.UMD.EDU<br />
;<br />
.                        3600000      NS    D.ROOT-SERVERS.NET.<br />
D.ROOT-SERVERS.NET.      3600000      A     128.8.10.90<br />
;<br />
; formerly NS.NASA.GOV<br />
;<br />
.                        3600000      NS    E.ROOT-SERVERS.NET.<br />
E.ROOT-SERVERS.NET.      3600000      A     192.203.230.10<br />
;<br />
; formerly NS.ISC.ORG<br />
;<br />
.                        3600000      NS    F.ROOT-SERVERS.NET.<br />
F.ROOT-SERVERS.NET.      3600000      A     192.5.5.241<br />
;<br />
; formerly NS.NIC.DDN.MIL<br />
;<br />
.                        3600000      NS    G.ROOT-SERVERS.NET.<br />
G.ROOT-SERVERS.NET.      3600000      A     192.112.36.4<br />
;<br />
; formerly AOS.ARL.ARMY.MIL<br />
;<br />
.                        3600000      NS    H.ROOT-SERVERS.NET.<br />
H.ROOT-SERVERS.NET.      3600000      A     128.63.2.53<br />
;<br />
; formerly NIC.NORDU.NET<br />
;<br />
.                        3600000      NS    I.ROOT-SERVERS.NET.<br />
I.ROOT-SERVERS.NET.      3600000      A     192.36.148.17<br />
;<br />
; operated by VeriSign, Inc.<br />
;<br />
.                        3600000      NS    J.ROOT-SERVERS.NET.<br />
J.ROOT-SERVERS.NET.      3600000      A     192.58.128.30<br />
;<br />
; housed in LINX, operated by RIPE NCC<br />
;<br />
.                        3600000      NS    K.ROOT-SERVERS.NET.<br />
K.ROOT-SERVERS.NET.      3600000      A     193.0.14.129<br />
;<br />
; operated by IANA<br />
;<br />
.                        3600000      NS    L.ROOT-SERVERS.NET.<br />
L.ROOT-SERVERS.NET.      3600000      A     198.32.64.12<br />
;<br />
; housed in Japan, operated by WIDE<br />
;<br />
.                        3600000      NS    M.ROOT-SERVERS.NET.<br />
M.ROOT-SERVERS.NET.      3600000      A     202.12.27.33<br />
; End of File</code></p>
<p>This should get you started.  Now just create appropriate zone files and you are good to go.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2007/06/21/bind-quick-install-guide-to-install-and-setup-bind-dns-server-in-secure-chroot-environment-in-linux-centos-redhat-enterprise-rhel-fedora/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Ramdisk:  How do you install and set up Ramdisk under Linux (CentOS, RHEL, Fedora)?</title>
		<link>http://crazytoon.com/2007/06/01/ramdisk-how-do-you-install-and-set-up-ramdisk-under-linux-centos-rhel-fedora/</link>
		<comments>http://crazytoon.com/2007/06/01/ramdisk-how-do-you-install-and-set-up-ramdisk-under-linux-centos-rhel-fedora/#comments</comments>
		<pubDate>Fri, 01 Jun 2007 23:36:21 +0000</pubDate>
		<dc:creator>Sunny Walia</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Enterprise level solutions]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[Server load]]></category>
		<category><![CDATA[System admin]]></category>

		<guid isPermaLink="false">http://crazytoon.com/2007/06/01/ramdisk-how-do-you-install-and-set-up-ramdisk-under-linux-centos-rhel-fedora/</guid>
		<description><![CDATA[Ramdisk is very good to have if you want something to stay in memory.   Files in memory makes it so you can access them with out having to access hard drive all the time.  Perfect candidates would be things which do not change eg. web images or downloadable files, etc.  If you have Linux Kernel [...]]]></description>
			<content:encoded><![CDATA[<p>Ramdisk is very good to have if you want something to stay in memory.   Files in memory makes it so you can access them with out having to access hard drive all the time.  Perfect candidates would be things which do not change eg. web images or downloadable files, etc.  If you have Linux Kernel 2.4 or later, you already have support of ramdisk built in.  You can check if ramdisk is setup by doing: </p>
<p><code># dmesg | grep RAMDISK<br />
RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize</code></p>
<p>You should get above output on CentOS and RHEL.  Other linux flavors will have similar output as well.  If you would like to see how they are named and what you would need to refer to, do the following:</p>
<p><code># ls -l /dev/ram*<br />
lrwxrwxrwx 1 root root 4 Apr 24 12:05 /dev/ram -&gt; ram1<br />
brw-rw---- 1 root disk 1, 0 Apr 24 12:05 /dev/ram0<br />
brw-rw---- 1 root disk 1, 1 Apr 24 12:05 /dev/ram1<br />
brw-rw---- 1 root disk 1, 10 Apr 24 12:05 /dev/ram10<br />
brw-rw---- 1 root disk 1, 11 Apr 24 12:05 /dev/ram11<br />
brw-rw---- 1 root disk 1, 12 Apr 24 12:05 /dev/ram12<br />
brw-rw---- 1 root disk 1, 13 Apr 24 12:05 /dev/ram13<br />
brw-rw---- 1 root disk 1, 14 Apr 24 12:05 /dev/ram14<br />
brw-rw---- 1 root disk 1, 15 Apr 24 12:05 /dev/ram15<br />
brw-rw---- 1 root disk 1, 2 Apr 24 12:05 /dev/ram2<br />
brw-rw---- 1 root disk 1, 3 Apr 24 12:05 /dev/ram3<br />
brw-rw---- 1 root disk 1, 4 Apr 24 12:05 /dev/ram4<br />
brw-rw---- 1 root disk 1, 5 Apr 24 12:05 /dev/ram5<br />
brw-rw---- 1 root disk 1, 6 Apr 24 12:05 /dev/ram6<br />
brw-rw---- 1 root disk 1, 7 Apr 24 12:05 /dev/ram7<br />
brw-rw---- 1 root disk 1, 8 Apr 24 12:05 /dev/ram8<br />
brw-rw---- 1 root disk 1, 9 Apr 24 12:05 /dev/ram9<br />
lrwxrwxrwx 1 root root 4 Apr 24 12:05 /dev/ramdisk -&gt; ram0</code></p>
<p>All those ramdisks listed have same size.  In above example, they are all 16MB.  Let us change that so we have more space allowed.  Note that I say allowed and not allocated.  We allocate space in one of the later steps by formatting one of the drives above.   Let us set it up so we have 128 MB.  Since this has to be in multiples of 1024, we will setup Ramdisk to have 131072K. </p>
<p><code>vi /etc/grub.conf</code></p>
<p>Find first line which looks similar to following:</p>
<p><code>kernel /vmlinuz-2.6.9-42.0.10.EL ro root=/dev/VolGroup00/LogVol00</code></p>
<p>add ramdisk_size=131072 to the end of the line.  Now your line should look like:</p>
<p><code>kernel /vmlinuz-2.6.9-42.0.10.EL ro root=/dev/VolGroup00/LogVol00 <strong>ramdisk_size=131072</strong></code><strong> </strong>Save and exit grub.conf.  At this point you have it configured to have ramdisk with new size but it does not take effect until you reboot your system.  Once you have rebooted your system, we can start doing rest of configurations.</p>
<p><code>mke2fs -m 0 /dev/ram0</code></p>
<p>This will format the ram0 ramdrive for us to use. At this point, kernel will allocate space for you.  Let us setup Ramdisk mount point so we can use it.  We will also have it be owned by user &#8220;sunny&#8221; so that user can read/write to that mount.</p>
<p><code>mkdir /home/ramdisk<br />
mount /dev/ram0 /home/ramdisk<br />
chown sunny.sunny /home/ramdisk</code></p>
<p>At this point you should be able to type:  <strong>mount </strong>and see your new Ramdisk drive mounted on /home/ramdisk</p>
<p>Remember that everything you put on this drive will be gone if you reboot your server.  If you unmounted the Ramdisk drive and remounted it, your files will still be there.  It is because your system has that much ram set aside for your Ramdisk and will not use it for anything else.   If you would like to setup Ramdisk the same next time you boot up, add these lines to your /etc/rc.local files.</p>
<p><code>mke2fs -m 0 /dev/ram0<br />
mount /dev/ram0 /home/ramdisk<br />
chown sunny.sunny /home/ramdisk</code></p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2007/06/01/ramdisk-how-do-you-install-and-set-up-ramdisk-under-linux-centos-rhel-fedora/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversion:  How do you install and set up Subversion for revision control?</title>
		<link>http://crazytoon.com/2007/06/01/subversion-how-do-you-install-and-set-up-subversion-for-revision-control/</link>
		<comments>http://crazytoon.com/2007/06/01/subversion-how-do-you-install-and-set-up-subversion-for-revision-control/#comments</comments>
		<pubDate>Fri, 01 Jun 2007 20:32:24 +0000</pubDate>
		<dc:creator>Sunny Walia</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Enterprise level solutions]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[System admin]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://crazytoon.com/2007/06/01/subversion-how-do-you-install-and-set-up-subversion-for-revision-control/</guid>
		<description><![CDATA[Code revision control is very crucial part of development.  It ensures you know who has changed which files and you are able to rollback to older versions in case new changes are breaking your website page or entire project.  There are few options for you if you are looking into setting up code revision control.  My preferred [...]]]></description>
			<content:encoded><![CDATA[<p>Code revision control is very crucial part of development.  It ensures you know who has changed which files and you are able to rollback to older versions in case new changes are breaking your website page or entire project.  There are few options for you if you are looking into setting up code revision control.  My preferred option is Subversion.  <a target="_blank" href="http://subversion.tigris.org/" title="Subversion: An open-source revision control system.">Subversion</a> is an open-source revision control system which is becoming more and more popular every day.  It is very easy to install and setup your project under Subversion.  If you want detailed instructions, please see the <a target="_blank" href="http://svnbook.org/" title="Subversion Book">Subversion Book</a>.  They do a great job explaining what revision control is, what are the different types of revision control are out there, detailed instructions on installing subversion, doing administrator tasks, etc.  Here are instructions on how to set up Subversion under CentOS.  Same instructions apply to most linux distributions. </p>
<p><strong>YUM Install</strong> </p>
<p>Easiest way to install subversion is via &#8220;yum&#8221; by typing:</p>
<p><code>yum install subversion</code></p>
<p>Once install is done, confirm it by typing &#8220;svn&#8221; at the prompt and you should get:</p>
<p><code>Type 'svn help' for usage.</code></p>
<p>At this point you can skip to &#8220;Setting up Subversion repository&#8221; part.</p>
<p><strong>SOURCE Install</strong></p>
<p>Obtain source from:  <a target="_blank" href="http://subversion.tigris.org/" title="Subversion: An open-source revision control system.">Subversion</a>.  At the time of writing, latest (1.4.3) version can be obtain from this link:  <a href="http://subversion.tigris.org/downloads/subversion-1.4.3.tar.gz">http://subversion.tigris.org/downloads/subversion-1.4.3.tar.gz</a></p>
<p><code>tar zxf subversion*<br />
cd subversion*<br />
./configure<br />
make &amp;&amp; make install</code></p>
<p>after everything goes well, type svn at the prompt and you should get:</p>
<p><code>Type 'svn help' for usage.</code></p>
<p><strong>Setting up Subversion repository</strong></p>
<p><code>adduser svnusers<br />
mkdir repos/branches -p<br />
mkdir repos/trunk -p<br />
mkdir repos/tags -p<br />
mkdir /svn<br />
svnadmin create /svn/demorepo<br />
svn import --message "Initial set up" repos <a href="file:///svn/demorepo">file:///svn/demorepo</a><br />
cd /svn/demorepo<br />
chown .svnusers . -R<br />
chmod 775 * -R<br />
chmod +s db</code></p>
<p>Thats all there is to it to setup Subversion repository.  At this point, you should <em>add any users</em> you want to have access to the repository by adding them to &#8220;svnusers&#8221; group.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<small>DISCLAIMER: Please be smart and use code found on internet carefully. Make backups often. And yeah.. last but not least.. I am not responsible for any damage caused by this posting. <strong>Use at your own risk</strong>.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2007/06/01/subversion-how-do-you-install-and-set-up-subversion-for-revision-control/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Rsync:  Using rsync to backup data from one server to another over SSH.  Quick rsync tutorial.</title>
		<link>http://crazytoon.com/2007/05/24/rsync-using-rsync-to-backup-data-from-one-server-to-another-over-ssh-quick-rsync-tutorial/</link>
		<comments>http://crazytoon.com/2007/05/24/rsync-using-rsync-to-backup-data-from-one-server-to-another-over-ssh-quick-rsync-tutorial/#comments</comments>
		<pubDate>Thu, 24 May 2007 22:30:05 +0000</pubDate>
		<dc:creator>Sunny Walia</dc:creator>
				<category><![CDATA[Data Backup]]></category>
		<category><![CDATA[Enterprise level solutions]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[System admin]]></category>
		<category><![CDATA[Windows System]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://crazytoon.com/2007/05/24/rsync-using-rsync-to-backup-data-from-one-server-to-another-over-ssh-quick-rsync-tutorial/</guid>
		<description><![CDATA[Rsync is a great tool which can be used to do many tasks which involved copying/moving data.  If privacy/security is of concern, which it always should be, you can use rsync to do all the copying/moving of data over SSH.  Read through &#8220;man rsync&#8221; to get deeper understanding of rsync.  Here is [...]]]></description>
			<content:encoded><![CDATA[<p>Rsync is a great tool which can be used to do many tasks which involved copying/moving data.  If privacy/security is of concern, which it always should be, you can use rsync to do all the copying/moving of data over SSH.  Read through &#8220;man rsync&#8221; to get deeper understanding of rsync.  Here is my attempt to a short <strong>tutorial on rsync</strong>.   Let us start with most simple example of using rsync over ssh.</p>
<p><code> rsync -ae ssh server1:/home /home/backups/server1_home_backup/</code></p>
<p>This command will download all the files/directories from /home on server1 and copies them to /home/backups/server1_home_backup/<br />
-a = archive mode.  This will preserve permissions, timestamps, etc.<br />
-e = specify which remote shell to use.  In our case, we want to use ssh which follow right after  &#8220;e&#8221;</p>
<p>Let us improve on this and add couple more parameters:</p>
<p><code>rsync -zave ssh --progress server1:/home /home/backups/server1_home_backup/</code><br />
-z = adds zip compression.<br />
-v = verbose<br />
&#8211;progress = my favorite parameter when I am doing rsync manually, not so good when you have it in cron.  This show progress (how_many_files_left/how_many_files_total) and speed along with some other useful data.</p>
<p>Great.. we are moving along pretty good.  Let us add some security to make sure things work the way we want to.</p>
<p><code>rsync --delete-after -zave ssh --progress server1:/home /home/backups/server1_home_backup/</code></p>
<p>&#8211;delete-after = this will delete files on backup server which are missing from source <em>after</em> ALL syncing is done.  If you don&#8217;t care of having extra files on your backup server and have plenty of disk space to spare, do not use this parameter.</p>
<p>Lastly, one of the VERY handy parameters,</p>
<p><code>rsync --delete-after -zave ssh --progress server1:/home /home/backups/server1_home_backup/ -n</code></p>
<p>The -n (or &#8211;dry-run) parameter is great to use for testing.  It will not transfer or delete any files, rather will report to you what it would have done if it was ran with out -n parameter.  This way you can test it with out destroying or transfering data just to find out that is not what you wanted.</p>
<p>For further reading:  <a href="http://www.lamp-tips.com/man-pages/rsync/" title="man rsync - man page for rsync" target="_blank">man rsync</a></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2007/05/24/rsync-using-rsync-to-backup-data-from-one-server-to-another-over-ssh-quick-rsync-tutorial/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Mcache:  Install and configure mcache (msession) to be used for session caching in PHP.</title>
		<link>http://crazytoon.com/2007/05/23/mcache-install-and-configure-mcache-msession-to-be-used-for-session-caching-in-php/</link>
		<comments>http://crazytoon.com/2007/05/23/mcache-install-and-configure-mcache-msession-to-be-used-for-session-caching-in-php/#comments</comments>
		<pubDate>Wed, 23 May 2007 23:45:25 +0000</pubDate>
		<dc:creator>Sunny Walia</dc:creator>
				<category><![CDATA[Caching]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Enterprise level solutions]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Notes for self]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[System admin]]></category>

		<guid isPermaLink="false">http://crazytoon.com/2007/05/23/mcache-install-and-configure-mcache-msession-to-be-used-for-session-caching-in-php/</guid>
		<description><![CDATA[Installing mcache, previously known as msession, on CentOS 32 bit system.
If you are on 64 bit system, you will get errors, lots of them.  I went through and fixed &#8220;some&#8221; errors by modifying code but it was just taking too much time so I decided not to go 64 bit route.  But below are the [...]]]></description>
			<content:encoded><![CDATA[<p>Installing <strong>mcache</strong>, previously known as <strong>msession</strong>, on CentOS 32 bit system.</p>
<p>If you are on 64 bit system, you will get errors, lots of them.  I went through and fixed &#8220;some&#8221; errors by modifying code but it was just taking too much time so I decided not to go 64 bit route.  But below are the efforts I made.  Maybe somebody can help with rest of the steps.   Following instructions work fine with 32 bit systems. For more help look at the <a href="http://www.mohawksoft.org/?q=node/8">MCache Handbook</a>.<br />
Thank you <a href="http://www.mohawksoft.org">Mohawk Software</a> for all your efforts developing this!</p>
<p>Web site: <a href="http://www.mohawksoft.org/?q=node/32">http://www.mohawksoft.org/?q=node/32</a><br />
PHP reference:  <a href="http://us2.php.net/manual/en/ref.msession.php">http://us2.php.net/manual/en/ref.msession.php</a></p>
<p><code>yum install ncurses-devel #otherwise you might see errors about no such file curses.h</code></p>
<p><code>wget http://www.mohawksoft.org/download/mcache-070415-M2.0b6.tar.gz<br />
wget http://www.mohawksoft.org/download/phoenix-070415-M2.0b6.tar.gz<br />
tar zxf mcache*.gz<br />
tar zxf phoenix*.gz<br />
cd phoenix<br />
ln -s Linux.mak config/config.mak<br />
make dirs<br />
make links<br />
make butils<br />
export PATH=$PATH:/opt/mohawk/bin<br />
make libs<br />
vi sqldrv/Makefile # about line 24, comment out POSTGRES=1 and ODBC=1<br />
cd ../mcac*<br />
make server<br />
vi tools/Makefile # after line which says: CARGS+=-DBINDIR=\"$(BINDIR)\"<br />
                  # add:  CARGS+=-DSBINDIR=\"$(SBINDIR)\"<br />
make utils<br />
ln -s /opt/mohawk/lib/libphoenix.so.2.2.2 /lib/<br />
/opt/mohawk/sbin/mcache &amp;</code></p>
<p>In your php.ini, add:   <br />
<code>[Session]<br />
; Use mcache as the save handler<br />
session.save_handler = mcache<br />
; Set the host which runs the mcache daemon<br />
session.save_path = localhost</code></p>
<p>Let us test if mcache server is running:</p>
<p><code>/opt/mohawk/bin/mping</code><br />
You should see:<br />
<code>Usage: /opt/mohawk/bin/mping host<br />
Pings a session daemon<br />
Using localhost<br />
<strong>localhost:8086 is alive</strong></code></p>
<p>Great! You mcache server is now up and running and listening for connections.</p>
<p>You can add above command to your start up scripts so server will run next time you reboot.  Easiest way to achieve this is to add that command to end of /etc/rc.local</p>
<p>32 bit installation is now complete! </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>I could not get 64 bit install to go but here are my notes for whoever wants to try it.  If you get it working, please come back and comment on how you got it installed.</p>
<p>64 bit install notes:First error:  <em>CPU you selected does not support x86-64 instruction set<br />
</em>to fix this, edit config/unixgcc.mak and remove all instances of -mtune=pentium3</p>
<p>Following are code changes to fix some other errors:</p>
<p>line 83 in phmalloc.h<br />
virtual void *memdup(void *mem, unsigned int cb);<br />
to<br />
virtual void *memdup(void *mem, size_t cb);</p>
<p>line 446 in mexpat.cpp<br />
static void *xmlalloc(void *context, unsigned int cb)<br />
to<br />
static void *xmlalloc(void *context, size_t cb)</p>
<p>static void *xmlrealloc(void *context, void *p, unsigned int cb)<br />
to<br />
static void *xmlrealloc(void *context, void *p, size_t cb)</p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2007/05/23/mcache-install-and-configure-mcache-msession-to-be-used-for-session-caching-in-php/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Samba: How do you install and set up Samba in linux? [Redhat Enterprise(RHEL), CentOS, Fedora]</title>
		<link>http://crazytoon.com/2007/05/22/samba-how-do-you-install-and-set-up-samba-in-linux-redhat-enterpriserhel-centos-fedora/</link>
		<comments>http://crazytoon.com/2007/05/22/samba-how-do-you-install-and-set-up-samba-in-linux-redhat-enterpriserhel-centos-fedora/#comments</comments>
		<pubDate>Tue, 22 May 2007 19:38:59 +0000</pubDate>
		<dc:creator>Sunny Walia</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Enterprise level solutions]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[Quick Tips]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[Samba]]></category>
		<category><![CDATA[System admin]]></category>

		<guid isPermaLink="false">http://crazytoon.com/2007/05/22/samba-how-do-you-install-and-set-up-samba-in-linux-redhat-enterpriserhel-centos-fedora/</guid>
		<description><![CDATA[Setting up Samba &#8220;can&#8221; be complicated at times.  Especially if you are looking for instructions online where there are WAY too many tutorials which go in to details about what configuration does what, etc.  Well, this post is nothing like that.  Here I just show you quick and easy way to install [...]]]></description>
			<content:encoded><![CDATA[<p>Setting up Samba &#8220;can&#8221; be complicated at times.  Especially if you are looking for instructions online where there are WAY too many tutorials which go in to details about what configuration does what, etc.  Well, this post is nothing like that.  Here I just show you quick and easy way to install Samba, configure it, and set up the drive letter on your XP/Vista.  NOTE:  for using Samba with Vista, please see my previous post in which I talk about changing settings in Vista so you can connect to your Samba share:  <a href="http://crazytoon.com/2007/02/05/windows-vista-installation-update-2/" title="Fix Samba drive mapping issue">Windows Vista Installation</a></p>
<p>NOTE:  This set up is very &#8220;open&#8221;  and should not be used on servers which are facing the world.  This is for private network where you trust all the computers and its users.</p>
<p>Installing Samba (using yum on CentOS and Fedora):  yum install samba<br />
Installing Samba (using rpm):</p>
<ol>
<li>Obtain Samba rpm from rhn.redhat.com</li>
<li>rpm -ivh samba*.rpm</li>
</ol>
<p>Configuring Samba:<br />
<code>cd /etc/samba<br />
mv smb.conf smb.conf.backup<br />
vi smb.conf</code></p>
<p>Paste content below in to your vi:</p>
<p><code>[global]<br />
workgroup = wrkgrp<br />
netbios name = smbserver<br />
security = SHARE<br />
load printers = No<br />
default service = global<br />
path = /home<br />
available = No<br />
encrypt passwords = yes<br />
[share]<br />
writeable = yes<br />
admin users = smbuser<br />
path = /home/share<br />
force user = root<br />
valid users = smbuser<br />
public = yes<br />
available = yes</code></p>
<p>save and exit</p>
<p><code>adduser smbuser       #add unix account<br />
passwd smbuser          #set unix account password<br />
smbpasswd -a smbuser #lets create same user account on samba<br />
&lt;put same password as your unix account password&gt;<br />
/etc/init.d/smb restart</code></p>
<p>Now let us setup drive letter on our Windows so we can easily access these files.</p>
<p>Start -&gt; run -&gt; cmd &lt;enter&gt;</p>
<p>At the prompt type:  net use z: \\ip_of_your_samba_server\share /user: smbuser password_you_assigned</p>
<p>That is it!  At this point you have successfully set up Samba under Linux and are now successfully connected to your share from your Windows machine.</p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2007/05/22/samba-how-do-you-install-and-set-up-samba-in-linux-redhat-enterpriserhel-centos-fedora/feed/</wfw:commentRss>
		<slash:comments>31</slash:comments>
		</item>
		<item>
		<title>Perl:  How do I install Perl modules? eg. Installing LWP module for Perl.</title>
		<link>http://crazytoon.com/2007/05/21/perl-how-do-i-install-perl-modules-eg-installing-lwp-module-for-perl/</link>
		<comments>http://crazytoon.com/2007/05/21/perl-how-do-i-install-perl-modules-eg-installing-lwp-module-for-perl/#comments</comments>
		<pubDate>Mon, 21 May 2007 22:28:55 +0000</pubDate>
		<dc:creator>Sunny Walia</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Enterprise level solutions]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[System admin]]></category>

		<guid isPermaLink="false">http://crazytoon.com/2007/05/21/perl-how-do-i-install-perl-modules-eg-installing-lwp-module-for-perl/</guid>
		<description><![CDATA[The easiest way to install Perl modules is by installing them through &#8220;shell&#8221;.  Let us say that you are trying to install very common module called:  LWP
You can test to see if you have LWP installed by typing:
perl -MLWP -le "print(LWP-&#62;VERSION)"
If you get something like:  Can&#8217;t locate LWP.pm in @INC  means [...]]]></description>
			<content:encoded><![CDATA[<p>The easiest way to install Perl modules is by installing them through &#8220;shell&#8221;.  Let us say that you are trying to install very common module called:  LWP</p>
<p>You can test to see if you have LWP installed by typing:<br />
<code>perl -MLWP -le "print(LWP-&gt;VERSION)"</code><br />
If you get something like:  <strong>Can&#8217;t locate LWP.pm in @INC </strong> means that you don&#8217;t have it installed.  To install LWP, type:<br />
<code>perl -MCPAN -eshell</code><br />
NOTE:  most times it is okey for you to accept default answers to questions <em>cpan</em> asks.<br />
You can read through cpan help by typing &#8220;h&#8221; without the quotes at cpan&gt; prompt.<br />
To continue installing LWP, type:<br />
<code>install Bundle::LWP</code><br />
After few questions, and some text scrolling, you will have LWP installed.  If for some reason you don&#8217;t want to do it this way, you can always obtain source for the module you are trying to install and build it from source files.  You can obtain these files from <a href="http://mirror.cpan.org/">CPAN site</a></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2007/05/21/perl-how-do-i-install-perl-modules-eg-installing-lwp-module-for-perl/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>CentOS and Redhat problem: NFS mount at boot up fails with error: &#8220;System Error: No route to host&#8221;</title>
		<link>http://crazytoon.com/2007/05/11/centos-and-redhat-problem-nfs-mount-at-boot-up-fails-with-error-system-error-no-route-to-host/</link>
		<comments>http://crazytoon.com/2007/05/11/centos-and-redhat-problem-nfs-mount-at-boot-up-fails-with-error-system-error-no-route-to-host/#comments</comments>
		<pubDate>Fri, 11 May 2007 21:47:08 +0000</pubDate>
		<dc:creator>Sunny Walia</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Enterprise level solutions]]></category>
		<category><![CDATA[Linux System]]></category>
		<category><![CDATA[Linux Tips]]></category>
		<category><![CDATA[Redhat]]></category>
		<category><![CDATA[System admin]]></category>

		<guid isPermaLink="false">http://crazytoon.com/2007/05/11/centos-and-redhat-problem-nfs-mount-at-boot-up-fails-with-error-system-error-no-route-to-host/</guid>
		<description><![CDATA[On our CentOS 4.4 box, I set up the nfs mount by putting the setting in fstab.
10.0.0.2:/export/files    /files    intr
After that I tested the setting by typing:  mount /files Everything worked as expected and files was mounted successfully.  At this point I wanted to make sure server will [...]]]></description>
			<content:encoded><![CDATA[<p>On our CentOS 4.4 box, I set up the <strong>nfs mount</strong> by putting the setting in fstab.</p>
<p><code>10.0.0.2:/export/files    /files    intr</code></p>
<p>After that I tested the setting by typing:  <code>mount /files</code> Everything worked as expected and files was mounted successfully.  At this point I wanted to make sure server will do nfs mounts automatically at boot up.  To my surprise once I rebooted the server, nfs mount did not happen.  I checked the logs and found this:</p>
<p><code>May 11 11:00:24 www3 mount: mount: mount to NFS server '10.0.0.2' failed:<br />
May 11 11:00:24 www3 mount: System Error: No route to host.</code></p>
<p>But once server booted up, I typed <code>mount /files </code>and again, mount worked great. After poking around for a while I found out that when netfs script runs, netfs can not find network routes (due to network is still initializing).  I tried few ways to get around this issue and settled on following solution:</p>
<p><em>vi /etc/init.d/netfs</em><br />
insert:  <em>action $&#8221;Sleeping for 30 secs: &#8221; sleep 30</em><br />
right after:  <em>[ ! -f /var/lock/subsys/portmap ] &amp;&amp; service portmap start</em><br />
and right before: <em>action $&#8221;Mounting NFS filesystems: &#8221; mount -a -t nfs,nfs4</em></p>
<p>Basically we are going to give enough time for network to start and set up routes etc.  You can play with that number after sleep command (we are basically pausing netfs script execution for 30 secs)  and see what works for you.  Once you are done, save/exit and reboot the server to see if number you used is sufficient sleep time.  You can type <em>df -h</em> to see if it was mounted.  If it wasn&#8217;t mounted, you can check /var/log/messages to see if nic was starting after nfs mount.  If it is after, you will have to increase that number after sleep.  Remember that you are only pausing the netfs script execution.  Rest of the system continues to boot up.  After I made changes, I checked my <em>df </em>output after reboot and my mount was there.  I also checked <em>/var/log/messages</em> to see if everything looks ok there:</p>
<p><code>May 11 11:22:14 www3 kernel: bnx2: eth0 NIC Link is Up, 1000 Mbps full duplex<br />
May 11 11:22:16 www3 netfs: Sleeping for 30 secs:  succeeded<br />
May 11 11:22:17 www3 netfs: Mounting NFS filesystems:  succeeded</code></p>
]]></content:encoded>
			<wfw:commentRss>http://crazytoon.com/2007/05/11/centos-and-redhat-problem-nfs-mount-at-boot-up-fails-with-error-system-error-no-route-to-host/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
