<?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 &#187; Tutorials</title>
	<atom:link href="http://www.freelinuxtutorials.com/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.freelinuxtutorials.com</link>
	<description>/var/net/sys/admin/blog</description>
	<lastBuildDate>Wed, 09 Nov 2011 13:26: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>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>admin</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>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>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>
		<item>
		<title>How to Backup Data on RHEL/CentOS via DVD</title>
		<link>http://www.freelinuxtutorials.com/tutorials/how-to-backup-data-on-rhelcentos-via-dvd/</link>
		<comments>http://www.freelinuxtutorials.com/tutorials/how-to-backup-data-on-rhelcentos-via-dvd/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 08:25:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[DVD]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.freelinuxtutorials.com/?p=317</guid>
		<description><![CDATA[INTRODUCTION Data backup is the process of making copies of data in order to protect and restore original files whenever data loss happens. Aside from automated routine data backup, this method does not protect against failure and natural disasters. This is where off-site data backup comes in. OBJECTIVE To establish an off-site backup of important [...]]]></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/how-to-backup-data-on-rhelcentos-via-dvd/"></g:plusone></div><p><em>INTRODUCTION</em></p>
<p>Data backup is the process of making copies of data in order to protect and restore original files whenever data loss happens. Aside from automated routine data backup, this method does not protect against failure and natural disasters. This is where off-site data backup comes in.</p>
<p><em>OBJECTIVE</em></p>
<p>To establish an off-site backup of important data such as website and configuration files, and database, by copying and burning it to a removable media via DVD.</p>
<p>Sample Scenario:</p>
<p>We need to backup the webserver files and database, and burn it on DVD disc.</p>
<p><em>PRE-BACKUP PROCEDURES:</em></p>
<p>1.    Website Files<br />
important directories:<br />
/var/www<br />
/etc/httpd</p>
<p>Assuming you have weekly backup @ FLTWWW01, we can just copy that file in format:<br />
FLTWWW01.freelinuxtutorials.com-var-www-html.yyyymmdd.tar.gz<br />
FLTWWW01.freelinuxtutorials.com-etc-httpd.yyyymmdd.tar.gz</p>
<p>2.    Database</p>
<p>For a consistent copy of database backup, read lock should be implemented on the database. Fortunately, we can do it on the slave database server without interrupting the MySQL service.</p>
<p>Write a script sqlbackup.sh that will be run on FLTVMM1-DBSERVER to stop the slave,read lock and dump the database to a certain location.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
#!/bin/sh<br />
date=`/bin/date +%Y%m%d-%H`</p>
<p>/usr/bin/mysqladmin &#8211;user=root &#8211;password=password stop-slave<br />
/usr/bin/mysqldump &#8211;user=root &#8211;password=password &#8211;lock-all-tables &#8211;all-databases &gt; /storage/temp/backup-${date}.sql<br />
/usr/bin/mysqladmin &#8211;user=root &#8211;password=password start-slave<br />
/bin/tar zcvf backup-${date}.sql.tar.gz backup-${date}.sql</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong>BACKUP PROCESS:</strong></p>
<p><em>Backup Data on DVD</em></p>
<p>1. First install the package dvd+rw-tools<br />
#yum install dvd+rw-tools</p>
<p>2. check if dvd drive is present by displaying the information about disk drive<br />
dvd+rw-mediainfo /dev/dvd</p>
<p>3. Create the ISO image<br />
e.g.<br />
# mkisofs -r -o /tmp/var-www-disk1.iso /var/www</p>
<p>Website Files: (1st DVD)<br />
@FLTVMM1   → /storage/lun1/BACKUP/www/application</p>
<p>#cd /storage/lun1/BACKUP/www/temp<br />
#mkisofs -r -o wwwprod.iso /storage/lun1/BACKUP/www/application/FLTWWW01.freelinuxtutorials.com-var-www-html.yyyymmdd.tar.gz<br />
/storage/lun1/BACKUP/www/applicaiton/FLTWWW01.freelinuxtutorials.com-etc-httpd.yyyymmdd.tar.gz</p>
<p>Database: (2nd DVD)<br />
@FLTVMM1-DBSERVER</p>
<p>#cd /storage/temp<br />
#./sqlbackup.sh (can be scheduled automatically, hours before offsite backup)<br />
#mkisofs -r -o database.iso /storage/temp/backup-yyyymmdd-hh.tar.gz</p>
<p>4. Write the ISO onto the DVD<br />
Website Files:<br />
# growisofs -Z /dev/dvd=/storage/lun1/BACKUP/www/temp/wwwprod.iso</p>
<p>Database:<br />
# growisofs -Z /dev/dvd=/storage/temp/database.iso</p>
<p>5. To append more data for same DVD [Optional]<br />
# growisofs -M /dev/dvd /tmp/file1</p>
<p><em>VERIFICATION:</em></p>
<p>1. To verify if data was burned successfully, insert the DVD on the drive and mount it</p>
<p>#mkdir /mnt/dvd<br />
#mount -t iso9660 -o ro /dev/dvd /mnt/dvd</p>
<p>2. List the files and archive<br />
#ls -lah /mnt/dvd<br />
#tar -tf  file.tar.gz</p>
<p><em>RESTORATION PROCEDURE</em>:</p>
<p>Website Files:<br />
1.    Create the mount directory if not exists<br />
#mkdir /mnt/dvd<br />
2.    Mount the DVD<br />
#mount -t auto /dev/dvd /mnt/dvd<br />
3.    Decompress the files in a particular directory<br />
#cd /tmp<br />
#tar zxvf FLTWWW01.freelinuxtutorials.com-var-www-html.yyyymmdd.tar.gz<br />
#tar zxvf FLTWWW01.freelinuxtutorials.com-etc-httpd.yyyymmdd.tar.gz<br />
4. Select the files/folder that you need and copy to a specific directory</p>
<p>Database:<br />
1. Create the mount directory if not exists<br />
#mkdir /mnt/dvd<br />
2. Mount the DVD<br />
#mount -t auto /dev/dvd /mnt/dvd<br />
3.    Decompress the  sql file in a particular directory<br />
#cd /tmp<br />
#tar zxvf backup-yyyymmdd-hh.tar.gz<br />
4.    A .sql file will be decompress<br />
5.    Restore a specific database using the mysql command<br />
#mysql -u root -p databasename &lt; backup-yyyymmdd-hh.sql</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freelinuxtutorials.com/tutorials/how-to-backup-data-on-rhelcentos-via-dvd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Full &amp; Incremental MySQL Backup via Mysql-ZRM</title>
		<link>http://www.freelinuxtutorials.com/tutorials/full-incremental-mysql-backup-via-mysql-zrm/</link>
		<comments>http://www.freelinuxtutorials.com/tutorials/full-incremental-mysql-backup-via-mysql-zrm/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 03:06:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[RHEL]]></category>

		<guid isPermaLink="false">http://www.freelinuxtutorials.com/?p=305</guid>
		<description><![CDATA[mysql-zrm is short for Zmanda Recovery Manager for MySQL. It lets you create full logical or raw backups of your databases , generate reports about the backups, verify the integrity of the backups, and recover your databases. It can also send email notifcations about the backup status, and you can implement multiple backup policies. This [...]]]></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/full-incremental-mysql-backup-via-mysql-zrm/"></g:plusone></div><p>mysql-zrm is short for Zmanda Recovery Manager for MySQL. It lets you create full logical or raw backups of your databases , generate reports about the backups, verify the integrity of the backups, and recover your databases. It can also send email notifcations about the backup status, and you can implement multiple backup policies.</p>
<p>This procedure was successfully tested and implemented on CentOS 5.X and RHEL 5.X servers.<br />
Pre-requisites:<br />
1.mysql client, MySQL server 4.1 and above<br />
2.perl-DBI and perl-XML-Parser<br />
yum install perl-DBI perl-XML-Parser</p>
<p>Installation:</p>
<p>1.Download mysql-zrm on http://www.zmanda.com/download-zrm.php<br />
2.Get the RPM<br />
wget http://www.zmanda.com/downloads/community/ZRM-MySQL/2.1.1/RPM/MySQL-zrm-2.1.1-1.noarch.rpm<br />
3.Install<br />
rpm -ivh MySQL-zrm-2.1.1-1.noarch.rpm</p>
<p>-The executable files have been moved to /usr/bin, the configuration files are in /etc/mysql-zrm<br />
Important executable files are:</p>
<p>mysql-zrm<br />
mysql-zrm-reporter<br />
mysql-zrm-scheduler</p>
<p>4.Create a backup user in MySQL<br />
mysql&gt;GRANT ALL ON *.* TO &#8216;backup_user&#8217;@localhost IDENTIFIED BY &#8216;backup_pass&#8217;;<br />
mysql&gt; flush privileges;</p>
<p>Configuration:</p>
<p>Main configuration file is /etc/mysql-zrm/mysql-zrm.conf.</p>
<p>Fill important configuration:<br />
vi /etc/mysql-zrm/mysql-zrm.conf</p>
<p>1.Backup level, use 0 for full, 1 is incremental,default is full backup<br />
backup-level=0<br />
2.Backup method,either “raw” or “logical”.use logical<br />
backup-mode=logical</p>
<p>3.Backup type,use regular<br />
backup-type=regular<br />
4.Destination, directory where backups will be stored, default is /var/lib/mysql-zrm. You can specify the location here<br />
destination=/mysql-backup<br />
5.Retention policy, specify in days (D), week(W),months (M) or years(Y)<br />
retention-policy=6M<br />
6.If mysql zrm is done on replication slave, set replication to 1<br />
replication=1<br />
7.Set compression using gzip<br />
compress=1<br />
8.Set all databases of backup set<br />
all-databases=1<br />
9.Specify list of databases ,multiple database separated by space.<br />
databases=database1 database2 database3<br />
10.Set MySQL user parameter<br />
user=backup_user<br />
11.Set MySQL pass<br />
password=backup_pass<br />
12.Host of MySQL server<br />
host=localhost<br />
13.Set mailto adddress<br />
mailto=email@freelinuxtutorials.com<br />
14.Set backup reports<br />
html-reports=backup-status-info<br />
15.Directory where the reports will be created<br />
html-report-directory=/var/www/html/mysql-zrm/reports/</p>
<p>Here&#8217;s what it looks like: (mysql-zrm.conf)</p>
<p>backup-level=0<br />
backup-mode=logical<br />
backup-type=regular<br />
destination=/mysql-backup<br />
retention-policy=6M<br />
compress=1<br />
all-databases=1<br />
user=backup_user<br />
password=backup_pass<br />
host=localhost<br />
mailto=email@freelinuxtutorials.com<br />
html-reports=backup-status-info<br />
html-report-directory=/var/www/html/mysql-zrm/reports/</p>
<p>Testing:</p>
<p>Create first backup in backup set dailyrun. This will immediatley back up all databases to the specified  directory and will also create directory $backupdir/dailyrun.</p>
<p>#mysql-zrm-scheduler &#8211;now &#8211;backup-set dailyrun &#8211;backup-level 0</p>
<p>Email notification will be sent out as well with the status of backup.</p>
<p>Reporting:</p>
<p>To generate a report about the backup status on the command line , execute:</p>
<p>#mysql-zrm-reporter &#8211;where backup-set=dailyrun &#8211;show backup-status-info</p>
<p>You can also generate few other reports with the following commands:</p>
<p>mysql-zrm-reporter &#8211;where backup-set=dailyrun &#8211;show backup-method-info<br />
mysql-zrm-reporter &#8211;where backup-set=dailyrun &#8211;show backup-retention-info<br />
mysql-zrm-reporter &#8211;where backup-set=dailyrun &#8211;show backup-performance-info<br />
mysql-zrm-reporter &#8211;where backup-set=dailyrun &#8211;show restore-full-info<br />
mysql-zrm-reporter &#8211;where backup-set=dailyrun &#8211;show restore-incr-info<br />
mysql-zrm-reporter &#8211;where backup-set=dailyrun &#8211;show replication-info</p>
<p>Scheduling:</p>
<p>To schedule daily incremental and weekly full backups, set this:</p>
<p>#mysql-zrm-scheduler &#8211;add &#8211;interval weekly &#8211;backup-set weeklyrun &#8211;backup-level 0<br />
#mysql-zrm-scheduler &#8211;add &#8211;interval daily &#8211;backup-set dailyrun &#8211;backup-level 1</p>
<p>Check:</p>
<p># mysql-zrm-scheduler &#8211;query<br />
schedule:INFO: ZRM for MySQL Community Edition &#8211; version 2.1.1<br />
Logging to /var/log/mysql-zrm/mysql-zrm-scheduler.log<br />
0 2 * * 0 /usr/bin/zrm-pre-scheduler &#8211;action backup &#8211;backup-set weeklyrun &#8211;backup-level 0 &#8211;interval weekly<br />
0 3 * * * /usr/bin/zrm-pre-scheduler &#8211;action backup &#8211;backup-set dailyrun &#8211;backup-level 1 &#8211;interval daily</p>
<p>Or use “crontab -l” to get same information</p>
<p>If you want to start your daily backup at different time, let say at 1:30AM</p>
<p>mysql-zrm-scheduler &#8211;add &#8211;interval daily &#8211;backup-set dailyrun &#8211;start 1:30 &#8211;backup-level 1</p>
<p>Customized HTML Reports</p>
<p>To create HTML file backup-status-dailyrun.html in /var/www/html/mysql-zrm,execute this:</p>
<p>#mysql-zrm-reporter &#8211;show backup-status-info &#8211;where backup-set=dailyrun &#8211;type html &#8211;output /var/www/html/mysql-zrm/backup-status-dailyrun.html</p>
<p>Verifying Backups:</p>
<p>To check integrity of backup set in dailyrun, use:</p>
<p>#mysql-zrm &#8211;action verify-backup &#8211;backup-set dailyrun</p>
<p>Output something like this:</p>
<p>Use of uninitialized value in concatenation (.) or string at /usr/bin/mysql-zrm line 1305.<br />
INFO: mysql-zrm-version<br />
INFO: Verification successful</p>
<p>Data Recovery</p>
<p>1.To restore data from our MySQL backups, run this command first to find which backups are available.</p>
<p>2. If incremental in daily,</p>
<p>#mysql-zrm-reporter -show restore-info &#8211;where backup-set=dailyrun</p>
<p>Sample:</p>
<p># mysql-zrm-reporter -show restore-info &#8211;where backup-set=dailyrun</p>
<p>REPORT TYPE : restore-info</p>
<p>backup_set  backup_date                  backup_level  backup_directory                          backup_status         comment<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
dailyrun  Thu 14 Jan 2010 03:00:02                1  /mysql-backup/dailyrun/20100114030002     Backup succeeded      &#8212;-<br />
AM SGT<br />
dailyrun  Wed 13 Jan 2010 05:35:53                1  /mysql-backup/dailyrun/20100113173553     Backup succeeded      &#8212;-<br />
PM SGT<br />
dailyrun  Wed 13 Jan 2010 05:35:24                1  /mysql-backup/dailyrun/20100113173524     Backup succeeded      &#8212;-<br />
PM SGT<br />
dailyrun  Wed 13 Jan 2010 05:34:48                0  /mysql-backup/dailyrun/20100113173448     Backup succeeded      &#8212;-<br />
PM SGT</p>
<p>Restore:<br />
If we want to restore the incremental backup  20100113173553, then issue the command.</p>
<p>#mysql-zrm &#8211;action restore &#8211;source-directory /mysql-backup/dailyrun/20100113173553 &#8211;backup-set dailyrun</p>
<p>3.If full backup need to restore, first verify the full backup<br />
#mysql-zrm-reporter -show restore-info &#8211;where backup-set=weeklyrun</p>
<p>Sample Output:<br />
# mysql-zrm-reporter -show restore-info &#8211;where backup-set=weeklyrun</p>
<p>REPORT TYPE : restore-info</p>
<p>backup_set  backup_date                  backup_level  backup_directory                          backup_status         comment<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
weeklyrun  Wed 13 Jan 2010 05:56:51                0  /mysql-backup/weeklyrun/20100113175651    Backup succeeded      &#8212;-                      PM SGT</p>
<p>Restore:</p>
<p>#mysql-zrm &#8211;action restore &#8211;source-directory /mysql-backup/weeklyrun/20100113175651 &#8211;backup-set weeklyrun</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freelinuxtutorials.com/tutorials/full-incremental-mysql-backup-via-mysql-zrm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Tomcat</title>
		<link>http://www.freelinuxtutorials.com/tutorials/installing-tomcat/</link>
		<comments>http://www.freelinuxtutorials.com/tutorials/installing-tomcat/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 17:02:01 +0000</pubDate>
		<dc:creator>tux</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://www.freelinuxtutorials.com/?p=285</guid>
		<description><![CDATA[Tomcat,known as Apache Tomcat or Jakarta Tomcat is a servlet container developed by ASF or Apache Software Foundation. It implements the JavaServer Pages (JSP) and Java Servlet specifications from Sun Microsystems. To make it simple, it is use as a java http web server environment where you can run your Java code. This is 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/installing-tomcat/"></g:plusone></div><p>Tomcat,known as Apache Tomcat or Jakarta Tomcat is a servlet container developed by ASF or Apache Software Foundation. It implements the JavaServer Pages (JSP) and Java Servlet specifications from Sun Microsystems. To make it simple, it is use as a java http web server environment where you can run your Java code.</p>
<p>This is a brief tutorial on installing and running tomcat in Linux.</p>
<p>Prerequisites:<br />
Java SDK should be installed.</p>
<p>Tested in CentOS 5.X</p>
<p>1. Download Java SDK from sun.com website</p>
<p>http://java.sun.com/javaee/downloads/index.jsp</p>
<p>In this tutorial, we will be using Java EE 5 SDK</p>
<p>2. Install Java SDK, any location is ok<em>.</em></p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 60px; text-align: left;" dir="ltr">[root@flt ~]# cd /home/darwin
[root@flt darwin]# chmod +x java_ee_sdk-5_01-linux.bin
[root@flt darwin]# ./java_ee_sdk-5_01-linux.bin</pre>
<p>You will see something like this</p>
<p>[root@flt darwin]# ./java_ee_sdk-5_01-linux.bin<br />
Checking available disk space&#8230;<br />
Checking Java(TM) 2 Runtime Environment&#8230;<br />
Extracting Java(TM) 2 Runtime Environment files&#8230;<br />
Extracting installation files&#8230;<br />
Launching Java(TM) 2 Runtime Environment&#8230;</p>
<p>You are running the installation program for Java Platform, Enterprise Edition<br />
5 SDK. This program asks you to supply configuration preference settings that<br />
it uses to install the server.</p>
<p>Just follow the steps, type yes to agree, &#8220;&lt;&#8221; to go back, &#8220;!&#8221; to exits<br />
* set Java Environment Variables</p>
<p>Installation Directory [/opt/SDK] {&#8220;&lt;&#8221; goes back, &#8220;!&#8221; exits}:<strong> /home/darwin</strong><br />
Supply the admin user&#8217;s password and override any of the other initial<br />
configuration settings as necessary.<br />
Admin User [admin] {&#8220;&lt;&#8221; goes back, &#8220;!&#8221; exits}:<br />
Admin User&#8217;s Password (8 chars minimum):<br />
Re-enter Password:<br />
Do you want to store admin user name and password in .asadminpass file in<br />
user&#8217;s home directory [yes] {&#8220;&lt;&#8221; goes back, &#8220;!&#8221; exits}?<br />
Admin Port [4848] {&#8220;&lt;&#8221; goes back, &#8220;!&#8221; exits}:<br />
HTTP Port [8080] {&#8220;&lt;&#8221; goes back, &#8220;!&#8221; exits}:<br />
HTTPS Port [8181] {&#8220;&lt;&#8221; goes back, &#8220;!&#8221; exits}:</p>
<p>The following items for the product Java Platform, Enterprise Edition 5 SDK<br />
will be installed:</p>
<p>Product: Java Platform, Enterprise Edition 5 SDK<br />
Location: /home/darwin<br />
Space Required: 215.65 MB<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Java 2 SDK, Standard Edition 5.0<br />
Sun Java System Message Queue 4.0<br />
Sun Java System Application Server Platform Edition 9 Update 1<br />
Sample Applications<br />
Java BluePrints<br />
First Cup of Java Tutorial<br />
Open ESB Starter Kit with JBI and BPEL</p>
<p>Ready to Install</p>
<p>1. Install Now<br />
2. Start Over<br />
3. Exit Installation</p>
<p>What would you like to do [1] {&#8220;&lt;&#8221; goes back, &#8220;!&#8221; exits}? <strong>1</strong></p>
<p>Installing Java Platform, Enterprise Edition 5 SDK<br />
|-1%&#8212;&#8212;&#8212;&#8212;&#8211;25%&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;50%&#8211;Dec 9, 2009 6:52:55 AM com.sun.jbi.installer.OpenEsbInstaller main<br />
INFO: OpenESB Starter Kit successfully installed in /home/darwin/addons/jbi<br />
&#8212;&#8212;&#8212;&#8212;&#8212;75%&#8212;&#8212;&#8212;&#8212;&#8211;100%|</p>
<p>Installation Successful.</p>
<p>3.Set the Java Environment variables</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 140px; text-align: left;" dir="ltr">[root@flt ~]# export JAVA_HOME=/home/darwin/jdk
[root@flt ~]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@flt ~]# export PATH=$PATH:${JAVA_HOME}/bin
[root@flt ~]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/home/darwin/jdk/bin</pre>
<p>4. Test Java by displaying the version</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 20px; text-align: left;" dir="ltr">[root@flt ~]# java -version</pre>
<p>java version &#8220;1.5.0_09&#8243;<br />
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b03)<br />
Java HotSpot(TM) Client VM (build 1.5.0_09-b03, mixed mode)</p>
<p>5. Download  Tomcat  from tomcat.apache.org website</p>
<p>if you want to download apache tomcat ver.5.5.x, get it from http://tomcat.apache.org/download-55.cgi</p>
<p>For this tutorial, we will be downloading and installing version 6.0, get it from http://tomcat.apache.org/download-60.cgi</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 40px; text-align: left;" dir="ltr">#cd /usr/local/src
# wget http://www.ip97.com/apache.org/tomcat/tomcat-6/v6.0.20/bin/apache-tomcat-6.0.20.tar.gz</pre>
<p>6.Extract the binary tarball file</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 20px; text-align: left;" dir="ltr">[root@flt src]# tar zxvf apache-tomcat-6.0.20.tar.gz</pre>
<p>7. Install Tomcat</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 180px; text-align: left;" dir="ltr">[root@flt src]# cd apache-tomcat-6.0.20
[root@flt apache-tomcat-6.0.20]# cd bin
[root@flt bin]# tar zxvf jsvc.tar.gz
[root@flt bin]# cd jsvc-src/
[root@flt jsvc-src]# chmod +x configure
[root@flt jsvc-src]# ./configure
[root@flt jsvc-src]#make
[root@flt jsvc-src]#cp jsvc ..
[root@flt jsvc-src]#cd ..</pre>
<p>8. Run tomcat</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 20px; text-align: left;" dir="ltr">[root@flt bin]# ./startup.sh</pre>
<p>It will show something like:<br />
Using CATALINA_BASE:   /usr/local/src/apache-tomcat-6.0.20<br />
Using CATALINA_HOME:   /usr/local/src/apache-tomcat-6.0.20<br />
Using CATALINA_TMPDIR: /usr/local/src/apache-tomcat-6.0.20/temp<br />
Using JRE_HOME:       /home/darwin/jdk</p>
<p>9. Using your favorite browser, type http://serverip:8080</p>
<p>You should see the Apache tomcat default homepage, meaning tomcat was successfully installed</p>
<p>Notes: If you did not see the default tomcat page, you can try this following troubleshooting steps<br />
a. Check if tomcat is running using ps<br />
e.g.</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 20px; text-align: left;" dir="ltr">[root@flt bin]# ps -ef |grep tomcat</pre>
<p>It will show something like:<br />
root      5872     1  1 07:24 pts/2    00:00:03 /home/darwin/jdk/bin/java<br />
-Djava.util.logging.config.file=/usr/local/src/apache-tomcat-6.0.20/conf/logging.properties<br />
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager<br />
-Djava.endorsed.dirs=/usr/local/src/apache-tomcat-6.0.20/endorsed -classpath<br />
:/usr/local/src/apache-tomcat-6.0.20/bin/bootstrap.jar -Dcatalina.base=/usr/local/src/apache-tomcat-6.0.20<br />
-Dcatalina.home=/usr/local/src/apache-tomcat-6.0.20 -Djava.io.tmpdir=/usr/local/src/apache-tomcat-6.0.20/temp org.apache.catalina.startup.Bootstrap start</p>
<p>b.check if tcp port 8080 is open or on &#8220;LISTEN&#8221; status<br />
e.g.</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 20px; text-align: left;" dir="ltr">[root@flt bin]# netstat -an |grep 8080</pre>
<p>It will show something like:<br />
tcp        0      0 :::8080                     :::*                        LISTEN</p>
<p>* you can also use nmap port scanner to verify</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 20px; text-align: left;" dir="ltr">[root@flt bin]# nmap localhost</pre>
<p>If port is open, you can see something like:<br />
8080/tcp open  http-proxy</p>
<p>c. check if the tcp port 8080 is allowed in your iptables, if you don&#8217;t have a customized script, you can add it on your &#8220;setup&#8221; firewall configuration or in your /etc/sysconfig iptables, add this</p>
<p>-A RH-Firewall-1-INPUT -p tcp -m state &#8211;state NEW -m tcp &#8211;dport 8080 -j ACCEPT</p>
<p>10. Test tomcat if it can display html</p>
<p>a. Go to webapps/ROOT in the tomcat directory and create a test page titled test.html and write in it</p>
<p>This is a tomcat test html page!</p>
<p>b. Open the URL http://serverip:8080/test.html you should see your page</p>
<p>11. Test tomcat if it can display java server pages (jsp)</p>
<p>a. Go to webapps/ROOT in the tomcat directory and create page test.jsp and write in it:</p>
<p>&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Hello World&lt;/title&gt;<br />
&lt;%!<br />
String message = &#8220;Hello World!Tomcat is running.&#8221;;<br />
%&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;hr color=&#8221;#000000&#8243; /&gt;<br />
&lt;center&gt;<br />
&lt;h2&gt;&lt;font color=&#8221;#3366cc&#8221;&gt;&lt;%= message%&gt;&lt;/font&gt;&lt;/h2&gt;<br />
&lt;h3&gt;&lt;font color=&#8221;#0000ff&#8221;&gt;&lt;%= new java.util.Date() %&gt; &lt;/font&gt;&lt;/h3&gt;<br />
&lt;hr color=&#8221;#000000&#8243; /&gt;<br />
&lt;/center&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
b.save and open in your browser, http://serveriplocalhost:8080/test.jsp</p>
<p>you should see the &#8220;Hello World!Tomcat is running&#8221; and below that is the current date</p>
<p>11. Shutting down tomcat process<br />
a. Go to tomcat bin directory</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 20px; text-align: left;" dir="ltr">[root@flt bin]# ./shutdown.sh</pre>
<p>It will display something like:<br />
Using CATALINA_BASE:   /usr/local/src/apache-tomcat-6.0.20<br />
Using CATALINA_HOME:   /usr/local/src/apache-tomcat-6.0.20<br />
Using CATALINA_TMPDIR: /usr/local/src/apache-tomcat-6.0.20/temp<br />
Using JRE_HOME:       /home/darwin/jdk</p>
<p>Quick Tip: Installing as a service and auto-boot in start up</p>
<p>A.  Create tomcat file under /etc/init.d directory and put the script below</p>
<p>[root@flt bin]# cd /etc/init.d/<br />
[root@flt init.d]# vi tomcat</p>
<p>here&#8217;s the script:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p># This is the init script for starting up the<br />
#  Jakarta Tomcat server<br />
#<br />
# chkconfig: 345 91 10<br />
# description: Starts and stops the Tomcat daemon.<br />
#</p>
<p># Source function library.<br />
. /etc/rc.d/init.d/functions</p>
<p># Get config.<br />
. /etc/sysconfig/network</p>
<p># Check that networking is up.<br />
[ "${NETWORKING}" = "no" ] &amp;&amp; exit 0</p>
<p>tomcat=/usr/local/src/apache-tomcat-6.0.20<br />
startup=$tomcat/bin/startup.sh<br />
shutdown=$tomcat/bin/shutdown.sh<br />
export JAVA_HOME=/home/dar/jdk</p>
<p>start(){</p>
<p>echo -n $&#8221;Starting Tomcat service: &#8221;<br />
#daemon -c<br />
$startup<br />
RETVAL=$?<br />
echo<br />
}</p>
<p>stop(){<br />
action $&#8221;Stopping Tomcat service: &#8221; $shutdown<br />
RETVAL=$?<br />
echo<br />
}</p>
<p>restart(){<br />
stop<br />
start<br />
}</p>
<p># See how we were called.<br />
case &#8220;$1&#8243; in<br />
start)<br />
start<br />
;;<br />
stop)<br />
stop<br />
;;<br />
status)<br />
# This doesn&#8217;t work <img src='http://www.freelinuxtutorials.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
status tomcat<br />
;;<br />
restart)<br />
restart<br />
;;<br />
*)<br />
echo $&#8221;Usage: $0 {start|stop|status|restart}&#8221;<br />
exit 1<br />
esac</p>
<p>exit 0</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>B. Replace the variables based on your setup:</p>
<p>tomcat=/usr/local/src/apache-tomcat-6.0.20<br />
startup=$tomcat/bin/startup.sh<br />
shutdown=$tomcat/bin/shutdown.sh<br />
export JAVA_HOME=/home/dar/jdk</p>
<p>C. Make tomcat file executable</p>
<p>[root@flt init.d]# chmod 755 tomcat</p>
<p>D.  Try to start and stop tomcat by issuing the command</p>
<p>[root@flt init.d]# service tomcat start<br />
[root@flt init.d]# service tomcat stop</p>
<p>E.  Type &#8220;setup&#8221; to check under System services if &#8220;tomcat&#8221; already selected to boot during start-up,if not you can issue this command</p>
<p>[root@flt init.d]# chkconfig &#8211;add tomcat</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freelinuxtutorials.com/tutorials/installing-tomcat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Asterisk 1.2 and Asterisk Management Portal</title>
		<link>http://www.freelinuxtutorials.com/tutorials/installing-asterisk-1-2-and-asterisk-management-portal/</link>
		<comments>http://www.freelinuxtutorials.com/tutorials/installing-asterisk-1-2-and-asterisk-management-portal/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 07:51:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[asterisk]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.freelinuxtutorials.com/?p=261</guid>
		<description><![CDATA[Obviously, this is really an old procedure, actually this is my documentation way back early 2006 when it&#8217;s my first time to work with asterisk. This procedure was implemented before in about 30-50 call center agents using softphones and it quite worked well. So many things have changed, as we all know, from asterisk 1.2 [...]]]></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-asterisk-1-2-and-asterisk-management-portal/"></g:plusone></div><p>Obviously, this is really an old procedure, actually this is my documentation way back early 2006 when it&#8217;s my first time to work with asterisk. This procedure was implemented before in about 30-50 call center agents using softphones and it quite worked well.</p>
<p>So many things have changed, as we all know, from asterisk 1.2 to asterisk 1.6 , and Asterisk Management Portal is popularly known now as FreePBX. Other packages were also updated now, many changes but still asterisk is standing there as the best open source telephony system.  We had many community and commercial PBX softwares today that are asterisk-based, that&#8217;s how big asterisk right now comparing back 2006 <img src='http://www.freelinuxtutorials.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The convenience of installing asterisk is easier as well today, just burn the ISO and you are good to go,mostly managed thru web interface. You can even install asterisk in just one line command once you put asterisk repository in your config.</p>
<p>As easy as &#8221; yum install asterisk16&#8243;</p>
<p>Here are my step-by-step procedure (old documentation). AMP was used not only to ease us from asterisk administration but to educate us as well on how things will change or how the dial plan will work. Of course, still the geeky way is to write your own dial-plan, but it will soon cover on this tutorial, as well as updated asterisk installation.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>This configuration  was created and tested on:</p>
<p>Fedora Core 4 (run yum –y update for updated kernel and packages)</p>
<p>Intel Xeon 3.2 GHz/Intel Celeron 2.4 GHz</p>
<p>2 GB RAM/256 MB RAM</p>
<p>10/100 Mbps LAN card<br />
Standard configuration, no extra hardware</p>
<h1><span style="text-decoration: underline;">Asterisk</span></h1>
<p>1. Login to your server as root</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 20px; text-align: left;" dir="ltr">#cd /usr/src</pre>
<p>2. Download Asterisk stable distribution tarball from <a href="http://www.asterisk.org/">www.asterisk.org</a> or <a href="ftp://ftp.digium.com/">ftp.digium.com</a> ,including all needed addons and packages of Asterisk Management Portal (AMP) as follow: (you can get them using wget command or obtain source code from CVS)</p>
<p>asterisk-1.2.x.tar.gz</p>
<p>zaptel-1.2.x.tar.gz</p>
<p>libpri-1.2.x.tar.gz</p>
<p>asterisk-addons-1.2.x.tar.gz</p>
<p>asterisk-sounds-1.2.x.tar.gz</p>
<p>AMP:</p>
<p>mime-construct-1.x.tar.gz</p>
<p>asterisk-perl-0.0x.tar.gz</p>
<p>mpg123-0.xxr.tar.gz (optional for musiconhold)</p>
<p>AMP-1.10.x.tar.gz</p>
<p>spandsp-0.0.x.tar.gz</p>
<p>lame-3.96.1-2.x.el4.rf.i386.rpm</p>
<p>3. Uncompress all tarball file</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 180px; text-align: left;" dir="ltr">#tar zxvf asterisk-1.2.x.tar.gz
#tar zxvf  zaptel-1.2.x.tar.gz
#tar zxvf libpri-1.2.x.tar.gz
#tar zxvf asterisk-addons-1.2.x.tar.gz
#tar zxvf asterisk-sounds-1.2.x.tar.gz
#tar zxvf mime-construct-1.x.tar.gz
#tar zxvf  asterisk-perl-0.08.tar.gz
#tar zxvf mpg123-0.59r.tar.gz
#tar zxvf AMP-1.10.010.tar.gz
#tar zxvf spandsp-0.0.2.tar.gz</pre>
<p>3.1 Install lame rpm</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 20px; text-align: left;" dir="ltr">#rpm –ivh lame-3.96.1-2.2.el4.rf.i386.rpm</pre>
<p>4. Compiling Zaptel</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 80px; text-align: left;" dir="ltr">#cd /usr/src/ zaptel-version
#make clean
#make
#make install</pre>
<p>5. Compiling libpri</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 80px; text-align: left;" dir="ltr">#cd /usr/src/libpri-version
#make clean
#make
#make install</pre>
<p>6. Compiling Asterisk</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 120px; text-align: left;" dir="ltr">#cd /usr/src/asterisk-version
#make clean
#make
#make install
#make samples
#make progdocs (optional)</pre>
<p>7. Compiling Asterisk-sounds</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 40px; text-align: left;" dir="ltr">#cd /usr/src/asterisk-sounds-version
#make install</pre>
<p>8. Compiling Asterisk-addons</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 60px; text-align: left;" dir="ltr">#cd /usr/src/asterisk-addons-version
#make
#make install</pre>
<h1>Asterisk Management Portal</h1>
<p>1. The following packages need to be installed with yum:</p>
<p>● libxml2</p>
<p>● libtiff</p>
<p>● libtiff-devel</p>
<p>● httpd</p>
<p>● mysql</p>
<p>● mysql-devel</p>
<p>● mysql-server</p>
<p>● php</p>
<p>● php-gd</p>
<p>● php-mysql</p>
<p>● php-pear</p>
<p>● openssl</p>
<p>● openssl-devel</p>
<p>● kernel-devel</p>
<p>● perl</p>
<p>● perl-CPAN</p>
<p>● cvs</p>
<p>● bison</p>
<p>● ncurses-devel</p>
<p>● audiofile-devel</p>
<p>e.g. #yum install libtiff-devel</p>
<p>2. Installed needed perl  module dependencies:</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 80px; text-align: left;" dir="ltr">#perl -MCPAN -e "install Net::Telnet"
#perl -MCPAN -e "install IPC::Signal"
#perl -MCPAN -e "install Proc::WaitStat"
#perl -MCPAN -e "install MIME::Types"</pre>
<p>3. Compiling mime-construct</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 60px; text-align: left;" dir="ltr">#cd /usr/src/mime-construct-version
#perl Makefile.PL
#make install</pre>
<p>4. Compiling asterisk-perl</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 60px; text-align: left;" dir="ltr">#cd /usr/src/asterisk-perl-version
#perl Makefile.PL
#make install</pre>
<p>5. Compiling mpg123</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 60px; text-align: left;" dir="ltr">#cd /usr/src/mpg123-version
#make linux
#make install</pre>
<p>6. Compiling spandsp</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 80px; text-align: left;" dir="ltr">#cd /usr/src/spandsp-version
#./configure
#make
#make install</pre>
<p>7.Create a group and non-root user</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 40px; text-align: left;" dir="ltr"># groupadd asterisk
# useradd -c "asterisk PBX" -d /var/lib/asterisk -u 5060 -g  asterisk asterisk</pre>
<p>XXXX 8. Building/Compiling Asterisk to run as our non-root user</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 60px; text-align: left;" dir="ltr">#mkdir /var/run/asterisk
#cd /usr/src/asterisk-version
#make &amp;&amp;  make install</pre>
<p>9. Install Asterisk sound</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 40px; text-align: left;" dir="ltr">#cd /usr/src/asterisk-sounds-version
#make install</pre>
<p>10. Setting up MySQL for CDR (Call Detail Reports)</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 220px; text-align: left;" dir="ltr">#/usr/bin/mysql_install_db
#service mysqld start
# mysqladmin -u root password 'blackxxxxxx'
# mysqladmin create asteriskcdrdb -p
Enter password:
# mysql -u root -p asteriskcdrdb &lt; /
usr/src/AMP/SQL/cdr_mysql_table.sql
#mysql -u root -p
mysql&gt; GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY 'amp109';
Query OK, 0 rows affected (0.00 sec)
mysql&gt; exit</pre>
<p>11. Build/Compile cdr_mysql module for Asterisk</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 120px; text-align: left;" dir="ltr">#cd /usr/src/asterisk-addons-version
# perl -p -i.bak -e \
&gt; 's/CFLAGS.*D_GNU_SOURCE/CFLAGS+=-D_GNU_SOURCE\nCFLAGS+=-
DMYSQL_LOGUNIQUEID/' \
&gt; Makefile
# make &amp;&amp; make install</pre>
<p>12. Setup MySQL for AMP web interface</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 100px; text-align: left;" dir="ltr"># mysqladmin create asterisk -p
# mysql -u root -p asterisk &lt; /
usr/src/AMP/SQL/newinstall.sql
# mysql -u root -p
mysql&gt; GRANT ALL PRIVILEGES
-&gt; ON asterisk.*
-&gt; TO asteriskuser@localhost
-&gt; IDENTIFIED BY 'amp109';
Query OK, 0 rows affected (0.00 sec)
mysql&gt; \q</pre>
<p>13. Apply the AMP/Asterisk configuration files</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 40px; text-align: left;" dir="ltr">#cd /usr/src/AMP
# ./install_amp</pre>
<p>14. Edit Apache/PHP environment</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 20px; text-align: left;" dir="ltr">#vi /etc/php.ini</pre>
<p>Edit such that the line looks like this:</p>
<p>upload_max_filesize = 20M</p>
<p>Chown the PHP session.save_path directory:</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 20px; text-align: left;" dir="ltr">
#chown asterisk /var/lib/php/session/
</pre>
<p>Edit /etc/httpd/conf.d/php.conf such that it lincludes:</p>
<p>&lt;Files *.php&gt;</p>
<p>SetOutputFilter PHP</p>
<p>SetInputFilter PHP</p>
<p>LimitRequestBody 20000000</p>
<p>&lt;/Files&gt;</p>
<p>15. Edit web server configuration file</p>
<p>Edit /etc/httpd/conf/httpd.conf such that:</p>
<p>User asterisk</p>
<p>Group asterisk</p>
<p>and:</p>
<p>#Password protect /var/www/html/admin</p>
<p>&lt;Directory /var/www/html/admin&gt;</p>
<p>AuthType Basic</p>
<p>AuthName &#8220;Restricted Area&#8221;</p>
<p>AuthUserFile /usr/local/apache/passwd/wwwpasswd</p>
<p>Require user wwwadmin</p>
<p>&lt;/Directory&gt;</p>
<p>To create the wwwpasswd file:</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 140px; text-align: left;" dir="ltr">
# vi /etc/httpd/conf.d/php.conf
# vi /etc/httpd/conf/httpd.conf
# mkdir /usr/local/apache
# mkdir /usr/local/apache/passwd
# htpasswd -c /usr/local/apache/passwd/wwwpasswd wwwadmin
New password:
Re-type new password:
</pre>
<p>Adding password for user wwwadmin<br />
16. amportal control script</p>
<p>The amportal script is the recommended way to stop and start asterisk:</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 40px; text-align: left;" dir="ltr"># /usr/sbin/amportal stop
# /usr/sbin/amportal start</pre>
<p>17. Automatic startup</p>
<p>Add the following line on /etc/rc.local</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 20px; text-align: left;" dir="ltr">/usr/sbin/amportal start</pre>
<p>Make sure also httpd and  mysqld services ( type setup on console, then go to System Services, and select httpd and mysqld, or you can use chkconfig –add command)</p>
<p>17. Reboot and access the AMP administration interface</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 20px; text-align: left;" dir="ltr">#shutdown -r now</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.freelinuxtutorials.com/tutorials/installing-asterisk-1-2-and-asterisk-management-portal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOS LAMP Installation</title>
		<link>http://www.freelinuxtutorials.com/tutorials/centos-lamp-installation/</link>
		<comments>http://www.freelinuxtutorials.com/tutorials/centos-lamp-installation/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 14:01:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.freelinuxtutorials.com/?p=190</guid>
		<description><![CDATA[There&#8217;s an easy way of installing Apache, Mysql and PHP and it&#8217;s via yum. You can install or update httpd,mysql-server and php, php-mysql and some minor changes on your configuration files and you&#8217;re good to go. Well, the procedure below is one way to install also, if you&#8217;re quite bored and want to develop your [...]]]></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/centos-lamp-installation/"></g:plusone></div><p>There&#8217;s an easy way of installing Apache, Mysql and PHP and it&#8217;s via yum. You can install or update httpd,mysql-server and php, php-mysql and some minor changes on your configuration files and you&#8217;re good to go. Well, the procedure below is one way to install also, if you&#8217;re quite bored and want to develop your sysadmin skills.</p>
<p><strong>I. Operating System Installation</strong></p>
<p>1.    The typical type of installation is thru  CD-ROM or DVD. If you want network install, you should have a CentOS boot disk to boot the server</p>
<p>How to create boot disk?<br />
A. how to create boot disk in linux<br />
a. insert CD then copy boot.iso to a folder</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
#cp boot.iso /home/test/
</pre>
<p>b.unmount the cd-rom</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
#cd; eject
</pre>
<p>c. Insert the blank cdr and find the dev name</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
cdrecord -scanbus
</pre>
<p>d. Write the .iso to that blank cd</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
#cdrecord -v -dao dev=1,2,3 /home/test/boot.iso
</pre>
<p>the 1,2,3 value is just a sample. Just replace it with the actual device name that you get upon running<br />
the cdrecord -scanbus.</p>
<p>B. how to create boot disk in windows<br />
a. copy boot.iso in any folder<br />
b. run your favorite cd burning program and open boot.iso<br />
c. start the cd writing process</p>
<p>2.    Assign a static IP address &amp; the hostname for the server.</p>
<p>3.    Select network install from FTP or NFS depends on your setup<br />
ex:<br />
ftp: 192.168.17.100<br />
path: /pub/centos5</p>
<p>Setting up NFS or FTP is discussed on the other tutorial</p>
<p>4.    When finish, do the update. The -y parameter denotes automatic update and install of the package, no more prompt.</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
#yum –y update
</pre>
<p>5.    Configure the file “network” at /etc/sysconfig/network with the following lines.</p>
<p>NETWORKING=yes<br />
NETWORKING_IPV6=yes<br />
HOSTNAME=localhost.localdomain</p>
<p>6.    Configure the file “ifcfg-eth0” at /etc/sysconfig/network-scripts/ifcfg-eth0 with the following lines.</p>
<p># Broadcom  Gigabit Ethernet<br />
DEVICE=eth0<br />
ONBOOT=yes<br />
BOOTPROTO=static<br />
HWADDR=00:29:EE:F2:45:4L<br />
IPADDR=Static IP Address (Example: 192.168.17.5)<br />
NETMASK=Subnet Mask (Example: 255.255.255.0)<br />
GATEWAY=Gateway IP address (Example: 192.168.17.1)</p>
<p>7.    Configure the file “hosts” at /etc/hosts with the following lines. (optional)</p>
<p># Do not remove the following line, or various programs<br />
# that require network functionality will fail.<br />
127.0.0.1               localhost.localdomain localhost<br />
10.0.0.174              c5.freelinuxtutorials.com c5 (Add the server hostname here)<br />
::1             localhost6.localdomain6 localhost6</p>
<p>8.    Configure your DNS  at /etc/resolv.conf with the following lines.</p>
<p>nameserver Primary DNS (Example: 192.168.17.228)<br />
search freelinuxtutorials.com</p>
<p>9.    Restart the network interface by the following commands.</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
#service network restart
</pre>
<p>10.   Close unnecessary services via the &#8220;setup&#8221; menu tool or  use chkconfig to turn off auto start of certain services<br />
e.g.</p>
<p>#chkconfig cups off<br />
#chkconfig nfslock off</p>
<p>11.     After first restart, check your logs to see some errors</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 40px; text-align: left;" dir="ltr">
cat /var/log/messages |grep error
cat /var/log/messages |grep warning
</pre>
<p><strong>II. </strong><strong>Apache Installation</strong></p>
<p>1.    Apache can be installed as package during custom selection of packages on the installation process, labeled as &#8220;Web Server&#8221;</p>
<p>2.   Make Apache service start on boot-up via:</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
# chkconfig httpd on
</pre>
<p>Let say the default version of your apache is 2.2.3 and you want to upgrade it to the latest version</p>
<p>UPGRADING OF APACHE 2.2.3 TO APACHE 2.2.4</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
1.    # yum remove httpd
</pre>
<p>Removing:<br />
httpd                   x86_64        2.2.3-7.el5.centos  installed         2.9 M<br />
Removing for dependencies:<br />
httpd-devel             x86_64     2.2.3-7.el5.centos   installed         512 k<br />
httpd-devel             i386         2.2.3-7.el5.centos   installed         512 k</p>
<p>2.    </p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
shell#  rm –rf  php-5.2.3
</pre>
<p>3.    Download httpd-2.2.4-4.x86_64.rpm from http://rpmfind.net/<br />
4.    Download httpd-devel-2.2.4-4.x86_64.rpm from http://rpmfind.net/<br />
5.    Download lib64db4.5-4.5.20-1mdv2007.1.x86_64.rpm http://rpmfind.net/<br />
6.    Install lib64db4.5-4.5.20-1mdv2007.1.x86_64.rpm</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
Shell# rpm –Uvih lib64db4.5-4.5.20-1mdv2007.1.x86_64.rpm
</pre>
<p>7.    Install httpd-2.2.4-4.x86_64.rpm</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
Shell# rpm –Uvih httpd-2.2.4-4.x86_64.rpm
</pre>
<p>8.    Install httpd-devel-2.2.4-4.x86_64.rpm</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
Shell# rpm –Uvih httpd-devel-2.2.4-4.x86_64.rpm
</pre>
<p>G.   <strong>MySQL Installation</strong></p>
<p>1.    Download the MySQL software at http://www.mysql.org.</p>
<p>2.    Select Linux Source to download. File name should be “mysql-5.0.41.tar.gz”</p>
<p>3.    Before installation, ensure that gcc compiler has installed. Please verify by</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
gcc –v
</pre>
<p>If gcc does not install, please install it by</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
yum install gcc
</pre>
<p>4.    Install gcc-c++ compiler by</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
yum install gcc-c++
</pre>
<p>5.    Install the ncurses-devel library by</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
yum install ncurses-devel
</pre>
<p>It is require by the MySQL during compile process.</p>
<p>6.    Run the following commands.</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 300px; text-align: left;" dir="ltr">
shell&gt; groupadd mysql
shell&gt; useradd -g mysql mysql
shell&gt; gunzip &lt; mysql-VERSION.tar.gz | tar -xvf -
shell&gt; cd mysql-VERSION
shell&gt; ./configure --prefix=/usr/local/mysql
shell&gt; make
shell&gt; make install
shell&gt; cp support-files/my-medium.cnf /etc/my.cnf
shell&gt; cd /usr/local/mysql
shell&gt; chown -R mysql .
shell&gt; chgrp -R mysql .
shell&gt; bin/mysql_install_db --user=mysql
shell&gt; chown -R root .
shell&gt; chown -R mysql var
shell&gt; bin/mysqld_safe --user=mysql &amp;
</pre>
<p>7.    To make MySQL start automatically after reboot, do the following.</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 60px; text-align: left;" dir="ltr">
shell&gt; cp /mysql-VERSION/support-files/mysql.server /etc/init.d/mysql
shell&gt; chmod +x /etc/init.d/mysql
shell&gt; chkconfig --add mysql
</pre>
<p>8.    To test the MySQL, type the following command.</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
shell&gt;/usr/local/mysql/bin/mysqladmin version
</pre>
<p>If it can display the version, installation is preliminary success.</p>
<p>9.    Do the following simple testing.</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
shell&gt;mysql
</pre>
<p>mysql&gt; show databases;<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| Database           |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| information_schema |<br />
| mysql              |<br />
| test               |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
3 rows in set (0.02 sec)</p>
<p>mysql&gt; use mysql;</p>
<p>Database changed</p>
<p>mysql&gt; show tables;</p>
<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />
| Tables_in_mysql           |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />
| columns_priv              |<br />
| db                        |<br />
| func                      |<br />
| help_category             |<br />
| help_keyword              |<br />
| help_relation             |<br />
| help_topic                |<br />
| host                      |<br />
| proc                      |<br />
| procs_priv                |<br />
| tables_priv               |<br />
| time_zone                 |<br />
| time_zone_leap_second     |<br />
| time_zone_name            |<br />
| time_zone_transition      |<br />
| time_zone_transition_type |<br />
| user                      |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />
17 rows in set (0.00 sec)</p>
<p>mysql&gt; select * from db;</p>
<p>+&#8212;&#8212;+&#8212;&#8212;&#8212;+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| Host | Db      | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Create_tmp_table_priv | Lock_tables_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Execute_priv |<br />
+&#8212;&#8212;+&#8212;&#8212;&#8212;+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| %    | test    |      | Y           | Y           | Y           | Y           | Y           | Y         | N          | Y               | Y          | Y          | Y                     | Y                | Y                | Y              | Y                   | N                  | N            |<br />
| %    | test\_% |      | Y           | Y           | Y           | Y           | Y           | Y         | N          | Y               | Y          | Y          | Y                     | Y                | Y                | Y              | Y                   | N                  | N            |<br />
+&#8212;&#8212;+&#8212;&#8212;&#8212;+&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
2 rows in set (0.00 sec)</p>
<p>10.    Add password for “root” in MySQL Database by typing the following commands. The default password is same as Linux root password.</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
shell&gt; mysql -u root mysql
</pre>
<p>mysql&gt; UPDATE user SET Password=PASSWORD(&#8216;default password&#8217;) WHERE user=&#8217;root&#8217;;</p>
<p>mysql&gt; FLUSH PRIVILEGES;</p>
<p>11.     Test it by the following commands.</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 40px; text-align: left;" dir="ltr">
shell&gt;mysql - u  root - p
Enter password: ********
</pre>
<p>H.    PHP Installation</p>
<p>1.    Download the tar.gz file with filename “php-5.2.3.tar.gz” at http://www.php.net</p>
<p>2.    Install Flex by,</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
yum  install flex
</pre>
<p>3.    Install libxml2 by</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
yum install libxml2-devel.x86_64
</pre>
<p>4.    Install httpd-devel by</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
yum install httpd-devel
</pre>
<p>5.    Uninstall the installed php by</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
yum remove php
</pre>
<p>6.    Type the following commands.</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
shell&gt; gunzip &lt; php-VERSION.tar.gz | tar -xvf –
</pre>
<p>or</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 120px; text-align: left;" dir="ltr">
shell&gt; tar zcvf php-VERSION.tar.gz
shell&gt; cd php-VERSION
shell&gt; ./configure --with-apxs2 --with-mysql=/usr/local/mysql/ --prefix=/usr/local/php
shell&gt; make
shell&gt;make install
shell&gt; cp php.ini-recommended /usr/local/php/php.ini
</pre>
<p>7.    Modify httpd.conf by</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
vi /etc/httpd/conf/httpd.conf
</pre>
<p>Add the following two lines after all “AddType” or after “AddType application/x-gzip .gz .tgz”.</p>
<p>AddType application/x-httpd-php .php<br />
AddType application/x-httpd-php-source .phps</p>
<p>Add the following line after all “LoadModule”.</p>
<p>LoadModule php5_module modules/libphp5.so</p>
<p>8.    To test, prepare a file with filename “index.php” with the following contents.</p>
<p>&lt;?<br />
phpinfo();<br />
?&gt;</p>
<p>Store it in /var/www/html/</p>
<p>9.    Remarks all line in the file /etc/httpd/conf.d/welcome.conf</p>
<p>10.    Restart the Apache server by</p>
<pre class="alt2" style="border: 1px inset; margin: 0px; padding: 6px; overflow: auto; width:

640px; height: 20px; text-align: left;" dir="ltr">
/etc/init.d/httpd restart
</pre>
<p>11.    Use IE to access the server by</p>
<p>http://hostname/index.php</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freelinuxtutorials.com/tutorials/centos-lamp-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Dimdim on CentOS</title>
		<link>http://www.freelinuxtutorials.com/tutorials/installing-dimdim-on-centos/</link>
		<comments>http://www.freelinuxtutorials.com/tutorials/installing-dimdim-on-centos/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 17:55:33 +0000</pubDate>
		<dc:creator>tux</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[dimdim]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://www.freelinuxtutorials.com/?p=241</guid>
		<description><![CDATA[Do you want a free Web Conferencing? Then you can try DIMDIM. Dimdim lets anyone deliver synchronized live presentations, whiteboards and web pages and share their voice and video over the Internet &#8211; with no download required Official Dimdim Website:  www.dimdim.com You can try the Open source Community Edition. This is based on Dimdim Installation [...]]]></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-dimdim-on-centos/"></g:plusone></div><p>Do you want a free Web Conferencing? Then you can try DIMDIM.<br />
Dimdim lets anyone deliver synchronized live presentations, whiteboards and web pages and share their voice and video over the Internet &#8211; with no download required</p>
<p>Official Dimdim Website:  <a title="dimdim official site" href="http://www.dimdim.com/" target="_blank">www.dimdim.com</a></p>
<p>You can try the Open source Community Edition.</p>
<p>This is based on Dimdim Installation Procedure for CentOS</p>
<p>This step-by-step procedure was tested and implemented successfully on CentOS 5.2 32 bit (64 bit won&#8217;t work since the dimdim installation pack is for 32-bit only)</p>
<p>Requirements</p>
<p>1. Libc &#8211; ver. required is 2.5<br />
2. OpenOffice &#8211; ver. required is 3.0<br />
3. Java Runtime Environment(JRE) &#8211; ver. required is 1.6<br />
4. CherryPy &#8211; ver. required is 3.1<br />
5. Flup  &#8211; ver. required is 1.0<br />
6. Pycurl &#8211; ver. required is 7.19<br />
7. demjson &#8211; ver. required is 1.3<br />
8. Python &#8211; ver. required is 2.5</p>
<p>DimDim is very easy to install since it&#8217;s available in RPM package. The pre-requisites will take some of your time installing.</p>
<p>Here are the steps:</p>
<p>1. Chceck if you have libc v2.5 installed by using this command below:</p>
<p>[root@freelinuxtutorials]#ldconfig -v |grep libc</p>
<p>You should get similar output</p>
<p>libcidn.so.1 -&gt; libcidn-2.5.so<br />
libcrypt.so.1 -&gt; libcrypt-2.5.so<br />
libc.so.6 -&gt; libc-2.5.so<br />
libcap.so.1 -&gt; libcap.so.1.10<br />
libcom_err.so.2 -&gt; libcom_err.so.2.1<br />
libcrypto.so.6 -&gt; libcrypto.so.0.9.8b<br />
libcapi20.so.3 -&gt; libcapi20.so.3.0.4<br />
libcairo.so.2 -&gt; libcairo.so.2.9.2<br />
libckyapplet.so.1 -&gt; libckyapplet.so.1.0.0<br />
libcddb-slave2.so.0 -&gt; libcddb-slave2.so.0.0.0<br />
libcspi.so.0 -&gt; libcspi.so.0.10.11<br />
libcdda_interface.so.0 -&gt; libcdda_interface.so.0.9.8<br />
libcupsimage.so.2 -&gt; libcupsimage.so.2<br />
libcrack.so.2 -&gt; libcrack.so.2.8.0<br />
libcryptsetup.so.0 -&gt; libcryptsetup.so.0.0.0<br />
libcdda_paranoia.so.0 -&gt; libcdda_paranoia.so.0.9.8<br />
libcurl.so.3 -&gt; libcurl.so.3.0.0<br />
libcamel-provider-1.2.so.8 -&gt; libcamel-provider-1.2.so.8.1.0<br />
libcamel-1.2.so.0 -&gt; libcamel-1.2.so.0.0.0<br />
libcups.so.2 -&gt; libcups.so.2<br />
libcroco-0.6.so.3 -&gt; libcroco-0.6.so.3.0.1</p>
<p>2. Check if you have OpenOffice installed by following this step:</p>
<p>[root@freelinuxtutorials]# find / -name soffice.bin | grep openoffice | grep program | grep org3&#8243;</p>
<p>Or query it via rpm</p>
<p>[root@freelinuxtutorials]#rpm -qa |grep openoffice</p>
<p>* If openoffice 3.0 not yet installed, install it by following this step</p>
<p>a. Get the installater from</p>
<p>URLs: http://mirrors.isc.org/pub/openoffice/stable</p>
<p>http://download.openoffice.org/other.html#en-US</p>
<p>HOW TO INSTALL:<br />
a. Download the tarball file, choose the JRE version<br />
[root@freelinuxtutorials]#wget http://mirrors.isc.org/pub/openoffice/stable/3.1.1/OOo_3.1.1_LinuxIntel_install_wJRE_en-US.tar.gz</p>
<p>b.To install open office v-3.0.0.0 please follow below steps:<br />
b.1. Uncompress the open office pack you have downloaded.<br />
[root@freelinuxtutorials]# tar zxvf OOo_3.1.1_LinuxIntel_install_wJRE_en-US.tar.gz<br />
b.2. Go to open office directory<br />
[root@freelinuxtutorials]#cd OOo_3.1.1_LinuxIntel_install_wJRE_en-US<br />
b.3. go to RPMS directory<br />
[root@freelinuxtutorials]#cd RPMS<br />
b.4. You will find many rpm files ,install these rpm files by running the command<br />
[root@freelinuxtutorials]#rpm -ivh *.rpm</p>
<p>3. Install Java Runtime Environment ( JRE )</p>
<p>Check if you have JRE Installed,issue the below command:</p>
<p>[root@freelinuxtutorials]#java -version</p>
<p>You should get similar output</p>
<p>java version “1.6.0?<br />
Java(TM) SE Runtime Environment (build 1.6.0-b105)<br />
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)</p>
<p>Type echo $JAVA_HOME<br />
You should get<br />
/usr/bin/java</p>
<p>Some time java -version shows lower version even after installing newer version. This is because newer java is not in the system path.<br />
you can locate jre1.6 by the following command</p>
<p>[root@freelinuxtutorials]#find / -name java | grep /bin/java | grep jre | grep 1.6</p>
<p>It will show similar output:</p>
<p>[root@freelinuxtutorials]# /usr/java/jre1.6.0_05/bin/java</p>
<p>then type:</p>
<p>[root@freelinuxtutorials]# /usr/java/jre1.6.0_05/bin/java -version<br />
java version “1.6.0?<br />
Java(TM) SE Runtime Environment (build 1.6.0-b105)<br />
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)</p>
<p>Note: If you have version lower that 1.6 then you need to install v1.6</p>
<p>Go to URL below to download and install JRE v1.6</p>
<p>http://java.com/en/download/manual.jsp</p>
<p>4. Install CherryPy</p>
<p>Check if you have CherryPy Installed,issue the below command:</p>
<p>*CHECK:<br />
Type python2.4<br />
Type import cherrypy</p>
<p>You should get similar output<br />
[root@freelinuxtutorials]# python2.4<br />
Python 2.4.3 (r252:60911, Oct  9 2008, 08:13:08)<br />
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2<br />
Type &#8220;help&#8221;, &#8220;copyright&#8221;, &#8220;credits&#8221; or &#8220;license&#8221; for more information.<br />
&gt;&gt;&gt;import cherrypy<br />
&gt;&gt;&gt;<br />
Above output indicates that cherrypy is installed.If it gives an output<br />
saying &#8220;NO SUCH MODULE&#8221; then please follow below steps.</p>
<p>If you encounter such message above then you need to install CherryPy</p>
<p>Go to below URL to download and install CherryPy v3.1</p>
<p>http://www.cherrypy.org/wiki/CherryPyDownload</p>
<p>CherryPy Installation:</p>
<p>a) Download<br />
[root@freelinuxtutorials]# wget http://download.cherrypy.org/cherrypy/3.1.0/CherryPy-3.1.0.zip<br />
b) UnZip<br />
[root@freelinuxtutorials]#unzip CherryPy-3.1.0.zip<br />
c) Go to the directory and change permission to executable<br />
[root@freelinuxtutorials]#cd CherryPy-3.1.0<br />
[root@freelinuxtutorials]#chmod +x *<br />
d) Run the following command to install<br />
[root@freelinuxtutorials]#python2.4 setup.py install<br />
e) Check if Cherrypy is already imported in python2.4<br />
[root@freelinuxtutorials]#python2.4<br />
[root@freelinuxtutorials]#import cherrypy</p>
<p>5. Flup</p>
<p>a) See if you have Flup Installed:</p>
<p>Type python2.4<br />
Type import flup</p>
<p>You should get similar output</p>
<p>[root@freelinuxtutorials]# python2.4<br />
Python 2.4.3 (r252:60911, Oct  9 2008, 08:13:08)<br />
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2<br />
Type &#8220;help&#8221;, &#8220;copyright&#8221;, &#8220;credits&#8221; or &#8220;license&#8221; for more information.<br />
&gt;&gt;&gt;import flup<br />
&gt;&gt;&gt;</p>
<p>Above output indicates that flup is installed.If it gives an output<br />
saying &#8220;NO SUCH MODULE&#8221; then please follow below steps.</p>
<p>If you encounter such message above then you need to install Flup</p>
<p>b. Installing Flup</p>
<p>Go to below URL to download and install Flup v1.0</p>
<p>http://www.saddi.com/software/flup/dist/flup-1.0.tar.gz</p>
<p>Flup installation:<br />
Follow these steps:<br />
a) Download Flup<br />
[root@freelinuxtutorials]#wget http://www.saddi.com/software/flup/dist/flup-1.0.tar.gz<br />
b) Uncompress the tarball file<br />
[root@freelinuxtutorials]#tar xvzf flup-1.0.tar.gz<br />
c) Go to the directory and change permission to executable<br />
[root@freelinuxtutorials]#cd flup-1.0 and chmod +x *<br />
d)Setup<br />
[root@freelinuxtutorials]#python2.4 ez_setup.py -U setuptools<br />
e) Install<br />
[root@freelinuxtutorials]#python2.4 setup.py install<br />
f)Check if Flup is already imported in python2.4<br />
[root@freelinuxtutorials]#python2.4<br />
[root@freelinuxtutorials]#import flup</p>
<p>6.    pycurl<br />
Upgrade your curl 7.15 to 7.19.<br />
a)Download curl 7.19<br />
[root@freelinuxtutorials]#wget http://curl.haxx.se/download/curl-7.19.0.tar.gz<br />
b)Uncompress<br />
[root@freelinuxtutorials]#tar xzf curl-7.19.0.tar.gz<br />
c) Go to the curl directory and compile it<br />
[root@freelinuxtutorials]#cd curl-7.19.0<br />
[root@freelinuxtutorials]# ./configure<br />
[root@freelinuxtutorials]# make<br />
[root@freelinuxtutorials]# make install<br />
d) Soft link the curl<br />
[root@freelinuxtutorials]#ln -s /usr/local/lib/libcurl.so.4 /usr/lib/libcurl.so.4<br />
e) Install pycurl, make sure you have python-devel package installed<br />
[root@freelinuxtutorials]# yum install python-devel<br />
f)Install pycurl<br />
[root@freelinuxtutorials]#easy_install-2.4 pycurl<br />
[root@freelinuxtutorials]#cd ..<br />
[root@freelinuxtutorials]#python2.4<br />
[root@freelinuxtutorials]#import pycurl</p>
<p>You should get similar output<br />
[root@freelinuxtutorials]#python2.4<br />
Python 2.4.3 (r252:60911, Oct  9 2008, 08:13:08)<br />
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2<br />
Type &#8220;help&#8221;, &#8220;copyright&#8221;, &#8220;credits&#8221; or &#8220;license&#8221; for more information.<br />
&gt;&gt;&gt;import pycurl<br />
&gt;&gt;&gt;</p>
<p>7. demjson<br />
a) Check if demjson Installed:<br />
[root@freelinuxtutorials]#python2.4<br />
[root@freelinuxtutorials]#import demjson</p>
<p>You should get similar output<br />
[root@freelinuxtutorials]# python2.4<br />
Python 2.4.3 (r252:60911, Oct  9 2008, 08:13:08)<br />
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2<br />
Type &#8220;help&#8221;, &#8220;copyright&#8221;, &#8220;credits&#8221; or &#8220;license&#8221; for more information.<br />
&gt;&gt;&gt;import demjson<br />
&gt;&gt;&gt;</p>
<p>b) Install demjson<br />
[root@freelinuxtutorials]#wget http://deron.meranda.us/python/demjson/dist/demjson-1.3.tar.gz<br />
c) Uncompress tar<br />
[root@freelinuxtutorials]#tar xzf demjson-1.3.tar.gz<br />
d) Go to demjson directory and change permission to executable<br />
[root@freelinuxtutorials]#cd demjson-1.3<br />
[root@freelinuxtutorials]#chmod +x *<br />
e)Install<br />
[root@freelinuxtutorials]#python2.4 setup.py install<br />
f)Check if demjson is already imported in python2.4<br />
[root@freelinuxtutorials]#python2.4<br />
[root@freelinuxtutorials]#import demjson</p>
<p>8. Python2.5<br />
a)Before installation of python2.5, you need to check and install zlib<br />
[root@freelinuxtutorials]# yum install zlib*<br />
b) Download demjson<br />
[root@freelinuxtutorials]#wget http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tgz<br />
c) Uncompress<br />
[root@freelinuxtutorials]# tar xvzf Python-2.5.2.tgz<br />
d) Go to that directory and compile<br />
[root@freelinuxtutorials]#cd Python-2.5.2<br />
[root@freelinuxtutorials]# ./configure<br />
[root@freelinuxtutorials]# make &amp;&amp; make install</p>
<p>NOTE: BEFORE PROCEEDING FURTHER PLEASE NOTE THAT we need pycurl,demjson,flup,cherrypy modules in python 2.5 also.To<br />
do this follow below steps.It will be using the same cherrypy,flup,demjson,pycurl which you have already downloaded</p>
<p>9. Configure those with python2.5 as follows</p>
<p>9-a) CherryPy for python2.5</p>
<p>Version Required: v3.1</p>
<p>a. Go to the directory where you downloaded the cherrypy package.<br />
b. cd CherryPy-3.1.0<br />
c. python2.5 setup.py install<br />
d. rm -rf CherryPy-3.1.0<br />
e. rm -rf CherryPy-3.1.0.zip</p>
<p>You should be out of Cherrypy-3.1.0 directory and then<br />
Type python2.5<br />
Type import cherrypy</p>
<p>You should get similar output which indicates that cherrypy is successfully installed with python2.5<br />
[root@freelinuxtutorials]#python2.5<br />
Python 2.5.X (r252:60911, Oct  9 2008, 08:13:08)<br />
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2<br />
Type &#8220;help&#8221;, &#8220;copyright&#8221;, &#8220;credits&#8221; or &#8220;license&#8221; for more information.<br />
&gt;&gt;&gt;import cherrypy<br />
&gt;&gt;&gt;</p>
<p>Above output indicates that cherrypy is installed and imported in Python2.5 correctly.</p>
<p>9-b) Flup for python2.5</p>
<p>a. Version Required: v1.0</p>
<p>b. Go to the directory where you downloaded flup</p>
<p>c. cd flup-1.0 and chmod +x *</p>
<p>d. python2.5 ez_setup.py -U setuptools</p>
<p>e. python2.5 setup.py install</p>
<p>f. rm -rf flup-1.0</p>
<p>g. rm -rf flup-1.0.tar.gz</p>
<p>Open a terminal or move out from flup-1.0 directory and follow the below steps:</p>
<p>Type python2.5<br />
Type import flup</p>
<p>You should get similar output<br />
[root@freelinuxtutorials]#python2.5<br />
Python 2.5.X (r252:60911, Oct  9 2008, 08:13:08)<br />
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2<br />
Type &#8220;help&#8221;, &#8220;copyright&#8221;, &#8220;credits&#8221; or &#8220;license&#8221; for more information.<br />
&gt;&gt;&gt;import flup<br />
&gt;&gt;&gt;</p>
<p>Above output indicates that flup is installed and imported in Python2.5 correctly.</p>
<p>9-c) demjson for python2.5<br />
a. Version Required: v1.3</p>
<p>b. Go to the directory where you downloaded demjson i.e. cd demjson-1.3</p>
<p>c. cd demjson-1.3 and chmod +x *</p>
<p>d. python2.5 setup.py install</p>
<p>e. rm -rf demjson-1.3</p>
<p>f. rm -rf demjson-1.3.tar.gz</p>
<p>Now to check you must change your directory cd .. and then<br />
Type python2.5<br />
Type import demjson</p>
<p>You should get similar output<br />
[root@freelinuxtutorials]#python2.5<br />
Python 2.5.X (r252:60911, Oct  9 2008, 08:13:08)<br />
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2<br />
Type &#8220;help&#8221;, &#8220;copyright&#8221;, &#8220;credits&#8221; or &#8220;license&#8221; for more information.<br />
&gt;&gt;&gt;import demjson<br />
&gt;&gt;&gt;</p>
<p>Above output indicates that demjson is installed and imported in Python2.5 correctly.</p>
<p>9-e) pycurl for python2.5<br />
a) Version Required: v7.19</p>
<p>b) Now we can proceed on pycurl installion for python2.5 .</p>
<p>c)for python2.5 pycurl installation do as follows:</p>
<p>Type<br />
easy_install-2.5 pycurl</p>
<p>Type python2.5<br />
Type import pycurl</p>
<p>You should get similar output<br />
[root@freelinuxtutorials]#python2.5<br />
Python 2.5.2 (r252:60911, Oct  9 2008, 08:13:08)<br />
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2<br />
Type &#8220;help&#8221;, &#8220;copyright&#8221;, &#8220;credits&#8221; or &#8220;license&#8221; for more information.<br />
&gt;&gt;&gt;import pycurl<br />
&gt;&gt;&gt;</p>
<p>Note: Opening ports in the Firewall</p>
<p>Port 80, 1935, 40000, 40001, 40002 , 40005 must be free in the machine.<br />
The Dimdim Servers use ports 80 &amp;1935 for external communication. But port 80 alone is enough to be opened for external communication.</p>
<p>BELOW is the Dimdim Installation based on the README</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>DIMDIM INSTALLATION:<br />
====================</p>
<p>Installation Steps:</p>
<p>Step 1: Download dimdim rpm package</p>
<p>Step 2: Install rpm package by typing the command rpm -ivh Dimdim-4.5_SF_i386.rpm in a terminal</p>
<p>Dimdim-4.5 will be installed under location /usr/local and a soft link for dimdim will be created under /usr/local.</p>
<p>The place holder will exactly look like<br />
&#8212; usr<br />
|<br />
|&#8211;local<br />
|<br />
|&#8211;dimdim<br />
|<br />
|&#8211;ConferenceServer<br />
|<br />
|&#8211;CobrowsingManager<br />
|<br />
|&#8211;DTP3<br />
|<br />
|&#8211;MediaServer<br />
|<br />
|&#8211;red5<br />
|<br />
|&#8211;nginx<br />
|<br />
|&#8211;ThirdPartyPackages</p>
<p>Step 3: By default, ip address of ethernet 0 interface of the box is configured for Dimdim Server.</p>
<p>i) To stop Dimdim, open a terminal and enter stopDimdim<br />
ii) To start Dimdim, open a terminal and enter startDimdim.</p>
<p>To start the meeting do</p>
<p>http://&lt;ip.address&gt;/dimdim/</p>
<p>Note: If the ip address is not the same or if you need to configure with different IP address, follow the below steps:</p>
<p>Step A:    Get the IP Address of the machine</p>
<p>Example:<br />
[root@localhost]# ifconfig eth0</p>
<p>The output will look like:<br />
eth0      Link encap:Ethernet  HWaddr 00:0C:29:CA:FA:7C<br />
inet addr:192.168.1.10  Bcast:125.255.255.255  Mask:255.0.0.0</p>
<p>The IP Address for the above example is 192.168.1.10</p>
<p>Step b: Configure all the Dimdim components</p>
<p>There may be two cases:<br />
1. Network has public and private IP mapping,</p>
<p>ExternalIP:port &#8211;&gt; Internal:port</p>
<p>Please note that port should be same, Port 80 is recommended.<br />
For example: 123.X.X.X:80 &#8212;&gt; 192.168.X.X:80<br />
publicIP is mapped to privateIP</p>
<p>Use Config-ipaddress.pl like below<br />
cd /usr/local/dimdim<br />
./Config-ipaddress.pl 123.X.X.X 80 192.168.X.X</p>
<p>2. VM has a singleIP, There is no network mapping(no Network Address Translation):</p>
<p>Use Config-ipaddress.pl like below<br />
cd /usr/local/dimdim<br />
./Config-ipaddress.pl 123.X.X.X 80</p>
<p>Step c: On completion of configuration, open a terminal and enter the command &#8220;startDimdim&#8221;. This will start all the Dimdim components.<br />
To ensure all Dimdim Components are started, check the status of the Dimdim Components.</p>
<p>You are now ready to start meeting. Start the meeting by providing the URL http://&lt;IPAddressORHostnameConfigured&gt;/dimdim/.<br />
Please note the trailing slash is required in the URL after dimdim.Example http://192.168.1.10/dimdim/</p>
<p>Dimdim Sever Machine Restart:<br />
=============================</p>
<p>When the machine where Dimdim Server installed is restarted,<br />
open a terminal and type startDimdim &#8211; This will start Dimdim Server</p>
<p>Dimdim SMTP Server Configuration :<br />
==================================</p>
<p>Please note that the current smtp settings are just sample setting. It is adviced that you change these settings to your own smtp configuration.</p>
<p>Below is suggested way to modify the smtp configuration</p>
<p>1) Open dimdim.properties configuration file</p>
<p>Go to folder cd /&lt;dimdim_home&gt;/ConferenceServer/apache-tomcat-5.5.17/webapps/dimdim/WEB-INF/classes/resources/</p>
<p>i.e. cd /usr/local/dimdim/ConferenceServer/apache-tomcat-5.5.17/webapps/dimdim/WEB-INF/classes/resources/</p>
<p>2) Modify the below settings as suggested. Please note that setting &#8220;dimdim.smtptype&#8221; needs to be configured depending on the type of smtp server.</p>
<p>##    Email Parameters that can be configured by the user.<br />
##<br />
email.server=&lt;gmail smtp server address&gt;<br />
email.user=&lt;your gmail id&gt;<br />
email.password=&lt;your gmail account password&gt;<br />
email.sender=&lt;your gmail account id&gt;<br />
email.PORT=465<br />
email.EMAIL_CC=<br />
email.EMAIL_BCC=<br />
##<br />
##<br />
email.PROTOCOL=smtp<br />
email.DEBUG_MAIL_SESSION=false<br />
email.BUFFER_SIZE=2048<br />
email.EMAIL_SUBJECT = has invited you to a Dimdim web meeting.<br />
email.EMAIL_FROM_PERSON=DimDim Invitations<br />
email.EMAIL_FROM=&lt;your gmail account id&gt;<br />
email.EMAIL_REPLY_TO=&lt;your gmail account id&gt;<br />
email.EMAIL_TO=<br />
email.EMAIL_CHARSET=utf-8<br />
##<br />
##<br />
##  This property refers to type of the SMTP Server<br />
##  1 : Non SSL SMTP Server i.e. Dimdim SMTP Server<br />
##  2 : SSL SMTP Server  i.e. gmail SMTP Server<br />
dimdim.smtptype=2<br />
##<br />
##</p>
<p>DIMDIM UNINSTALLATION:<br />
======================</p>
<p>Step 1:    rpm -e     dimdim</p>
<p>All the Dimdim Components installed by rpm package will be removed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freelinuxtutorials.com/tutorials/installing-dimdim-on-centos/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Linux as a Router and Firewall</title>
		<link>http://www.freelinuxtutorials.com/tutorials/linux-as-a-router-and-firewall/</link>
		<comments>http://www.freelinuxtutorials.com/tutorials/linux-as-a-router-and-firewall/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 11:46:08 +0000</pubDate>
		<dc:creator>tux</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[NAT]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[RHEL]]></category>
		<category><![CDATA[router]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.freelinuxtutorials.com/?p=171</guid>
		<description><![CDATA[Step by Step Procedure Step 1. Add 2 LAN cards to the Linux box. You need to have two(2) NICs, one for your private network and one for the public IP address Step 2. Check if your networks cards are properly detected and installed. You can use the command &#8220;dmesg&#8221; to verify if it was [...]]]></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/linux-as-a-router-and-firewall/"></g:plusone></div><p>Step by Step Procedure</p>
<p>Step 1. Add 2 LAN cards to the Linux box. You need to have two(2) NICs, one for your private network and one for the public IP address</p>
<p>Step 2. Check if your networks cards are properly detected and installed. You can use the command &#8220;dmesg&#8221; to verify if it was recognized during the boot-up process</p>
<p>Sample output:<br />
#dmesg |grep eth</p>
<p>e100: eth0: e100_probe: addr 0xfa061000, irq 177, MAC addr 00:10:DC:5E:A8:BF<br />
e100: eth1: e100_probe: addr 0xfa060000, irq 185, MAC addr 00:10:DC:5E:A8:C0<br />
e100: eth0: e100_watchdog: link up, 100Mbps, half-duplex<br />
e100: eth1: e100_watchdog: link up, 100Mbps, full-duplex</p>
<p>Step 3. Configure eth0 for Internet with a Public IP address</p>
<p>For RPM-based distro, a menu-based tool called &#8220;setup&#8221; can be used to easy configuration setup such as Network<br />
Sample Output 1: (RPM-based like RHEL,CentOS)</p>
<p># cat /etc/sysconfig/network-scripts/ifcfg-eth0<br />
# Intel Corporation 82557/8/9/0/1 Ethernet Pro 100<br />
DEVICE=eth0<br />
BOOTPROTO=none<br />
HWADDR=00:10:dc:5e:a8:bx<br />
ONBOOT=yes<br />
DHCP_HOSTNAME=freelinuxtutorials<br />
IPADDR=116.x.x.x<br />
NETMASK=255.255.255.240<br />
GATEWAY=116.x.x.x<br />
TYPE=Ethernet</p>
<p>Sample Output 2: (Debian-based)<br />
# cat /etc/network/interfaces<br />
auto eth0<br />
iface eth0 inet static<br />
address 116.x.x.x<br />
netmask 255.255.255.240<br />
mtu 1500<br />
gateway 116.x.x.x</p>
<p>Step 4. Configure eth1 for LAN with a Private IP (Internal private network)<br />
# cat ifcfg-eth1</p>
<p>BOOTPROTO=none<br />
PEERDNS=yes<br />
HWADDR=00:50:8B:CF:9C:05    # Optional<br />
TYPE=Ethernet<br />
IPV6INIT=no<br />
DEVICE=eth1<br />
NETMASK=255.255.0.0        # Specify based on your requirement<br />
BROADCAST=&#8221;"<br />
IPADDR=192.168.1.1        # Gateway of the LAN<br />
NETWORK=192.168.0.0        # Optional<br />
USERCTL=no<br />
ONBOOT=yes</p>
<p>Sample Output 1: (RPM-based like RHEL,CentOS)</p>
<p># cat /etc/sysconfig/network-scripts/ifcfg-eth1</p>
<p>DEVICE=eth1<br />
BOOTPROTO=none<br />
HWADDR=00:10:dc:5e:a8:cx<br />
ONBOOT=yes<br />
DHCP_HOSTNAME=freelinuxtutorials<br />
TYPE=Ethernet<br />
IPADDR=192.168.17.1<br />
NETMASK=255.255.255.0</p>
<p>Sample Output 2: (Debian-based)<br />
# cat /etc/network/interfaces<br />
auto eth1<br />
iface eth1 inet static<br />
address 192.168.17.1<br />
netmask 255.255.255.0<br />
mtu 1500</p>
<p>Step 5. Host Configuration    (Optional)<br />
# cat /etc/hosts<br />
127.0.0.1       freelinuxtutorials localhost.localdomain   localhost</p>
<p>Step 6. Gateway Configuration (can be no gateway set)<br />
# cat /etc/sysconfig/network</p>
<p>NETWORKING=yes<br />
HOSTNAME=freelinuxtutorials</p>
<p>Step 7. DNS Configuration<br />
# cat /etc/resolv.conf</p>
<p>nameserver 203.x.x.x      # ISP Primary DNS Server<br />
nameserver 203.x.x.x      # ISP Secondary DNS Server<br />
Step 8. NAT configuration with IP Tables<br />
First of all you have to flush and delete existing firewall rules. So flush rules by typing in terminal:</p>
<p>iptables -F<br />
iptables -t nat -F<br />
iptables -t mangle -F<br />
Now delete these chains:</p>
<p>iptables -X<br />
iptables -t nat -X<br />
iptables -t mangle -X<br />
# Set up IP FORWARDing and Masquerading</p>
<p>iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE<br />
iptables -A FORWARD -i eth1 -j ACCEPT<br />
# Enables packet forwarding by kernel (save this setting in /etc/sysctl.conf file)</p>
<p>echo 1 &gt; /proc/sys/net/ipv4/ip_forward<br />
#Apply the configuration</p>
<p>service iptables save<br />
service iptables restart<br />
# Check if iptables is set to start during boot up</p>
<p>chkconfig –list iptables</p>
<p>Step 9. Testing<br />
Ping the Gateway of the network from client system: ping 192.168.17.1<br />
Try it on your client systems: ping www.yahoo.com</p>
<p>Configure PC on the network<br />
PC Clients should set their gateway of the private IP of the Linux machine.<br />
- DNS can be set using the ISP DNS, or if you have internal DNS with your customized zones is recommended esp. when you have Active Directory in place on your network</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>This is my sample NAT/firewall script:</p>
<p>#!/bin/sh<br />
#<br />
#</p>
<p># set a few variables<br />
echo &#8220;&#8221;<br />
echo &#8220;    setting global variables&#8221;<br />
echo &#8220;&#8221;<br />
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin<br />
iptables=&#8221;/sbin/iptables&#8221;</p>
<p># adjust my /proc<br />
echo &#8220;    applying general security settings to /proc filesystem&#8221;<br />
echo &#8220;&#8221;<br />
if [ -e /proc/sys/net/ipv4/tcp_syncookies ]; then echo 1 &gt; /proc/sys/net/ipv4/tcp_syncookies; fi<br />
if [ -e /proc/sys/net/ipv4/conf/all/rp_filter ]; then echo 1 &gt; /proc/sys/net/ipv4/conf/all/rp_filter; fi<br />
if [ -e /proc/sys/net/ipv4/ip_forward ]; then echo 1 &gt; /proc/sys/net/ipv4/ip_forward; fi</p>
<p># load some modules<br />
if [ -e /lib/modules/`uname -r`/kernel/net/ipv4/netfilter/ip_conntrack_ftp.o ]; then modprobe ip_conntrack_ftp; fi<br />
if [ -e /lib/modules/`uname -r`/kernel/net/ipv4/netfilter/ip_nat_ftp.o ]; then modprobe ip_nat_ftp; fi</p>
<p># flush any existing chains and set default policies<br />
$iptables -F INPUT<br />
$iptables -F OUTPUT<br />
$iptables -P INPUT DROP<br />
$iptables -P OUTPUT ACCEPT</p>
<p># setup nat<br />
echo &#8220;    applying nat rules&#8221;<br />
echo &#8220;&#8221;<br />
$iptables -F FORWARD<br />
$iptables -F -t nat<br />
$iptables -P FORWARD DROP<br />
$iptables -A FORWARD -i eth1 -j ACCEPT<br />
$iptables -A INPUT -i eth1 -j ACCEPT<br />
$iptables -A OUTPUT -o eth1 -j ACCEPT<br />
$iptables -A FORWARD -m state &#8211;state ESTABLISHED,RELATED -j ACCEPT<br />
$iptables -t nat -A POSTROUTING -s 192.168.17.0/24 -o eth0 -j SNAT &#8211;to-source 116.x.x.x &lt;&#8212;- Public IP (could be one of the IP address available given by your ISP)</p>
<p># allow all packets on the loopback interface<br />
$iptables -A INPUT -i lo -j ACCEPT<br />
$iptables -A OUTPUT -o lo -j ACCEPT</p>
<p># allow established and related packets back in<br />
$iptables -A INPUT -i eth0 -m state &#8211;state ESTABLISHED,RELATED -j ACCEPT</p>
<p># icmp<br />
echo &#8220;    applying icmp rules&#8221;<br />
echo &#8220;&#8221;<br />
$iptables -A OUTPUT -p icmp -m state &#8211;state NEW -j ACCEPT<br />
$iptables -A INPUT -p icmp -m state &#8211;state ESTABLISHED,RELATED -j ACCEPT<br />
$iptables -A INPUT -p icmp &#8211;icmp-type echo-request -m limit &#8211;limit 1/s -i eth0 -j ACCEPT</p>
<p># apply icmp type match blocking<br />
echo &#8220;    applying icmp type match blocking&#8221;<br />
echo &#8220;&#8221;<br />
$iptables -I INPUT -p icmp &#8211;icmp-type redirect -j DROP<br />
$iptables -I INPUT -p icmp &#8211;icmp-type router-advertisement -j DROP<br />
$iptables -I INPUT -p icmp &#8211;icmp-type router-solicitation -j DROP<br />
$iptables -I INPUT -p icmp &#8211;icmp-type address-mask-request -j DROP<br />
$iptables -I INPUT -p icmp &#8211;icmp-type address-mask-reply -j DROP</p>
<p># open ports to the firewall<br />
echo &#8220;    applying the open port(s) to the firewall rules&#8221;<br />
echo &#8220;&#8221;<br />
$iptables -A INPUT -p tcp &#8211;dport 22 -j ACCEPT<br />
#$iptables -A INPUT -p tcp &#8211;dport 3128 -j ACCEPT<br />
# open and forward ports to the internal machine(s)<br />
#echo &#8220;    applying port forwarding rules&#8221;<br />
#echo &#8220;&#8221;<br />
#$iptables -A FORWARD -i eth0 -p tcp &#8211;dport 80 -j ACCEPT<br />
#$iptables -t nat -A PREROUTING -i eth0 -p tcp -d 116.x.x.x &#8211;dport 80 -j DNAT &#8211;to-destination 192.168.17.200:80</p>
<p># logging<br />
#echo &#8220;    applying logging rules&#8221;<br />
#echo &#8220;&#8221;<br />
#$iptables -A INPUT -i eth0 -p tcp -m limit &#8211;limit 1/s &#8211;dport 0:65535 -j LOG &#8211;log-prefix &#8220;tcp connection: &#8221;<br />
#$iptables -A INPUT -i eth0 -p udp -m limit &#8211;limit 1/s &#8211;dport 0:65535 -j LOG &#8211;log-prefix &#8220;udp connection: &#8221;</p>
<p># drop all other packets<br />
echo &#8220;    applying default drop policies&#8221;<br />
echo &#8220;&#8221;<br />
$iptables -A INPUT -i eth0 -p tcp &#8211;dport 0:65535 -j DROP<br />
$iptables -A INPUT -i eth0 -p udp &#8211;dport 0:65535 -j DROP</p>
<p>echo &#8220;### dar firewall is loaded ###&#8221;<br />
echo &#8220;&#8221;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.freelinuxtutorials.com/tutorials/linux-as-a-router-and-firewall/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

