<?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>Free Linux Tutorials</title>
	<atom:link href="http://www.freelinuxtutorials.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.freelinuxtutorials.com</link>
	<description>/var/net/sys/admin/blog</description>
	<lastBuildDate>Wed, 18 Apr 2012 01:46:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Installing sudo on HP-UX</title>
		<link>http://www.freelinuxtutorials.com/tutorials/installing-sudo-on-hp-ux/</link>
		<comments>http://www.freelinuxtutorials.com/tutorials/installing-sudo-on-hp-ux/#comments</comments>
		<pubDate>Tue, 17 Apr 2012 10:08:54 +0000</pubDate>
		<dc:creator>freelinu</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[HP-UX]]></category>

		<guid isPermaLink="false">http://www.freelinuxtutorials.com/?p=387</guid>
		<description><![CDATA[Installing sudo on HP-UX 1. check your OS and server architecture to know which package to download. Use the uname command. If it's an PA-RISC 2.0 architecture, you will normally see something like this: # uname -an HP-UX darwin B.11.11 U 9000/800 1234567 unlimited-user license else if it's an Itanium 2 # uname -an HP-UX [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="medium" count="" href="http://www.freelinuxtutorials.com/tutorials/installing-sudo-on-hp-ux/"></g:plusone></div><pre>Installing sudo on HP-UX

1. check your OS and server architecture to know which package
to download. Use the uname command.
If it's an PA-RISC 2.0 architecture, you will normally see
something like this:
# uname -an
HP-UX darwin B.11.11 U 9000/800 1234567 unlimited-user license

else if it's an Itanium 2
# uname -an
HP-UX darwin B.11.31 U ia64 0987654321 unlimited-user license

From here you can see, the following
HP-UX   operating system name
darwin  hostname/system name
B.11.11 operating system release identifier
U       operating system version identifier
9000/800 	machine and model numbers
1234567  	machine identification number
unlimited-user operating system license level

2. Go to my favorite Porting and Archiving Centre for HP-UX
based in UK and search the needed packages. URL will be
<a title="http://hpux.connect.org.uk" href="http://hpux.connect.org.uk">http://hpux.connect.org.uk</a>

3. Search for package name or description
4. For this tutorial, I will demonstrate how to install it
on a Itanium. Search for "sudo" and download the 
necessary package depending on your OS version and
architecture.If you will point your mouse on the HTTP or
FTP link, it will tell you to "Install
gettext,libiconv,zlib first"meaning those are the
dependencies required.</pre>
<pre>5. Download the following packages

gettext-0.18.1.1-ia64-11.23.depot.gz
libiconv-1.14-ia64-11.23.depot.gz
sudo-1.8.4p2-ia64-11.23.depot.gz
zlib-1.2.6-ia64-11.23.depot.gz

6. Move it to a specified folder if you want, then uncompress it
#gunzip *.gz</pre>
<pre>7. Install the package as follow:
swinstall -s /etc/sudo-1.8.4p1-hppa-11.23.depot \*
swinstall -s /home/darwin/libiconv-1.14-ia64-11.23.depot \*
swinstall -s /home/darwin/gettext-0.18.1.1-ia64-11.23.depot \*
swinstall -s /home/darwin/zlib-1.2.6-ia64-11.23.depot \*
swinstall -s /home/darwin/sudo-1.8.4p2-ia64-11.23.depot \*

Configuring sudo

1. Normally installation path will be on /usr/local as in files
will be in
/usr/local/bin/sudo
/usr/local/sbin/visudo
/usr/local/etc/sudoers

2. Add user or group in the sudoers using visudo
example

darwin ALL=(ALL) ALL
%group ALL=(ALL) ALL

3.To test if sudo works already, login as normal user and tried this
$ ls -l /usr/local/etc/sudoers
-r--r----- 1 root root  142 Apr 13 12:47 /usr/local/etc/sudoers
$ more /usr/local/etc/sudoers
/usr/local/etc/sudoers: Permission denied
$ sudo more /usr/local/etc/sudoers
Password:
darwin ALL=(ALL) AL
%system ALL=(ALL) ALL

From here can see, cannot display the file sudoers because the
file permission is for root only. When use "sudo", it is like
temporarily switching a normal user to root to see or
execute commands

Tip:
As default installation, sudo files will be on /usr/local,
so to make your life easier, add it in your path
export PATH=$PATH:/usr/local/bin:/usr/local/sbin

or to make it permanent, put it in your profile path
/home/darwin/.profile</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.freelinuxtutorials.com/tutorials/installing-sudo-on-hp-ux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fedora 16 Released in memory of Dennis Ritchie</title>
		<link>http://www.freelinuxtutorials.com/news-and-updates/fedora-16-released-in-memory-of-dennis-ritchie/</link>
		<comments>http://www.freelinuxtutorials.com/news-and-updates/fedora-16-released-in-memory-of-dennis-ritchie/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 13:26:25 +0000</pubDate>
		<dc:creator>tux</dc:creator>
				<category><![CDATA[News and Updates]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[dennis ritchie]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://www.freelinuxtutorials.com/?p=378</guid>
		<description><![CDATA[Red Hat sponsored Fedora project managed to release 16th version of its Linux distribution, code-named &#8220;Verne&#8221;. Aside from package updates, it improve also in the areas of virtualization and cloud computing. The official release notes can be found here, http://docs.fedoraproject.org/en-US/Fedora/16/html/Release_Notes/index.html It is dedicated in memory of the creator of C programming language, and key developer [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="medium" count="" href="http://www.freelinuxtutorials.com/news-and-updates/fedora-16-released-in-memory-of-dennis-ritchie/"></g:plusone></div><p>Red Hat sponsored Fedora project managed to release 16th version of its Linux distribution, code-named &#8220;Verne&#8221;. Aside from package updates, it improve also in the areas of virtualization and cloud computing.</p>
<p>The official release notes can be found here, <a title="Fedora 16 Released" href="http://docs.fedoraproject.org/en-US/Fedora/16/html/Release_Notes/index.html" target="_blank">http://docs.fedoraproject.org/en-US/Fedora/16/html/Release_Notes/index.html</a></p>
<p>It is dedicated in memory of the creator of C programming language, and key developer of Unix OS, Dennis Ritchie.</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.freelinuxtutorials.com/news-and-updates/fedora-16-released-in-memory-of-dennis-ritchie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create and Extend Logical Volume on HP-UX</title>
		<link>http://www.freelinuxtutorials.com/tutorials/create-and-extend-logical-volume-on-hp-ux/</link>
		<comments>http://www.freelinuxtutorials.com/tutorials/create-and-extend-logical-volume-on-hp-ux/#comments</comments>
		<pubDate>Sat, 01 Oct 2011 07:23:04 +0000</pubDate>
		<dc:creator>tux</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[bdf]]></category>
		<category><![CDATA[create logical volume]]></category>
		<category><![CDATA[extend logical volume]]></category>
		<category><![CDATA[extendfs]]></category>
		<category><![CDATA[fsadm]]></category>
		<category><![CDATA[HP-UX]]></category>
		<category><![CDATA[HP-UX tutorial]]></category>
		<category><![CDATA[JFS]]></category>
		<category><![CDATA[lvcreate]]></category>
		<category><![CDATA[lvdisplay]]></category>
		<category><![CDATA[lvextend]]></category>
		<category><![CDATA[newfs]]></category>
		<category><![CDATA[swlist]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[vgdisplay]]></category>
		<category><![CDATA[vxfs]]></category>

		<guid isPermaLink="false">http://www.freelinuxtutorials.com/?p=372</guid>
		<description><![CDATA[HP-UX tutorial on a Linux website? why not&#8230; To take a break, I decided to post a tutorial here on Creating and Extending LV on HP-UX. It&#8217;s better for me to post it here so it will serve my guide once I get my hands again on HP-UX servers. This is the one I used [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="medium" count="" href="http://www.freelinuxtutorials.com/tutorials/create-and-extend-logical-volume-on-hp-ux/"></g:plusone></div><p>HP-UX tutorial on a Linux website? why not&#8230;</p>
<p>To take a break, I decided to post a tutorial here on Creating and Extending LV on HP-UX. It&#8217;s better for me to post it here so it will serve my guide once I get my hands again on HP-UX servers. This is the one I used when my colleague asked me  to check if I can find a way to increase the Filesystem  of these servers.  Here it is:</p>
<p><em>To create the LV on HP-UX server</em></p>
<p>1.verify first if JFS is online (if online, no need to mount/unmount so no downtime)<br /># swlist -l product | grep -i online<br />OnlineJFS01           4.1.008        Online features of the VxFS File System</p>
<p>2. verify if there’s avail space<br />#bdf<br />#vgdisplay<br />e.g.<br />PE Size (Mbytes)            32              <br />Total PE                    8692    <br />Alloc PE                    4618    <br />Free PE                     4074</p>
<p>FreePE X PE Size = 4074  X 32 = 130GB</p>
<p>3. To create let say a 2GB<br />#lvcreate -L 2048 -n lv_back /dev/vg00<br />Logical volume &#8220;/dev/vg00/lv_back&#8221; has been successfully created with<br />character device &#8220;/dev/vg00/rlv_back&#8221;.<br />Logical volume &#8220;/dev/vg00/lv_back&#8221; has been successfully extended.<br />Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf</p>
<p>4. create filesystem,<br /># newfs -F vxfs /dev/vg00/rlv_back<br />version 6 layout<br />2097152 sectors, 2097152 blocks of size 1024, log size 16384 blocks<br />largefiles supported</p>
<p>5.create dir and mountpoint<br />#mkdir /backup<br />#mount /dev/vg00/lv_back /backup</p>
<p>6.check the new LV<br />#bdf</p>
<p>To enable mirroring</p>
<p>1. verify status<br /># vgdisplay -v | grep PV</p>
<p>2. check LV<br />#lvdisplay -v /dev/vg00/lv_back</p>
<p>00125 /dev/dsk/c2t1d0s2       02242 current  <br />00126 /dev/dsk/c2t1d0s2       02243 current</p>
<p>only writing to c2t1d0s2</p>
<p>compare to others,</p>
<p>2. check LV<br />#lvdisplay -v /dev/vg00/lv_vol03<br />LE    PV1                     PE1   Status 1 PV2                     PE2   Status 2<br />00000 /dev/dsk/c2t1d0s2       00312 current  /dev/dsk/c2t0d0s2       00312 current</p>
<p>writing on both c2t1d0s2 and c2t0d0s2</p>
<p>3. to mirror</p>
<p># lvextend -m 1 /dev/vg00/lv_back /dev/dsk/c2t0d0s2<br />The newly allocated mirrors are now being synchronized. This operation will<br />take some time. Please wait &#8230;.</p>
<p><em>Extend LV on HP-UX server</em><br />Since HP-UX server JFS is online, then we use this procedure</p>
<p>1. example, to extend 2G to 20GB<br />#lvextend -L 20480 /dev/vg00/lv_back<br /># fsadm -F vxfs -b 20480M /backup</p>
<p>2.verify<br />#bdf</p>
<p>If server has no online JFS, procedure as follows:<br />root@darwin-ux [/]<br /># umount /backup<br />root@darwin-ux [/]<br /># lvextend -L 20480 /dev/vg00/lv_back<br />Logical volume &#8220;/dev/vg00/lv_back&#8221; has been successfully extended.<br />Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.conf<br />root@darwin-ux [/]<br /># extendfs -F vxfs /dev/vg00/rlv_back<br />root@darwin-ux [/]<br /># mount /dev/vg00/lv_back /backup<br />root@darwin-ux [/]<br /># bdf /backup<br />Filesystem          kbytes    used   avail %used Mounted on<br />/dev/vg00/lv_back  4194304   18118 3915182    0% /backup<br />root@darwin-ux [/]</p>
<p>Finally, put on /etc/fstab , so it will auto mount even after reboot</p>
<p>add:<br />/dev/vg00/lv_back /backup vxfs delaylog 0 2</p>
<p> </p>
<p>Enjoy <img src='http://www.freelinuxtutorials.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.freelinuxtutorials.com/tutorials/create-and-extend-logical-volume-on-hp-ux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>back to the old server</title>
		<link>http://www.freelinuxtutorials.com/news-and-updates/back-to-the-old-server/</link>
		<comments>http://www.freelinuxtutorials.com/news-and-updates/back-to-the-old-server/#comments</comments>
		<pubDate>Wed, 22 Dec 2010 08:11:10 +0000</pubDate>
		<dc:creator>tux</dc:creator>
				<category><![CDATA[News and Updates]]></category>

		<guid isPermaLink="false">http://www.freelinuxtutorials.com/?p=367</guid>
		<description><![CDATA[My webhosting company have to do emergency migration to the new server with still no definite reasons and all my hyperlinks are all messed up. It seems my mysql DB was not properly migrated and web site traffic logs are not restored as well. My web traffic dropped significantly The hosting need to point my [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="medium" count="" href="http://www.freelinuxtutorials.com/news-and-updates/back-to-the-old-server/"></g:plusone></div><p>My webhosting company have to do emergency migration to the new server with still no definite reasons and all my hyperlinks are all messed up. It seems my mysql DB was not properly migrated and web site traffic logs are not restored as well. My web traffic dropped significantly <img src='http://www.freelinuxtutorials.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>The hosting need to point my site to the old server and still waiting for their permanent solution on this, or might as well change another hosting serve&#8230; too bad..I&#8217;m very disappointed</p>
<p>Sorry for the inconvenience &#8230;</p>
<p>Is it really hard for the webhosting company to restore wordpress to a new server? On my next post, I&#8217;ll post a how to, so please wait for it. thanks</p>
<p>-admin</p>
<p> </p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.freelinuxtutorials.com/news-and-updates/back-to-the-old-server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ubuntu 10.10 Released</title>
		<link>http://www.freelinuxtutorials.com/news-and-updates/ubuntu-10-10-released/</link>
		<comments>http://www.freelinuxtutorials.com/news-and-updates/ubuntu-10-10-released/#comments</comments>
		<pubDate>Wed, 13 Oct 2010 08:36:49 +0000</pubDate>
		<dc:creator>tux</dc:creator>
				<category><![CDATA[News and Updates]]></category>
		<category><![CDATA[announcements]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.freelinuxtutorials.com/?p=361</guid>
		<description><![CDATA[10th day of the 10th month in 10th year, Ubuntu released 10.10 , a perfect date to denotes geekiness  at its best 1010101010 Kidding aside, here&#8217;s the excerpt Coming from the Meerkat department Some time ago a group of hyper-intelligent pan dimensional beings decided to finally answer the great question of Life, The Universe and [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="medium" count="" href="http://www.freelinuxtutorials.com/news-and-updates/ubuntu-10-10-released/"></g:plusone></div><p>10th day of the 10th month in 10th year, Ubuntu released 10.10 , a perfect date to denotes geekiness  at its best 1010101010 <img src='http://www.freelinuxtutorials.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Kidding aside, here&#8217;s the excerpt</p>
<p>Coming from the Meerkat department<br />
Some time ago a group of hyper-intelligent pan dimensional beings decided to finally answer the great question of Life, The Universe and Everything. To this end, a small band of these Debians built an incredibly powerful distribution, Ubuntu. After this great computer programme had run (a very quick 3 million minutes&#8230;or 6 years) the answer was announced. The Ultimate answer to Life, the Universe and<br />
Everything is&#8230;42, and in its&#8217; purest form 101010. Which suggests that what you really need to know is &#8216;What was the Question?&#8217;. The great distribution kindly pointed out that what the problem really was that no-one knew the question. Accordingly, the distribution designed a set of successors, marked by a circle of friends&#8230;to ultimately bring Unity to all things living&#8230;Ubuntu 10.10, to find the question to the ultimate answer.</p>
<p>Ubuntu team announced Ubuntu 10.10 with Codenamed &#8220;Maverick Meerkat&#8221;. Official announcement can be seen at <a title="Ubuntu Announce 10.10" href="https://lists.ubuntu.com/archives/ubuntu-announce/2010-October/000139.html" target="_blank">https://lists.ubuntu.com/archives/ubuntu-announce/2010-October/000139.html</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freelinuxtutorials.com/news-and-updates/ubuntu-10-10-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux Mint 9 Released</title>
		<link>http://www.freelinuxtutorials.com/news-and-updates/linux-mint-9-released/</link>
		<comments>http://www.freelinuxtutorials.com/news-and-updates/linux-mint-9-released/#comments</comments>
		<pubDate>Fri, 21 May 2010 04:22:29 +0000</pubDate>
		<dc:creator>tux</dc:creator>
				<category><![CDATA[News and Updates]]></category>
		<category><![CDATA[announcements]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mint]]></category>

		<guid isPermaLink="false">http://www.freelinuxtutorials.com/?p=358</guid>
		<description><![CDATA[As posted on LinuxMint Official website: The team is proud to announce the release of Linux Mint 9 “Isadora”. Linux Mint 9 “Isadora” New features at a glance: New Software Manager 30,000 packages Review applications straight from the Software Manager APT daemon Visual improvements New Backup Tool Incremental backups, compression, integrity checks Backup/Restoration of the [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="medium" count="" href="http://www.freelinuxtutorials.com/news-and-updates/linux-mint-9-released/"></g:plusone></div><p>As posted on LinuxMint Official website:</p>
<p>The team is proud to announce the release of Linux Mint 9  “Isadora”.  Linux Mint 9 “Isadora” New features at a glance:   New   Software Manager  30,000 packages Review applications straight from the Software Manager APT daemon Visual improvements   New   Backup Tool  Incremental backups, compression, integrity checks Backup/Restoration of the software selection   Menu   improvements  Editable items Transparent menu Always start with favorites “Add to”&#8230;</p>
<p><a title="Linux Mint 9 Released" href="http://www.linuxmint.com/blog/?p=1403" target="_blank">http://www.linuxmint.com/blog/?p=1403</a></p>
<p>personal comment:</p>
<p>I had the chance to try Linux Mint 9 on my virtualbox yesterday after  almost more than an hour of downloading (since I need to limit my  download transfer to prioritize some of my movie downloads =) Anyway,  after installing, I just felt that I&#8217;m just using a combination of  Ubuntu and Opensuse. I like the ease of installation and it&#8217;s network  backup tool, other than that,I find it very Ubuntuish , but still worth a try.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freelinuxtutorials.com/news-and-updates/linux-mint-9-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing IDS using Snort with OinkMaster, Barnyard and BASE on RHEL/CentOS 64-bit</title>
		<link>http://www.freelinuxtutorials.com/tutorials/installing-ids-using-snort-with-oinkmaster-barnyard-and-base-on-rhelcentos-64-bit/</link>
		<comments>http://www.freelinuxtutorials.com/tutorials/installing-ids-using-snort-with-oinkmaster-barnyard-and-base-on-rhelcentos-64-bit/#comments</comments>
		<pubDate>Thu, 20 May 2010 08:08:37 +0000</pubDate>
		<dc:creator>tux</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ADODB]]></category>
		<category><![CDATA[Barnyard]]></category>
		<category><![CDATA[BASE]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[IDS]]></category>
		<category><![CDATA[IPS]]></category>
		<category><![CDATA[oinkmaster]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[snort]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.freelinuxtutorials.com/?p=350</guid>
		<description><![CDATA[Snort® is an open source network intrusion prevention and detection system (IDS/IPS) developed by Sourcefire. Other definitions: - Barnyard is an output system for Snort. Snort creates a special binary output format called unified. Barnyard reads this file, and then resends the data to a database backend. Unlike the database output plug-in, Barnyard manages the [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="medium" count="" href="http://www.freelinuxtutorials.com/tutorials/installing-ids-using-snort-with-oinkmaster-barnyard-and-base-on-rhelcentos-64-bit/"></g:plusone></div><p align="center">Snort® is an open source network intrusion prevention and detection system (IDS/IPS) developed by Sourcefire.</p>
<p style="text-align: left;">Other definitions:<br />
- Barnyard is an output system for Snort. Snort creates a special binary output format called unified. Barnyard reads this file, and then resends the data to a database backend. Unlike the database output plug-in, Barnyard manages the sending of events to the database and stores them when the database temporarily cannot accept connections.</p>
<p>-<span style="font-size: 10pt; font-family: Verdana;"><span style="font-family: Times New Roman; font-size: small;">BASE is the Basic Analysis and Security Engine.  It is based on the code from the Analysis Console for Intrusion  Databases (ACID) project. This application provides a web front-end to  query and analyze the alerts coming from a SNORT IDS system.<br />
</span></span></p>
<p style="text-align: left;"><span style="font-size: 10pt; font-family: Verdana;"><span style="font-family: Times New Roman; font-size: small;">-</span></span>Oinkmaster is a script that will help you update and manage your Snort  rules.</p>
<p>Pre-requisites Softwares:</p>
<p>Mysql<br />
mysql-bench<br />
mysql-server<br />
mysql-devel<br />
mysqlclient10<br />
php-mysql<br />
httpd<br />
gcc<br />
pcre-devel<br />
php-gd<br />
gd<br />
mod_ssl<br />
glib2-devel<br />
gcc-c++<br />
libpcap-devel<br />
php<br />
php-pear<br />
yum-utils</p>
<p>Assuming you already installed your latest 64-bit CentOS, configured important services like Apache,PHP and your mysql server, make sure your server packages are updated as well by issuing<br />
#yum update<strong> </strong></p>
<p><strong> </strong></p>
<p><strong><br />
I. Installation of Snort</strong></p>
<ol>
<li>Download the lateset Snort source file on Snort’s      official Site @ snort.org. As of this moment, the latest version is 2.8.6.      You can find it at <a href="http://www.snort.org/downloads">http://www.snort.org/downloads</a><br />
#wget  <a href="http://dl.snort.org/snort-current/snort-2.8.6.tar.gz">http://dl.snort.org/snort-current/snort-2.8.6.tar.gz</a></li>
<li>Go to your favorite root install directory (mine is      /usr/local/src) and extract the file<br />
#tar zxvf snort-2.8.6.tar.gz</li>
<li>Compile. If you are using the 32-bit OS, it’s very rare      that you encounter errors. For 64-bit, it’s quite pain In the ass, errors      like libmysqlclient cannot be found since it will look for /lib/mysql instead      of lib64/mysql. In order to solve that issue, you need to add extra      parameters to your configure .</li>
</ol>
<p>#cd snort-2.8.6<br />
#./configure –with-mysql –enable-dynamicplugin &#8211;with-mysql-libraries=/usr/lib64/mysql<br />
#make<br />
#make install</p>
<ol>
<li>Create snort user and group<br />
#groupadd snort<br />
#useradd –g snort snort –s /sbin/nologin</li>
<li>Create snort directory files<br />
#mkdir –p /etc/snort<br />
#mkdir –p /etc/snort/rules<br />
#mkdir /var/log/snort</li>
<li>Copy files on the root installation folder of snort to      /etc/snort<br />
#cd etc/<br />
#cp * /etc/snort</li>
<li>Modify your snort.conf and make these changes, assuming      your network is 192.168.1.0/24</li>
</ol>
<p>var RULE_PATH /etc/snort/rules<br />
var HOME_NET 192.168.1.0/24<br />
var EXTERNAL_NET !$HOME_NET</p>
<p>Uncomment the lines (create if none):</p>
<p>output alert_unified: filename snort.alert, limit 128<br />
output log_unified: filename snort.log, limit 128</p>
<ol>
<li>Download the snort init file for easy management of      snort service<br />
#cd /etc/init.d<br />
#wget <a href="../freefiles/snort">http://www.freelinuxtutorials.com/freefiles/snort</a><br />
#chmod 755 snort<br />
#chkconfig snort on</li>
</ol>
<p><strong>II. Installation and Configuration of OinkMaster</strong></p>
<p>Downloading the snort rules on the snort.org website is a little bit tricky. Even if you can sign up an account, you cannot directly download those rules and you’ll receive a  403 Forbidden error. There are ways to get it, you either get it by paying a subscription or get the registered user  release.</p>
<ol>
<li>Download the OinkMaster source file in SourceForge @      oinkmaster.sourceforge.net<br />
#cd /usr/local/src<br />
# wget <a href="http://nchc.dl.sourceforge.net/project/oinkmaster/oinkmaster/2.0/oinkmaster-2.0.tar.gz">http://nchc.dl.sourceforge.net/project/oinkmaster/oinkmaster/2.0/oinkmaster-2.0.tar.gz</a></li>
<li>Extract the file and read the INSTALL file for details<br />
# tar zxvf oinkmaster-2.0.tar.gz<br />
#cd oinkmaster-2.0<br />
#less INSTALL</li>
<li>Copy oinkmaster.pl,oinkmaster.conf and oinkmaster.1       on your suitable directory<br />
#cp oinkmaster.pl      /usr/local/bin<br />
#cp oinkmaster.conf /etc<br />
#cp oinkmaster.1 /usr/local/man/man1</li>
<li>Edit oinkmaster configuration, change the settings on      the line “ url = &lt;url&gt; “. Download the snort rule same with your      snort version.  Use snort –V to check.[root@FLT oinkmaster-2.0]# snort -V</li>
</ol>
<p>,,_     -*&gt; Snort! &lt;*-<br />
o&#8221;  )~   Version 2.8.6 (Build 38)<br />
&#8221;&#8221;    By Martin Roesch &amp; The Snort Team: http://www.snort.org/snort/snort-team           Copyright (C) 1998-2010 Sourcefire, Inc., et al.<br />
Using PCRE version: 6.6 06-Feb-2006</p>
<p>You will see line similar to:</p>
<p>url = http://www.snort.org/pub-bin/oinkmaster.cgi/&lt;oinkcode&gt;/filename</p>
<p>e.g.</p>
<p>url = <a href="http://www.snort.org/pub-bin/oinkmaster.cgi/f8ff7c46785aac436c9f596059863b145d285abc/snortrules-snapshot-CURRENT.tar.gz">http://www.snort.org/pub-bin/oinkmaster.cgi/f8ff7c46785aac436c9f596059863b145d285abc/snortrules-snapshot-CURRENT.tar.gz</a></p>
<p>Save and exit</p>
<ol>
<li>Assuming your rules directory is /etc/snort/rules.      Update the rules by executing:<br />
# oinkmaster.pl –o /etc/snort/rules</li>
<li>Create a non-root user for schedule run of oinkmaster      daily<br />
#group add oink<br />
#useradd –g oink oink –s /sbin/nologin</li>
<li>Create the crontab<br />
#su – oink<br />
$crontab –e</li>
</ol>
<p>01 4 * * * /usr/local/bin/oinkmaster.pl -C /etc/oinkmaster.conf -C /etc/autodisable.conf -o /etc/snort/rules 2&gt;&amp;1 | mail -s &#8220;oinkmaster&#8221; darwin@freelinuxtutorials.com</p>
<p>This will run the oinkmaster daily @ 4:01AM and send email</p>
<p>You will see an email like this:</p>
<p>Loading /etc/oinkmaster.conf</p>
<p>Loading /etc/autodisable.conf</p>
<p>Downloading file from <a href="http://www.snort.org/pub-bin/oinkmaster.cgi/*oinkcode*/snortrules-snapshot-CURRENT.tar.gz">http://www.snort.org/pub-bin/oinkmaster.cgi/*oinkcode*/snortrules-snapshot-CURRENT.tar.gz</a>&#8230; done.</p>
<p>Archive successfully downloaded, unpacking&#8230; done.</p>
<p>Setting up rules structures&#8230; done.</p>
<p>Processing downloaded rules&#8230; disabled 0, enabled 0, modified 0, total=8464</p>
<p>Setting up rules structures&#8230; done.</p>
<p>Comparing new files to the old ones&#8230; done.</p>
<p>[***] Results from Oinkmaster started 20100518 05:33:38 [***]</p>
<p>[*] Rules modifications: [*]</p>
<p>None.</p>
<p>[*] Non-rule line modifications: [*]</p>
<p>None.</p>
<p>[*] Added files: [*]</p>
<p>None.</p>
<p><strong>III. Set-up database in MySQL</strong></p>
<ol>
<li>This will serve as database for snort to make it easy      to look up on events and it is a requirement of the BASE monitoring tool</li>
</ol>
<p>#mysql –u root –p</p>
<p>Mysql&gt; create database snort;<br />
mysql&gt; GRANT CREATE,INSERT,SELECT,DELETE,UPDATE on snort.* to snort@localhost IDENTIFIED by ‘snortpass’;<br />
mysql&gt;exit</p>
<ol>
<li>Execute the command below to create tables<br />
#mysql –u root –p snort &lt;      /usr/local/src/snort-2.8.6/schemas/create_mysql</li>
</ol>
<p><strong>IV. Install Barnyard</strong></p>
<ol>
<li>Download and extract barnyard#cd /usr/local/src<br />
# wget <a href="http://snort.org/dl/barnyard/barnyard-0.2.0.tar.gz">http://snort.org/dl/barnyard/barnyard-0.2.0.tar.gz</a><br />
#tar zxvf barnyard-0.2.0</li>
<li>Patch and configure for 64-bit. This is another pain in      the ass, coz if you don’t patch the barnyard, you will get an error      something like “ERROR: Invalid packet length:”#cd barnyard-0.2.0<br />
#wget <a href="http://www.snort.org/users/jbrvenik/Site/Code_files/barnyard.64bit.diff">http://www.snort.org/users/jbrvenik/Site/Code_files/barnyard.64bit.diff</a><br />
#patch –p1 &lt; barnyard.64bit.diff<br />
You will something like this:</li>
</ol>
<p>[root@FLT barnyard-0.2.0]# patch -p1 &lt; barnyard.64bit.diff</p>
<p>patching file src/barnyard.h<br />
patching file src/event.h</p>
<p>patching file src/input-plugins/dp_alert.h<br />
patching file src/util.c<br />
patching file src/util.h</p>
<ol>
<li>Edit op_acid_db.c  and the line      “mysql-&gt;reconnect = 1; “ below<br />
#cd /usr/local/src/barnyard-0.2.0/src/output-plugins<br />
#vi  op_acid_db.c<br />
From:<br />
LogMessage(&#8220;Lost connection to MySQL server.       Reconnecting\n&#8221;);<br />
while(mysql_ping(mysql) != 0)</li>
</ol>
<p>To:<br />
LogMessage(&#8220;Lost connection to MySQL server.  Reconnecting\n&#8221;);<br />
mysql-&gt;reconnect = 1;<br />
while(mysql_ping(mysql) != 0)</p>
<ol>
<li>Compile# ./configure &#8211;enable-mysql  &#8211;with-mysql-libraries=/usr/lib64/mysql<br />
#make<br />
#make install</li>
<li>Copy barnyard.conf on /etc/snort<br />
#cp etc/barnyard.conf /etc/snort</li>
<li>Configure barnyard.conf. Change the ffg:<br />
from:<br />
config interface: fxp0<br />
to:<br />
config interface: eth0</p>
<p>Add these lines if not existing, the database details should be same on      the one you configure on your database.</li>
</ol>
<p>output alert_acid_db: mysql, sensor_id 1, database snort, server localhost, user snort, password snortpass<br />
output log_acid_db: mysql, database snort, server localhost, user snort, password snortpass, detail full</p>
<ol>
<li>Create a waldo file for barnyard.a. Execute on the CLI and let it go until on the message “Not Using      PCAP_FRAMES”, run it for few seconds and stop it by pressing Ctrl-c<br />
#snort –c /etc/snort/snort.conf</p>
<p>b. Open another CLI and check your /var/log/snort, you will see files like      :</p>
<p>-rw-r&#8211;r&#8211; 1 root root    400 May 20 15:04      snort.alert.1274330319<br />
-rw-r&#8211;r&#8211; 1 root root   7484 May 20 15:04 snort.log.1274330319</li>
</ol>
<p>c. Create a file barnyard.waldo and put this line<br />
/var/log/snort snort.log 1274330319 0<br />
Save and exit<br />
We used 1274330319 as the 10 digit suffix on snort.log</p>
<p>8.  Copy the barnyard init file same as we did on snort.<br />
#wget <a href="../freefiles/barnyard">http://www.freelinuxtutorials.com/freefiles/barnyard</a><br />
#chmod 755 barnyard<br />
#chkconfig barnyard on</p>
<p>9. Start barnyard service<br />
[root@FLT snort]# service barnyard startStarting Barnyard: Barnyard Version 0.2.0 (Build 32)<br />
31165<br />
[  OK  ]</p>
<p><strong><br />
V.  Install BASE</strong></p>
<ol>
<li>Install first the following packages used for graphing      of BASE<br />
#pear install Image_Graph-alpha Image_Canvas-alpha Image_Color      Numbers_Roman</li>
<li>Download and install ADODB<br />
#wget <a href="http://easynews.dl.sourceforge.net/sourceforge/adodb/adodb480.tgz">http://easynews.dl.sourceforge.net/sourceforge/adodb/adodb480.tgz</a><br />
#cd /var/www/<br />
# tar zxvf /usr/local/src/adodb480.tgz</li>
<li>Download and configure BASE<br />
#wget <a href="http://easynews.dl.sourceforge.net/sourceforge/secureideas/base-1.3.5.tar.gz">http://easynews.dl.sourceforge.net/sourceforge/secureideas/base-1.3.5.tar.gz</a><br />
#cd /var/www/html<br />
#tar –zxvf /usr/local/src/base-1.3.5.tar.gz<br />
# mv base-1.3.5/ base/</li>
<li>Copy base_conf.php.dist to base_conf.php<br />
#cp base_conf.php.dist base_conf.php</li>
<li>Edit base_conf.php and insert/edit the  parameters      below:<br />
$BASE_urlpath = &#8220;/base&#8221;;<br />
$DBlib_path = &#8220;/var/www/adodb/ &#8220;;<br />
$DBtype = &#8220;mysql&#8221;;<br />
$alert_dbname = &#8220;snort&#8221;;<br />
$alert_host = &#8220;localhost&#8221;;<br />
$alert_port = &#8220;&#8221;;<br />
$alert_user = &#8220;snort&#8221;;<br />
$alert_password = &#8220;password on your snort DB&#8221;;</li>
<li>Access the sensor on your browser<br />
<a href="http://192.168.1.x/base">http://192.168.1.x/base</a></li>
<li>You should now see the BASE startup banner, click the      “setup page” link and follow the instructions.</li>
<li>You can create an htaccess to secure the base directory      if you want</li>
</ol>
<p><strong>V1.  Testing Snort</strong></p>
<ol>
<li>Create a simple rule under the /etc/snort/rules and      named it as local.rules. Make sure the line below is  uncommented on      snort.conf to make it work<br />
include $RULE_PATH/local.rules</li>
<li>Create local.rules and insert this line:<br />
alert tcp any any &lt;&gt; any 80 (msg: &#8220;Test web      activity&#8221;;sid:1000001;)</li>
<li>Save and exit. Now restart your Snort and open a web      browser,and go to any websites</li>
<li>You should see number of events with SID 1000001      indicating the your snort is working.  Just check the alert links and      categories to verify your testing. You will see something like this:<a title="http://www.freelinuxtutorials.com/freefiles/base1.PNG" href="http://www.freelinuxtutorials.com/freefiles/base1.PNG" target="_blank"> </a><a title="http://www.freelinuxtutorials.com/freefiles/base1.PNG" href="http://www.freelinuxtutorials.com/freefiles/base1.PNG" target="_blank">http://www.freelinuxtutorials.com/freefiles/base1.PNG</a><br />
<a title="http://www.freelinuxtutorials.com/freefiles/base2.PNG" href="http://www.freelinuxtutorials.com/freefiles/base2.PNG" target="_blank">http://www.freelinuxtutorials.com/freefiles/base2.PNG</a></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.freelinuxtutorials.com/tutorials/installing-ids-using-snort-with-oinkmaster-barnyard-and-base-on-rhelcentos-64-bit/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Configure Postfix to use Gmail in RHEL/CentOS</title>
		<link>http://www.freelinuxtutorials.com/quick-tips-and-tricks/configure-postfix-to-use-gmail-in-rhelcentos/</link>
		<comments>http://www.freelinuxtutorials.com/quick-tips-and-tricks/configure-postfix-to-use-gmail-in-rhelcentos/#comments</comments>
		<pubDate>Mon, 03 May 2010 10:21:53 +0000</pubDate>
		<dc:creator>tux</dc:creator>
				<category><![CDATA[Quick Tips & Tricks]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[starttls]]></category>

		<guid isPermaLink="false">http://www.freelinuxtutorials.com/?p=344</guid>
		<description><![CDATA[Relaying to Gmail via smtp.gmail.com can be accomplished by configuring your Postfix with SASL authentication and TLS encryption. The common errors you will encounter if sending from your postfix mail server failing to gmail.com domain but works in other domains are: @/var/log/maillog -Must issue a STARTTLS command first -certificate verification failed for gmail.com:unable to get [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="medium" count="" href="http://www.freelinuxtutorials.com/quick-tips-and-tricks/configure-postfix-to-use-gmail-in-rhelcentos/"></g:plusone></div><p>Relaying to Gmail via smtp.gmail.com can be accomplished by configuring your Postfix with SASL authentication and TLS encryption.</p>
<p>The common errors you will encounter if sending from your postfix mail server failing to gmail.com domain but works in other domains are:</p>
<p>@/var/log/maillog<br />
-Must issue a STARTTLS command first<br />
-certificate verification failed for gmail.com:unable to get local issuer certificate<br />
-Authentication Required. Learn more at 530 5.5.1 http://mail.google.com/support/bin/answer.py?</p>
<p>How to fix?</p>
<p>Assuming you already installed Postfix and everything works fine except sending to gmail smtps, here are the steps to follow:</p>
<p>1. Configure Postfix main configuration</p>
<p>a.vi /etc/postfix/main.cf</p>
<p>b. Add these lines:</p>
<p>smtp_sasl_security_options = noanonymous<br />
relayhost = [smtp.gmail.com]:587<br />
smtp_use_tls = yes<br />
smtp_tls_CAfile = /etc/postfix/cacert.pem<br />
smtp_sasl_auth_enable = yes<br />
smtp_sasl_password_maps = hash:/etc/postfix/sasl/passwd</p>
<p>c. Save and exit</p>
<p>2. Create /etc/postfix/sasl/passwd</p>
<p>a. Create a directory sasl under /etc/postfix and create a file passwd with contents below:</p>
<p>[smtp.gmail.com]:587 username@gmail.com:password</p>
<p>Save and exit</p>
<p>b. Change permission<br />
#chmod 600 /etc/postfix/sasl/passwd</p>
<p>c. Create lookup table via postmap<br />
#postmap /etc/postfix/sasl/passwd</p>
<p>Issuing that command will create passwd.db</p>
<p>3. Generate your own CA certificate</p>
<p>a. Change directory to /etc/pki/tls/certs</p>
<p>#cd /etc/pki/tls/certs</p>
<p>b.Create a key and test certificate in one file</p>
<p>#make hostname.pem</p>
<p>You will something like</p>
<p>[root@FLT certs]# make hostname.pem<br />
umask 77 ; \<br />
PEM1=`/bin/mktemp /tmp/openssl.XXXXXX` ; \<br />
PEM2=`/bin/mktemp /tmp/openssl.XXXXXX` ; \<br />
/usr/bin/openssl req -utf8 -newkey rsa:1024 -keyout $PEM1 -nodes -x509 -days 365 -out $PEM2 -set_serial 0 ; \<br />
cat $PEM1 &gt;  hostname.pem ; \<br />
echo &#8220;&#8221;    &gt;&gt; hostname.pem ; \<br />
cat $PEM2 &gt;&gt; hostname.pem ; \<br />
rm -f $PEM1 $PEM2<br />
Generating a 1024 bit RSA private key<br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.++++++<br />
&#8230;..++++++<br />
writing new private key to &#8216;/tmp/openssl.z12084&#8242;<br />
&#8212;&#8211;<br />
You are about to be asked to enter information that will be incorporated<br />
into your certificate request.<br />
What you are about to enter is what is called a Distinguished Name or a DN.<br />
There are quite a few fields but you can leave some blank<br />
For some fields there will be a default value,<br />
If you enter &#8216;.&#8217;, the field will be left blank.<br />
&#8212;&#8211;<br />
Country Name (2 letter code) [GB]:<br />
State or Province Name (full name) [Berkshire]:<br />
Locality Name (eg, city) [Newbury]:<br />
Organization Name (eg, company) [My Company Ltd]:<br />
Organizational Unit Name (eg, section) []:<br />
Common Name (eg, your name or your server&#8217;s hostname) []:<br />
Email Address []:</p>
<p>c. Fill-up the necessary information and copy the file on /etc/postfix as cacert.pem</p>
<p>#cp /etc/pki/tls/certs/hostname.pem /etc/postfix/cacert.pem</p>
<p>4. Restart the postfix service</p>
<p>#service postfix restart<br />
5. Inspect now your postfix logs to see if it can send out mails now to gmail servers</p>
<p>A successful message states something like<br />
May  3 17:35:00 FLT postfix/smtp[28244]: 0ABB61CE32A: to=&lt;freelinuxtutorials@gmail.com&gt;, relay=smtp.gmail.com[74.125.93.109]:587, delay=5, delays=0.41/0.02/2.7/1.8, dsn=2.0.0, status=sent (250 2.0.0 OK 1272879300 8sm8902550qwj.38)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freelinuxtutorials.com/quick-tips-and-tricks/configure-postfix-to-use-gmail-in-rhelcentos/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ubuntu 10.04 Lucid Lynx is released</title>
		<link>http://www.freelinuxtutorials.com/news-and-updates/ubuntu-10-04-lucid-lynx-is-released/</link>
		<comments>http://www.freelinuxtutorials.com/news-and-updates/ubuntu-10-04-lucid-lynx-is-released/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 02:06:34 +0000</pubDate>
		<dc:creator>tux</dc:creator>
				<category><![CDATA[News and Updates]]></category>
		<category><![CDATA[announcements]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lucid lynx]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.freelinuxtutorials.com/?p=342</guid>
		<description><![CDATA[The next big version of Ubuntu Linux OS has now arrived and if offers new exciting features for users like quicker boot speed on almost any machine, along with a social networking-oriented &#8221; Me Menu&#8221;,Ubuntu Software Centre 2.0 for easier access to new software, and a slew of new cloud-based services courtesy of Ubuntu One [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="medium" count="" href="http://www.freelinuxtutorials.com/news-and-updates/ubuntu-10-04-lucid-lynx-is-released/"></g:plusone></div><p>The next big version of Ubuntu Linux OS has now arrived and if offers new exciting features for users like quicker boot speed on almost any machine, along with a social networking-oriented &#8221; Me Menu&#8221;,Ubuntu Software Centre 2.0 for easier access to new software, and a slew of new cloud-based services courtesy of Ubuntu One &#8212; not to mention the Ubuntu One music store.<br />
Ready for the ride. To see the technical overview, read more to <a title="Ubuntu 10.04 Lucid Lynx" href="http://www.ubuntu.com/getubuntu/releasenotes/1004overview" target="_blank">ubuntu.com </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.freelinuxtutorials.com/news-and-updates/ubuntu-10-04-lucid-lynx-is-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Setting up MySQL Database Replication</title>
		<link>http://www.freelinuxtutorials.com/tutorials/setting-up-mysql-replication/</link>
		<comments>http://www.freelinuxtutorials.com/tutorials/setting-up-mysql-replication/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 03:06:02 +0000</pubDate>
		<dc:creator>tux</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[replication]]></category>

		<guid isPermaLink="false">http://www.freelinuxtutorials.com/?p=334</guid>
		<description><![CDATA[I.Configure Master 1. edit /etc/mysql/my.cnf. We have to enable networking for MySQL, I.Configure Master 1. edit /etc/mysql/my.cnf. We have to enable networking for MySQL, #skip-networking 2. Add the following line to the my.cnf server-id = 1 log-bin=/storage/lun0/db/mysql/FLTVM01-bin 3. restart mysql #service mysqld restart 4.     log into the MySQL database as root and create a [...]]]></description>
			<content:encoded><![CDATA[<div name="googleone_share_1" style="position:relative;z-index:5;float: right; margin-left: 10px;"><g:plusone size="medium" count="" href="http://www.freelinuxtutorials.com/tutorials/setting-up-mysql-replication/"></g:plusone></div><p>I.Configure Master</p>
<p>1. edit /etc/mysql/my.cnf. We have to enable networking for MySQL,</p>
<p>I.Configure Master</p>
<p>1. edit /etc/mysql/my.cnf. We have to enable networking for MySQL,</p>
<p>#skip-networking</p>
<p>2. Add the following line to the my.cnf</p>
<p>server-id = 1<br />
log-bin=/storage/lun0/db/mysql/FLTVM01-bin</p>
<p>3. restart mysql<br />
#service mysqld restart</p>
<p>4.     log into the MySQL database as root and create a user with replication privileges:</p>
<p>#mysql -u root -p<br />
mysql&gt; GRANT REPLICATION SLAVE ON *.* TO &#8216;slaveuser&#8217;@'%&#8217; IDENTIFIED BY &#8216;&lt;some_password&gt;&#8217;; (Replace &lt;some_password&gt; with a real password!)<br />
mysql&gt;FLUSH PRIVILEGES;</p>
<p>5. To accomplish identical data on both master and slave  server, prevent all writes on the master via Lock Tables &amp; Show Log Position<br />
mysql&gt; FLUSH TABLES WITH READ LOCK;<br />
mysql&gt; SHOW MASTER STATUS;</p>
<p>NOTE: Keep this prompt running  in order for lock to be ACTIVE</p>
<p>e.g.</p>
<p>mysql&gt; SHOW MASTER STATUS;<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />
| File               | Position  | Binlog_Do_DB | Binlog_Ignore_DB |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />
| FLTVM01-bin.000051 | 444132144 |              |                  |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />
1 row in set (0.00 sec)</p>
<p>mysql&gt; exit</p>
<p>6. Dump Database</p>
<p>#mysqldump -u root -p&lt;password&gt; &#8211;lock-all-tables –all-databases &gt; alldb.sql</p>
<p>7. Unlock Tables on the master after dumping</p>
<p>mysql&gt; UNLOCK TABLES;</p>
<p>II. Configure Slave</p>
<p>1.Create Database</p>
<p>mysql -u root -p<br />
Enter password:<br />
CREATE DATABASE exampledb;<br />
quit;</p>
<p>2. Restore Database</p>
<p>mysql -u root -p &lt;password&gt; exampledb &lt; /path/to/alldb.sql</p>
<p>3. Configure Slave configuration, assuming master is 192.168.1.2,</p>
<p>server-id=2<br />
master-host=192.168.1.2<br />
master-user=slave_user<br />
master-password=secret<br />
master-connect-retry=60</p>
<p>4. Restart MySQL service<br />
#service mysql restart</p>
<p>5. Issue command Slave Stop and Change master</p>
<p>#mysql -u root -p<br />
Enter password:<br />
mysql&gt; SLAVE STOP;<br />
mysql&gt; CHANGE MASTER TO MASTER_HOST=&#8217;192.168.1.2&#8242;, MASTER_USER=&#8217;slaveuser&#8217;, MASTER_PASSWORD=&#8217;slavepass!&#8217;, MASTER_LOG_FILE=&#8217;FLTVM01-bin.000051&#8242;, MASTER_LOG_POS=444132144;</p>
<p>6. Start Slave</p>
<p>mysql&gt; START SLAVE;<br />
mysql&gt;quit</p>
<p>7. Check for errors<br />
#tail -f /var/log/mysqld.log</p>
<p>III. CHECKING &amp; TESTING</p>
<p>status of the master can be known from mysql prompt:</p>
<p>mysql&gt; SHOW MASTER STATUS;</p>
<p>and slave can be known by:</p>
<p>mysql&gt; SHOW SLAVE STATUS;</p>
<p>To test:</p>
<p>1. On sample database on master, create table</p>
<p>Example:</p>
<p>mysql&gt;use testdb;<br />
mysql&gt;CREATE TABLE example (<br />
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,<br />
data VARCHAR(100)       );</p>
<p>&#8211;&gt; insert data on table</p>
<p>mysql&gt; INSERT INTO example (data)  VALUES (&#8216;Hello world&#8217;);</p>
<p>2. Check the Slave database and see if the following changes are replicated.<br />
mysql&gt;use testdb;<br />
mysql&gt; select * from example;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freelinuxtutorials.com/tutorials/setting-up-mysql-replication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

