<?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>SupportSages &#187; Training</title>
	<atom:link href="http://www.supportsages.com/blog/category/training/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.supportsages.com/blog</link>
	<description>Technical Support and Server Management : Musings in the fox hole.</description>
	<lastBuildDate>Thu, 05 Jan 2012 03:05:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>cPanel Website Transfer &#8211; Part 2 &#8211; cPanel to cPanel Migration</title>
		<link>http://www.supportsages.com/blog/2011/08/cpanel-website-transfer-part-2-cpanel-to-cpanel-migration/</link>
		<comments>http://www.supportsages.com/blog/2011/08/cpanel-website-transfer-part-2-cpanel-to-cpanel-migration/#comments</comments>
		<pubDate>Sat, 06 Aug 2011 11:48:54 +0000</pubDate>
		<dc:creator>vince</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Training]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1870</guid>
		<description><![CDATA[<h3><strong><em><span style="color: #ff0000;">Transferring a Website from One cPanel server to another</span></em></strong></h3>
<strong>Skill Level : Beginner</strong>

In this post, I will explain how to transfer a website from one cPanel server to other.

<strong>Pre Requisites</strong>

Server Platform : Linux

User requires     : cPanel and SSH access (root) to at-least the Destination server (where the account is restoring)

<strong>The Process</strong>

From the Target server, Generate a Full cPanel backup of the account using either cPanel or through root shell access.

(i) By cPanel

Login to cPanel. Go to Files -&#62; Backups

<a href="http://www.supportsages.com/blog/wp-content/uploads/2011/06/Files.png"><img class="alignleft size-full wp-image-1875" title="Files" src="http://www.supportsages.com/blog/wp-content/uploads/2011/06/Files.png" alt="" width="329" height="115" /></a>

Click "Download or Generate a Full Website Backup". Choose Backup Destination ...]]></description>
			<content:encoded><![CDATA[<h3><strong><em><span style="color: #ff0000;">Transferring a Website from One cPanel server to another</span></em></strong></h3>
<p><strong>Skill Level : Beginner</strong></p>
<p>In this post, I will explain how to transfer a website from one cPanel server to other.</p>
<p><strong>Pre Requisites</strong></p>
<p>Server Platform : Linux</p>
<p>User requires     : cPanel and SSH access (root) to at-least the Destination server (where the account is restoring)</p>
<p><strong>The Process</strong></p>
<p>From the Target server, Generate a Full cPanel backup of the account using either cPanel or through root shell access.</p>
<p>(i) By cPanel</p>
<p>Login to cPanel. Go to Files -&gt; Backups</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/06/Files.png" class="thickbox no_icon" rel="gallery-1870" title="Files"><img class="alignleft size-full wp-image-1875" title="Files" src="http://www.supportsages.com/blog/wp-content/uploads/2011/06/Files.png" alt="" width="329" height="115" /></a></p>
<p>Click &#8220;Download or Generate a Full Website Backup&#8221;. Choose Backup Destination as &#8220;Home Directory&#8221; (Make sure you&#8217;ve enough Disk Space before you proceed) and a valid E-mail address to notify you once the Backup is generated.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/06/Full_Backup.png" class="thickbox no_icon" rel="gallery-1870" title="Full_Backup"><img class="alignleft size-full wp-image-1878" title="Full_Backup" src="http://www.supportsages.com/blog/wp-content/uploads/2011/06/Full_Backup.png" alt="" width="580" height="262" /></a></p>
<p>Once the Backup is completed, a mail will arrive on the E-mail you&#8217;ve mentioned above (if specified) and the &#8216;Backups Available for Download&#8217; will be populated with the name of the backup file generated like :</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/06/Backup_Complete.png" class="thickbox no_icon" rel="gallery-1870" title="Backup_Complete"><img class="alignleft size-full wp-image-1879" title="Backup_Complete" src="http://www.supportsages.com/blog/wp-content/uploads/2011/06/Backup_Complete.png" alt="" width="580" height="49" /></a></p>
<p>Do you know why the backup generated is the form tar.gz ? Its because, in the tar format all files are preserved with their appropriate permissions and then its compressed to gz (gzip) for obtaining the least possible file size.</p>
<p>The process in the Target server is finished. Now login as Root in the server which requires the account to be restored. We&#8217;ve to download the backup file generated there to this server. There are number of ways to do this. Some are weird <img src='http://www.supportsages.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Method 1</strong></p>
<p>If you have the cPanel details of that server, you can use it for FTP access. And since the Backup is generated on the Home directory there, its all about downloading the backup.</p>
<p># root@server [/home]# ftp <span style="color: #ff0000;"><strong>oldserver.com</strong></span> or <strong><span style="color: #ff0000;">IP</span></strong></p>
<p>Connected to oldserver.com.<br />
220&#8212;&#8212;&#8212;- Welcome to Pure-FTPd [privsep] [TLS] &#8212;&#8212;&#8212;-<br />
220-You are user number 3 of 50 allowed.<br />
220-Local time is now 17:28. Server port: 21.<br />
220-IPv6 connections are also welcome on this server.<br />
220 You will be disconnected after 15 minutes of inactivity.<br />
Name (oldserver.com:root): <strong><span style="color: #ff0000;">user</span></strong><br />
331 User user OK. Password required<br />
Password:<br />
230 OK. Current restricted directory is /<br />
Remote system type is UNIX.<br />
Using binary mode to transfer files.<br />
ftp&gt; get <span style="color: #ff0000;"><strong>backup-6.2.2011_06-23-57_account.tar.gz</strong></span></p>
<p><span style="color: #ff0000;"><span style="color: #000000;">This will download the backup. You need root access to restore it. Before you restore you need to check whether there is an account or domain which already exists by the name which you intend to restore.</span></span></p>
<p><span style="color: #ff0000;"><span style="color: #000000;">cPanel script to check whether the domain/account name exists </span></span></p>
<p><strong># grep account /etc/userdomains</strong></p>
<p><strong>Method 2</strong></p>
<p><strong>Generating a cPanel backup through Remote FTP (Passive Mode transfer)</strong></p>
<p>It is possible to generate a Remote backup of the account in a server, where the backup has to be restored. Go to cPanel -&gt; Backups -&gt; Download or Generate a Full website backup. Select the Backup Destination as Remote FTP Server (passive mode transfer). Follow the screenshot :</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/07/remote_ftp.png" class="thickbox no_icon" rel="gallery-1870" title="remote_ftp"><img class="alignleft size-full wp-image-1900" title="remote_ftp" src="http://www.supportsages.com/blog/wp-content/uploads/2011/07/remote_ftp.png" alt="" width="759" height="544" /></a></p>
<p>cPanel script to restore the account</p>
<p># nice -n 19 /scripts/restorepkg &#8211;skipres &lt;username&gt;</p>
<p>For the script to run, the backup should be in any of the following locations in the server :  /, /home, /home2, /home3, /misc, /net, /root, /usr, /usr/home, /var/lib/nfs/rpc_pipefs, /var/tmp, /web</p>
<p>This feature will restore full backups, cPanel backups and cPanel move files in one of the following formats:</p>
<p>cpmove-{USER}<br />
cpmove-{USER}.tar<br />
cpmove-{USER}.tar.gz<br />
USER.tar<br />
USER.tar.gz<br />
backup-{BACKUP-DATE_TIME}_{USER}.tar<br />
backup-{BACKUP-DATE_TIME}_{USER}.tar.gz</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=cPanel+Website+Transfer+-+Part+2+-+cPanel+to+cPanel+Migration+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1870" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=cPanel+Website+Transfer+-+Part+2+-+cPanel+to+cPanel+Migration+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1870" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2011/08/cpanel-website-transfer-part-2-cpanel-to-cpanel-migration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Worried about email migrations and mail syncing &#8211; get getmail for the rescue</title>
		<link>http://www.supportsages.com/blog/2011/06/worried-about-email-migrations-and-mail-syncing-get-getmail-for-the-rescue/</link>
		<comments>http://www.supportsages.com/blog/2011/06/worried-about-email-migrations-and-mail-syncing-get-getmail-for-the-rescue/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 15:14:39 +0000</pubDate>
		<dc:creator>arnold</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[DirectAdmin]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[email migrations]]></category>
		<category><![CDATA[email transfer]]></category>
		<category><![CDATA[imapsync]]></category>
		<category><![CDATA[mail syncing]]></category>
		<category><![CDATA[mail transfer]]></category>
		<category><![CDATA[migrate my email]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1887</guid>
		<description><![CDATA[Most of the hosting providers offer free server migration. The free website migration started as early as 2005, in the industry. But only a few providers offer the email migration for a website transfer involving different control panels. So using getmail is the easiest way to transfer emails. All we need is to create the email account in the new server and configure the getmail to transfer the emails.

Download getmail at http://pyropus.ca/software/getmail/old-versions/getmail-4.20.3.tar.gz

[bash]

wget http://pyropus.ca/software/getmail/old-versions/getmail-4.20.3.tar.gz
tar xzf getmail-4.20.3.tar.gz
cd getmail*
python setup.py install

[/bash]

Now you have to create a getmailrc , the getmail configuration file inside the home folder of the user. getmailrc need not be ...]]></description>
			<content:encoded><![CDATA[<p>Most of the hosting providers offer free server migration. The free website migration started as early as 2005, in the industry. But only a few providers offer the email migration for a website transfer involving different control panels. So using getmail is the easiest way to transfer emails. All we need is to create the email account in the new server and configure the getmail to transfer the emails.</p>
<p>Download getmail at http://pyropus.ca/software/getmail/old-versions/getmail-4.20.3.tar.gz</p>
<pre class="brush: bash; title: ; notranslate">

wget http://pyropus.ca/software/getmail/old-versions/getmail-4.20.3.tar.gz
tar xzf getmail-4.20.3.tar.gz
cd getmail*
python setup.py install
</pre>
<p>Now you have to create a getmailrc , the getmail configuration file inside the home folder of the user. getmailrc need not be inside the home directory. You have to create the folder .getmail where getmail keeps a log of the emails retrieved based on each configuration file you may have.You can have multiple destination and retriever sections in one single getmailrc as well.</p>
<p>I must say getmail is so much flexible and rightly coded when the mailsync or imapsync didn&#8217;t do their job right or up to the mark. And is an excellent replacement for fetchmail. It supports POP, POP3S, IMAP4 and IMAPS, and also can store the mails retrieved in mbox or maildir format at the destination.</p>
<p>An extremely simple getmailrc file will look like this</p>
<pre class="brush: bash; title: ; notranslate">
[retriever]
type = SimpleIMAPRetriever
server = mail.domain.com
username = direct@domain.com
password = direct

[destination]
type = Maildir
path = /home/cpusername/mail/.direct@domain_com/
</pre>
<p>The file format should be pretty self-explanatory. You’re telling getmail to fetch your email from server, mail.domain.com by logging to it using the mentioned username and password. The destination section mentions where to store the retrieved email and in which format (Maildir or mbox or mboxrd). Make sure that the cur, new and tmp are there inside those folder though. However getmail may create those folders automatically though.</p>
<p>Finally to get this going, just run &#8220;getmail &#8211;rcfile getmailrc&#8221;</p>
<p>Once you run it, assuming that the getmailrc is properly configured, you will be welcomed by a below output.</p>
<pre class="brush: bash; title: ; notranslate">
getmail version 4.20.3
Copyright (C) 1998-2009 Charles Cazabon.  Licensed under the GNU GPL version 2.
SimpleIMAPRetriever:direct@domain.com@mail.domain.com:143:
 msg    1/3983 (299328 bytes) delivered
 msg    2/3983 (2815 bytes) delivered
</pre>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Worried+about+email+migrations+and+mail+syncing+-+get+getmail+for+the+rescue+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1887" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=Worried+about+email+migrations+and+mail+syncing+-+get+getmail+for+the+rescue+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1887" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2011/06/worried-about-email-migrations-and-mail-syncing-get-getmail-for-the-rescue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Applying wildcards in GRANT option of MySQL</title>
		<link>http://www.supportsages.com/blog/2011/05/applying-wildcards-in-grant-option-of-mysql/</link>
		<comments>http://www.supportsages.com/blog/2011/05/applying-wildcards-in-grant-option-of-mysql/#comments</comments>
		<pubDate>Wed, 25 May 2011 10:27:19 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[cPanel server backup]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[mysqldump]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1841</guid>
		<description><![CDATA[We had this particular requirement of creating a database user to be used to backup only the cPanel databases. Only recently the database mapping has been introduced by cPanel which allows the clients to create databases without the _ . However on all our client servers, we insist to have the old style with every database has Prefixing On.

Creating the database user to backup only the cPanel databases, means matching the databases with an underscore (_) in its name and that resulted in this particular SQL command to be executed as root user.

[bash]GRANT ALL PRIVILEGES ON `%\_%`.* TO `cpdbbackups`@`re.mo.te.ip` IDENTIFIED ...]]></description>
			<content:encoded><![CDATA[<p>We had this particular requirement of creating a database user to be used to backup only the cPanel databases. Only recently the database mapping has been introduced by cPanel which allows the clients to create databases without the _ . However on all our client servers, we insist to have the old style with every database has Prefixing On.</p>
<p>Creating the database user to backup only the cPanel databases, means matching the databases with an underscore (_) in its name and that resulted in this particular SQL command to be executed as root user.</p>
<pre class="brush: bash; title: ; notranslate">GRANT ALL PRIVILEGES ON `%\_%`.* TO `cpdbbackups`@`re.mo.te.ip` IDENTIFIED BY 'p@ssw0Rd' WITH GRANT OPTION;</pre>
<p>Read more about the cPanel&#8217;s DB mapping at http://www.cpanel.net/blog/integration/2010/05/more-details-about-db-mapping.html</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Applying+wildcards+in+GRANT+option+of+MySQL+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1841" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=Applying+wildcards+in+GRANT+option+of+MySQL+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1841" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2011/05/applying-wildcards-in-grant-option-of-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>History of Domain Names</title>
		<link>http://www.supportsages.com/blog/2011/05/history-of-domain-names/</link>
		<comments>http://www.supportsages.com/blog/2011/05/history-of-domain-names/#comments</comments>
		<pubDate>Sun, 22 May 2011 13:23:29 +0000</pubDate>
		<dc:creator>annette</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Training]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1839</guid>
		<description><![CDATA[What is a domain name? A domain name is a unique name, kind of like an  e-mail address is unique, which is registered in a database called WHOIS  through an organization called Network Solutions, Inc. (NSI). The  domain name corresponds to a unique set of numbers called an IP  (Internet Protocol) address. The reason we use domain names instead of  IP addresses is that they are closer to our language. It would be  difficult to market a site like this: "Go to 64.233.167.99 or  216.109.112.135 to search the internet!" A much easier way ...]]></description>
			<content:encoded><![CDATA[<p>What is a domain name? A domain name is a unique name, kind of like an  e-mail address is unique, which is registered in a database called WHOIS  through an organization called Network Solutions, Inc. (NSI). The  domain name corresponds to a unique set of numbers called an IP  (Internet Protocol) address. The reason we use domain names instead of  IP addresses is that they are closer to our language. It would be  difficult to market a site like this: &#8220;Go to 64.233.167.99 or  216.109.112.135 to search the internet!&#8221; A much easier way to do this is  to say &#8220;Go to www.Google.com or www.yahoo.com to search the internet!&#8221;  (Both Google and Yahoo are trade marked by Google, Inc., and Yahoo,  Inc., respectively).</p>
<p>A domain name points to a computer called a &#8220;name server&#8221;. The name  server knows that your domain name corresponds to your web hosting  server&#8217;s IP address and it routes the person who typed in your domain  name to your web hosting server &#8211; to your web site. That is how people  anywhere in the world can see your web site by typing your domain name.</p>
<p>In 1992, the National Science Foundation granted an exclusive contract  to NSI to be the sole registrar of top level domain names. NSI also had a  cooperative agreement with United States Department of Commerce  (&#8220;DoC&#8221;). With no competition, consumers were at the mercy of NSI.</p>
<p>In 1998, NSI and the DoC amended their cooperative agreement to allow  for competing registrars. NSI was forced to provide domain name  registration to the competing registrars at wholesale prices, rather  than the standard $34.99 annual fee. NSI still charges $34.99 per year.</p>
<p>In late 1998, the DoC assigned the responsibility of overseeing the  transition to a competitive market for domain names and accreditation of  new registrars to a new organization called the Internet Corporation  for Assigned Names and Numbers (ICANN).</p>
<p>In 1999, ICANN began taking applications from companies who wanted to  become registrars &#8211; and then capitalism took over: companies had to  compete for business. Prices came down and service improved, however  some are better than others. For a more detailed history of this  transition, visit www.icann.org/registrars/accreditation-history.htm.</p>
<p>Even with the positive effects of competition in the domain name  marketplace, the process of internet domain name registration remains a  mystery for many.</p>
<p>There are a lot of companies that want to charge you hundreds of dollars  to do the simple task of domain name registration for you. There are  some registration companies who will charge you $35 just to register a  domain. And there are web site consultants who charge over $100 to do  the work for you. But you can do it yourself in about 15 minutes and it  can cost as little as $1.99 for a year. If you do some research, learn a  little and work smart, you can save yourself some money &#8211; and some  headaches.</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=History+of+Domain+Names+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1839" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=History+of+Domain+Names+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1839" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2011/05/history-of-domain-names/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to interpret traceroute results and knowing how traceroute works</title>
		<link>http://www.supportsages.com/blog/2010/11/how-to-interpret-traceroute-results-and-knowing-how-traceroute-works/</link>
		<comments>http://www.supportsages.com/blog/2010/11/how-to-interpret-traceroute-results-and-knowing-how-traceroute-works/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 02:55:49 +0000</pubDate>
		<dc:creator>vince</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[ICMP]]></category>
		<category><![CDATA[router]]></category>
		<category><![CDATA[RTT]]></category>
		<category><![CDATA[traceroute]]></category>
		<category><![CDATA[TTL]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1516</guid>
		<description><![CDATA[How many times have you been asked for providing a 'traceroute' output by your Hosting provider, or if you are an admin working with a hosting provider, how many times you've asked for the results of traceroute to your client ? Here is an article which explains all about how to intrepret a traceroute results.

<strong><em>What is Traceroute ?
</em></strong>
Traceroute is the program that shows you the route over the network between two systems, listing all the intermediate routers a connection must pass through to get to its destination. It can help you in analyzing why the connections from your end to ...]]></description>
			<content:encoded><![CDATA[<p>How many times have you been asked for providing a &#8216;traceroute&#8217; output by your Hosting provider, or if you are an admin working with a hosting provider, how many times you&#8217;ve asked for the results of traceroute to your client ? Here is an article which explains all about how to intrepret a traceroute results.</p>
<p><strong><em>What is Traceroute ?<br />
</em></strong><br />
Traceroute is the program that shows you the route over the network between two systems, listing all the intermediate routers a connection must pass through to get to its destination. It can help you in analyzing why the connections from your end to a server is poor, and can often help you to spot what exactly is the problem. It always shows you how your machine is connected to ISP and ISP to the rest of the network, collectively the connection between your end and server.</p>
<p>When we initiate Traceroute, it sends a sequence of Internet Control Message Protocol (ICMP) packets addressed to a destination host. It passes through a series of intermediate routers, which involves a TTL (Time-to-Live) value. TTL refers to how many routers your packet can go through before its expires. Routers will discard a packet when the TTL has reached zero, returning an ICMP error message Code 11 (ICMP Time Exceeded) to the sender.</p>
<p><strong><em>Executing traceroute</em></strong></p>
<p><strong><em> </em></strong> The only required parameter is the name or IP address of the destination host .  The optional packet length is the total size of the probing packet (default 60 bytes for IPv4 and 80 for IPv6).</p>
<p>In Unix machines		:	traceroute server-name		(traceroute supportsages.com)<br />
In Windows machines	:	tracert server-name			(tracert supportsages.com)</p>
<p>We will be discussing in detail about traceroute in IPv4, Unix environment</p>
<p>In general, traceroute can be found in /usr/sbin. So the traceroute command can be also run as</p>
<pre class="brush: bash; title: ; notranslate">/usr/sbin/traceroute server-name</pre>
<p>You can check where traceroute is located using the command :</p>
<pre class="brush: bash; title: ; notranslate">root@server:~$ which traceroute
/usr/sbin/traceroute</pre>
<p><strong><em>Traceroute main options</em></strong></p>
<p>traceroute [-m] [-q] [-w]</p>
<p>-m :  Specifies the maximum number of hops (max Time-To-Live value). The default is 30.<br />
-q  :  Sets the number of UDP packets per hop. The default is 3<br />
-w :  Set  the  time  (in  seconds)  to wait for a response to a probe. Default 5 seconds</p>
<p><strong><em>Reading the Output</em></strong></p>
<p>When a traceroute command is executed, generally it will go for a maximum of 30 hops. On the Internet, most data packets need to go through several routers before they reach their final destination. Each time the packet is forwarded to the next router, a Hop occurs. The more hops, the longer it takes for data to go from source to destination. So the fewer hops it takes to get your data, the faster your access will be. Such 30 hops are counted when executing a traceroute command.</p>
<p><strong><em>Syntax of the result of a traceroute command</em></strong></p>
<p>linx-1.init7.net (195.66.224.175)  252.199 ms  253.216 ms  253.359 ms<br />
(Target Server) (IP address)       (RTT 1)          (RTT 2)           (RTT 3)</p>
<p>Here is the full result of a traceroute command :</p>
<pre class="brush: bash; title: ; notranslate">root@server:~$ traceroute supportsages.com
traceroute to supportsages.com (188.40.112.243), 30 hops max, 60 byte packets
1  192.168.1.1 (192.168.1.1)  24.361 ms  24.371 ms  24.394 ms
2  ABTS-KK-dynamic-001.0.172.122.airtelbroadband.in (122.172.0.1)  38.161 ms  39.415 ms  40.911 ms
3  ABTS-KK-Static-093.32.166.122.airtelbroadband.in (122.166.32.93)  43.195 ms  43.587 ms  48.054 ms
4  ABTS-KK-Static-009.32.166.122.airtelbroadband.in (122.166.32.9)  48.304 ms  49.512 ms  51.947 ms
5  122.175.255.29 (122.175.255.29)  53.312 ms  55.444 ms  57.223 ms
6  59.145.36.230 (59.145.36.230)  235.823 ms  212.100 ms  212.298 ms
7  linx-1.init7.net (195.66.224.175)  252.199 ms  253.216 ms  253.359 ms
8  r1ams2.core.init7.net (77.109.128.34)  252.791 ms  253.008 ms  255.776 ms
9  r1ams1.core.init7.net (77.109.128.145)  255.973 ms  256.212 ms  256.592 ms
10  r1fra1.core.init7.net (77.109.128.153)  345.600 ms  345.906 ms  346.151 ms
11  gw-hetzner.init7.net (77.109.135.18)  358.110 ms  358.565 ms  358.808 ms
12  hos-bb1.juniper2.fs.hetzner.de (213.239.240.243)  359.089 ms hos-bb1.juniper1.fs.hetzner.de (213.239.240.242)  233.990 ms hos-bb1.juniper2.fs.hetzner.de (213.239.240.243)  233.347 ms
13  hos-tr4.ex3k10.rz10.hetzner.de (213.239.227.235)  235.315 ms hos-tr2.ex3k10.rz10.hetzner.de (213.239.227.171)  233.554 ms hos-tr4.ex3k10.rz10.hetzner.de (213.239.227.235)  242.239 ms
14  main.supportsages.com (188.40.112.203)  235.676 ms  241.867 ms  242.565 ms
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *</pre>
<p><strong><em>Analyzing the Output</em></strong></p>
<p>The first line shows the target server, that server&#8217;s IP address, the maximum number of hops that will be allowed, and the size of the packets being sent. The following line for each system or router in the path between your machine and the target server. Each line shows the name of the server (as determined from DNS, if it cannot perform a Reverse DNS, only the IP address is shown), the system&#8217;s IP address, and three Round Trip Times (RTTs) in milliseconds. These RTTs shows the time it took a packet to get from your machine to the server and back again, called the latency between the two systems. By default, three packets are sent to each system along the route, so it shows three RTTs.</p>
<p><strong><em>Understanding the issues</em></strong></p>
<p>1) Some times the output may have one or two of the RTTs missing</p>
<p>linx-1.init7.net (195.66.224.175)  252.199 ms  * *</p>
<p>In this case, the server is up and responding, but for some reason it did not respond to the second and third packets. This does not necessarily indicate a problem; in fact, it is usually normal, and just means that the system discarded the packet for some reason. These are most often computers, rather than dedicated routers. Systems running Solaris routinely show an asterisk instead of the second RTT.</p>
<p>It&#8217;s important to remember that timeouts are not necessarily an indication of packet loss.</p>
<p>2) Sometimes you will see an entry with just an IP address and no server name :</p>
<p>77.109.128.153  255.973 ms  256.212 ms  256.592 ms</p>
<p>This simply means that a reverse DNS lookup on the address failed, so the name of the server could not be determined.</p>
<p>3) If your traceroute ends in all timeouts, like this:</p>
<p>12  gw-hetzner.init7.net (77.109.135.18)  358.110 ms  358.565 ms  358.808 ms<br />
13  * * *<br />
14  * * *<br />
15  * * *</p>
<p>This means that the target host could not be reached. Precisely, it means that the packets could not reach there and back. They may actually be reaching the target system but encountering problems on the return. This is possibly due to some kind of problem, but it may also be an intentional block due to a firewall or other security measures, and the block may affect traceroute but not real server connections.</p>
<p>After the trip time, some additional annotation can be printed</p>
<p>!H Host unreachable</p>
<p>!N Network unreachable</p>
<p>!P Protocol  unreachable</p>
<p>!S  Source  route failed</p>
<p>!F Fragmentation needed</p>
<p>!X Communication administratively prohibited</p>
<p>!V Host precedence violation</p>
<p>!C Precedence  cutoff  in effect</p>
<p>!&lt;num&gt;  ICMP unreachable code &lt;num&gt;.</p>
<p>If almost all the probes result in some kind of unreachable, traceroute will give up  and exit.</p>
<p><em><strong>How it Works</strong></em></p>
<p>As mentioned earlier, Routers will discard a packet when the TTL has reached zero, returning an ICMP error message Type 11 (ICMP Time Exceeded) to the sender. This is the basic principle behind Traceroute command. This ICMP error message will give more information about each hop in the path.</p>
<pre class="brush: bash; title: ; notranslate">root@server:~$ traceroute supportsages.com
traceroute to supportsages.com (188.40.112.243), 30 hops max, 60 byte packets
1  192.168.1.1 (192.168.1.1)  24.361 ms  24.371 ms  24.394 ms
2  ABTS-KK-dynamic-001.0.172.122.airtelbroadband.in (122.172.0.1)  38.161 ms  39.415 ms  40.911 ms
3  ABTS-KK-Static-093.32.166.122.airtelbroadband.in (122.166.32.93)  43.195 ms  43.587 ms  48.054 ms
4  ABTS-KK-Static-009.32.166.122.airtelbroadband.in (122.166.32.9)  48.304 ms  49.512 ms  51.947 ms
5  122.175.255.29 (122.175.255.29)  53.312 ms  55.444 ms  57.223 ms
6  59.145.36.230 (59.145.36.230)  235.823 ms  212.100 ms  212.298 ms
7  linx-1.init7.net (195.66.224.175)  252.199 ms  253.216 ms  253.359 ms
8  r1ams2.core.init7.net (77.109.128.34)  252.791 ms  253.008 ms  255.776 ms
9  r1ams1.core.init7.net (77.109.128.145)  255.973 ms  256.212 ms  256.592 ms
10  r1fra1.core.init7.net (77.109.128.153)  345.600 ms  345.906 ms  346.151 ms
11  gw-hetzner.init7.net (77.109.135.18)  358.110 ms  358.565 ms  358.808 ms
12  hos-bb1.juniper2.fs.hetzner.de (213.239.240.243)  359.089 ms hos-bb1.juniper1.fs.hetzner.de (213.239.240.242)  233.990 ms hos-bb1.juniper2.fs.hetzner.de (213.239.240.243)  233.347 ms
13  hos-tr4.ex3k10.rz10.hetzner.de (213.239.227.235)  235.315 ms hos-tr2.ex3k10.rz10.hetzner.de (213.239.227.171)  233.554 ms hos-tr4.ex3k10.rz10.hetzner.de (213.239.227.235)  242.239 ms
14  main.supportsages.com (188.40.112.203)  235.676 ms  241.867 ms  242.565 ms
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *</pre>
<p>In the first step, an ICMP request was sent from the router (Here it is 192.168.1.1) to 188.40.112.243 with TTL 1. Since the server was not directly connected to the router, an ICMP Error message, Code 11 (TTL Exceeded) was returned along with it’s source address. It is clear that the very first hop to 188.40.112.243 is from our local router. Thus the router IP (192.168.1.1) is shown along with three RTTs.</p>
<p>Traceroute will always search for a Server Name, if possible. So the server name is displayed along with its IP address (if it cannot perform a Reverse DNS, the IP addres is only shown)</p>
<p>Traceroute will again send 3 more packets, with  TTL 2. The same thing will happen, the next router will respond with its IP address and RTTs. This will go on until the target server or  maximum hop count is reached. If the target server is reached, the ICMP Code 0, Echo Reply will be sent and thus Traceroute knows the job is finished. In this case the target server is reached well before the maximum hop counts. So what we saw is a successful traceroute attempt. No issues at all !</p>
<p>The image explains it all &#8211; A series of Routers are skipped for the sake of representation</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/11/img2.png" class="thickbox no_icon" rel="gallery-1516" title="img2"><img class="alignnone size-full wp-image-1547" title="img2" src="http://www.supportsages.com/blog/wp-content/uploads/2010/11/img2.png" alt="" width="387" height="548" /></a></p>
<div><em><strong>References</strong></em></div>
<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } 		A:link { so-language: zxx } --><a  href="http://www.mediacollege.com/internet/troubleshooter/traceroute.html" target="_blank">http://www.mediacollege.com/internet/troubleshooter/traceroute.html</a></p>
<p><a  href="http://www.exit109.com/%7Ejeremy/news/providers/traceroute.html" target="_blank">http://www.exit109.com/~jeremy/news/providers/traceroute.html</a></p>
<p><a  href="http://www.akmos.com/support/techsupport/traceroute.html" target="_blank">http://www.akmos.com/support/techsupport/traceroute.html</a></p>
<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --><a  href="http://www.ehow.com/how_6468192_understand-traceroute-output.html" target="_blank">http://www.ehow.com/how_6468192_understand-traceroute-output.html</a></p>
<p><a  href="http://mellowd.co.uk/ccie/?p=609" target="_blank">http://mellowd.co.uk/ccie/?p=609</a></p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=How+to+interpret+traceroute+results+and+knowing+how+traceroute+works+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1516" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=How+to+interpret+traceroute+results+and+knowing+how+traceroute+works+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1516" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/11/how-to-interpret-traceroute-results-and-knowing-how-traceroute-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to setup 50 free Google powered email accounts for your domain with cPanel &#8211; Part (1)</title>
		<link>http://www.supportsages.com/blog/2010/10/setup-google-apps-on-your-domain-with-cpanel-and-create-upto-50-custom-email-accounts-for-free-part-1/</link>
		<comments>http://www.supportsages.com/blog/2010/10/setup-google-apps-on-your-domain-with-cpanel-and-create-upto-50-custom-email-accounts-for-free-part-1/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 10:43:59 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Webmail]]></category>
		<category><![CDATA[50 custom email accounts]]></category>
		<category><![CDATA[free email accounts]]></category>
		<category><![CDATA[google apps]]></category>
		<category><![CDATA[google apps in cpanel]]></category>
		<category><![CDATA[how to set up google apps]]></category>
		<category><![CDATA[setup google apps for your domain]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1367</guid>
		<description><![CDATA[This article is on how to setup Google Apps to work on your domain with 6 easy steps. When you purchase a domain (e.g. your-domain.com) for your website from any of the domain registrars such as Godaddy , you normally get a single free email account that includes limited storage space. This is where Google apps comes in for your rescue. By using this feature, provided to you by Google, you can use Google mail servers for transferring your mails and that too from your very own domains. The advantages are plenty, as we all know Gmail has proven over ...]]></description>
			<content:encoded><![CDATA[<p>This article is on how to setup Google Apps to work on your domain with 6 easy steps. When you purchase a domain (e.g. your-domain.com) for your website from any of the domain registrars such as Godaddy , you normally get a single free email account that includes limited storage space. This is where Google apps comes in for your rescue. By using this feature, provided to you by Google, you can use Google mail servers for transferring your mails and that too from your very own domains. The advantages are plenty, as we all know Gmail has proven over the years that it provides the most reliable e-mail service. How many times have you moved your domain to a new server and been frustrated by the fact that you lost all of your e-mail messages? If you switch over to Google Apps, you never have to worry about that again. Again the service and support provided by google is without doubt the best and uncomparable with your hosting companie&#8217;s or your service provider&#8217;s. Another advantage is that the server limits of your account will not affect the number of mails that you can sent or recieve if you use the Google apps. I have only mentioned a few above but the list goes on and on.</p>
<p>The praises can be sung without a pause but its better I stop the boasts here and get down to the original topic.  I’m going to explain, step-by-step, on how to accomplish this task. It’s actually very simple, but it might take quite some time depending on how good a techy you are. To begin with, head on over to Google and sign up for an account. I am siting the link below where you can do this :</p>
<p>http://www.google.com/apps/intl/en/business/index.html</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-homepage.png" class="thickbox no_icon" rel="gallery-1367" title="G-Apps-Homepage"><img class="alignnone size-full wp-image-1373" title="G-Apps-Homepage" src="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-homepage.png" alt="" width="581" height="387" /></a></p>
<p>In the above page click on the &#8216; <strong><em>Apps Editions</em></strong> &#8216; tab and you will be able to view different schemes they offer, from which you will be able to select the one which suits you the most. For most of us, the standard edition offered by Google is more than enough. However, they do offer a “Premier edition” if your needs exceed the services of the free accounts. In addition to the Standard edition and Premier edition there are  Educational schemes, Govermental schemes etc etc. Once you choose the package required you will be directed to a page with a blue colored &#8216; <em><strong>Get started</strong></em> &#8216; tab on the right most top corner of the page. This is your key, click on it and you are on your way to setting Google apps for your domain. I am going to list  everything step by step from here on in a detailed manner.<br />
<strong> </strong></p>
<p><strong>Step I : Tell them your registered Domain name.</strong></p>
<p>In the very first step you need to provide your domain name as prompted. Obviously enough you should possess a registered domain or you can buy a new domain name through Google which automatically sets everything up for you. You also need to verify that you own the domain or if you are a member of the domain.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/10/gapps2.png" class="thickbox no_icon" rel="gallery-1367" title="enter-domain"><img class="alignnone size-full wp-image-1382" title="enter-domain" src="http://www.supportsages.com/blog/wp-content/uploads/2010/10/gapps2.png" alt="" width="422" height="268" /></a></p>
<p><strong>Step II : Tell them who you are.</strong></p>
<p>Fill in all of your contact information. At least <strong>make sure that you fill in all the boxes which have an aestrics symbol (*)</strong> to the right of the label with proper and valid information. If you don’t provide the required information, you will receive an error when you submit the form.<br />
An important thing that you should be absolutely sure of before filling up the form is that you are able to edit your server’s DNS zone files. If you cannot edit your DNS zone files, do not proceed. You will have to enter MX records pointing to the Google mail servers in your DNS configuration. Signing up for the Google Apps account is useless if you’re not going to be able to modify your server appropriately to have the e-mail go where it’s intended.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-contactinfo.png" class="thickbox no_icon" rel="gallery-1367" title="contactinfo"><img class="alignnone size-full wp-image-1384" title="contactinfo" src="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-contactinfo.png" alt="" width="596" height="325" /></a></p>
<p>The screenshot above was limited by my monitor boundaries, but you will be able to see the &#8216; <em><strong>Continue</strong></em> &#8216; tab at the bottom of your screen. Click this and you are on step III.<br />
<strong> </strong></p>
<p><strong>Step III : Create your first administrator account.</strong></p>
<p>Create your first e-mail account. This e-mail account will be used as the administrative account for the Google Apps services.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-setup.png" class="thickbox no_icon" rel="gallery-1367" title="admin-setup"><img class="alignnone size-full wp-image-1390" title="admin-setup" src="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-setup.png" alt="" width="583" height="398" /></a></p>
<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<p>Below this you will be able to see the terms and conditions, which mostly contains the usual stuff but still worth a read, where you should click on the &#8216; <em><strong>I accept. Continue with setup</strong></em> &#8216; tab to proceed to the next step.</p>
<p><strong>Step IV : Verify Domain Ownership.</strong></p>
<p>The next step in the process is to prove to Google that you own and have administrative rights to the domain you chose.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-verify.png" class="thickbox no_icon" rel="gallery-1367" title="verify-I"><img class="alignnone size-full wp-image-1393" title="verify-I" src="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-verify.png" alt="" width="611" height="231" /></a></p>
<p>Here you will have an option to do it later, but sooner the better. Once you choose the option to continue you will be prompted for the password you chose in the previous step.<br />
You have three options to prove that you own the domain. The first option is to modify your DNS entries to add a unique CNAME record. Next option is to add a meta tag to your site&#8217;s home page.  The last option is to simply create and upload an HTML file to your Web server. Okay now there is no reason for you to panic from hearing all the complex terms, all you need to do is click on these options and viola, all the information you need on &#8216;How to&#8217; gets detailed (or rather spoon fed) right on the screen.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-verify2.png" class="thickbox no_icon" rel="gallery-1367" title="real-verify2"><img class="alignnone size-full wp-image-1402" title="real-verify2" src="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-verify2.png" alt="" width="623" height="348" /></a></p>
<p>As you can see the screenshot above you will have a drop down menu for a list of domain registrars among which you can choose yours and do as instructed. Otherwise you can simply choose the &#8216; <em><strong>Others</strong></em> &#8216; option from the drop down menu and follow the simple set of instructions which gets listed.<br />
This will look somewhat like the following :</p>
<p>&lt;&lt;</p>
<p><em>A TXT record is an entry within the Domain Name System (DNS) that provides supplemental information about your domain. You can create a TXT record that proves to Google that you own the domain.</em></p>
<p><em>1.<strong> Add</strong> the TXT record below to the DNS configuration for <strong>your-domain.com.</strong><br />
google-site-verification=Zy5aERjpb4-T1S0Ig36pGuHDOE5MycRBGsVmCtVeTLY<br />
2. <strong>Click</strong> verify below.<br />
When Google finds this DNS TXT record, we&#8217;ll make you a verified owner of the domain. (Note: DNS changes may take some time. If we don&#8217;t find the record immediately, we&#8217;ll check for it periodically.)<br />
Leave the TXT record in place even after verification succeeds. </em></p>
<p><em>&gt;&gt;<br />
</em></p>
<p>For adding the TXT record in the DNS zone log into your domain control panel and choose the<strong> edit DNS zone</strong> option. The name of the option might vary between control panels, but they provide the same functionalities. I am pasting yet another screenshot which might help you through this simple process.</p>
<p><strong>NOTE</strong> : For the rest of the article I will be siting examples and providing screenshots only from, and in reference to, the <strong>cPanel</strong>. But it will not be difficult to figure out how it is done in other control panels once you get an idea on what we are doing here.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-TXT.png" class="thickbox no_icon" rel="gallery-1367" title="TXT"><img class="alignnone size-full wp-image-1404" title="TXT" src="http://www.supportsages.com/blog/wp-content/uploads/2010/10/real-TXT.png" alt="" width="606" height="76" /></a></p>
<p>You can see that I simply pasted the text mentioned in the instructions. After doing this you can click on &#8216;<em><strong>Verify</strong></em>&#8216; which will, quite obviously, verify if the entry is made and thereby confirming your authority over the domain.</p>
<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } --></p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=How+to+setup+50+free+Google+powered+email+accounts+for+your+domain+with+cPanel+-+Part+%281%29+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1367" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=How+to+setup+50+free+Google+powered+email+accounts+for+your+domain+with+cPanel+-+Part+%281%29+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1367" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/10/setup-google-apps-on-your-domain-with-cpanel-and-create-upto-50-custom-email-accounts-for-free-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IFS</title>
		<link>http://www.supportsages.com/blog/2010/09/ifs/</link>
		<comments>http://www.supportsages.com/blog/2010/09/ifs/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 18:51:19 +0000</pubDate>
		<dc:creator>victor</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Customer Care]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Offers]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Specials]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[ifs]]></category>
		<category><![CDATA[linux. bash]]></category>
		<category><![CDATA[while]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1236</guid>
		<description><![CDATA[How many times have you written scripts and a had bad time with those having spaces? The remedy to this situation is your IFS value.

IFS or Internal Field Seperator holds the value which seperates the various entities. This can be file names, values read into a script by read etc. It is the character or characters designated as whitespace by the operating system.

The IFS is set to the newline and space character. The global variable $IFS stores the value. To view the exact value stored in IFS execute:
[bash]
echo &#34;$IFS&#34; &#124; cat -vTE
 ^I$
$
[/bash]
Running echo "$IFS" will not give you any ...]]></description>
			<content:encoded><![CDATA[<p>How many times have you written scripts and a had bad time with those having spaces? The remedy to this situation is your IFS value.</p>
<p>IFS or Internal Field Seperator holds the value which seperates the various entities. This can be file names, values read into a script by read etc. It is the character or characters designated as whitespace by the operating system.</p>
<p>The IFS is set to the newline and space character. The global variable $IFS stores the value. To view the exact value stored in IFS execute:</p>
<pre class="brush: bash; title: ; notranslate">
echo &quot;$IFS&quot; | cat -vTE
 ^I$
$
</pre>
<p>Running echo &#8220;$IFS&#8221; will not give you any visible output (after all, you are going to see a space and a newline). cat -vTE displays non printable characters , tabs as ^I and ends each line with a $ sign.</p>
<p>In a script which utilises filenames (with spaces), it is always preferable to change the IFS to include only the newline character opposed to the default space and newline character. Lets check out one such script which accepts filenames wih spaces. This scripts simply prints the file names in your current directory. (Remember to create some files in your currenct directory which has spaces. You may try the same script removing the lines with the IFS variable in reference to see the difference)</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
OIFS=$IFS # Original IFS

IFS=$(echo -en &quot;\n\b&quot;) # New IFS

for fil in $(ls -1 $PWD); do
	echo $fil
done

IFS=$OIFS # Restore earlier IFS
</pre>
<p>IFS can also be used to read files with lines sepearated by a special character. For example in the /etc/passwd, to store the various entries like username, homedirectory etc.</p>
<p>The following script uses the while construct to determine the users who have the shell portion as /bin/false</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash

OIFS=$IFS
IFS=':'

while read username password userid groupid comments homedir shell_avail
do
	if [[ $shell_avail == /bin/false ]]; then
                echo &quot;$username has no shell&quot;
        fi

done &lt; /etc/passwd
IFS=$OIFS
</pre>
<p>In the above script each of the 7 portions of the /etc/passwd file is assigned to the 7 variables<br />
username password userid groupid comments homedir shell_avail with the read command. The if portion in the script compares the seventh variable &#8211; shell_avail to /bin/false to determine the username and outputs it. </p>
<p>From now on you can use the IFS variable for all those files with spaces and extracting values separated by a special character.</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=IFS+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1236" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=IFS+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1236" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/09/ifs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RootKits and anti rootkits</title>
		<link>http://www.supportsages.com/blog/2010/09/rootkits-and-anti-rootkits/</link>
		<comments>http://www.supportsages.com/blog/2010/09/rootkits-and-anti-rootkits/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 18:40:25 +0000</pubDate>
		<dc:creator>victor</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Designing]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Offers]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Specials]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[chkrootkit]]></category>
		<category><![CDATA[rootkit]]></category>
		<category><![CDATA[vulnerability]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1230</guid>
		<description><![CDATA[A rootkit is a collection of programs that enable an attacker to get the same privilage as the root user in a linux or unix system. The word is composed of two portions: 'root' - meaning the application will provide the highest access level of the root/administrator in the system and 'kit' - meaning it has a number of tools.

Attackers after getting access to a server, will install a rootkit to hide their identity and run desired scripts anywhere within the server. It makes the life of a hacker easy once installed. Rootkits are not easily detectable. Sometimes, if the ...]]></description>
			<content:encoded><![CDATA[<p>A rootkit is a collection of programs that enable an attacker to get the same privilage as the root user in a linux or unix system. The word is composed of two portions: &#8216;root&#8217; &#8211; meaning the application will provide the highest access level of the root/administrator in the system and &#8216;kit&#8217; &#8211; meaning it has a number of tools.</p>
<p>Attackers after getting access to a server, will install a rootkit to hide their identity and run desired scripts anywhere within the server. It makes the life of a hacker easy once installed. Rootkits are not easily detectable. Sometimes, if the rootkit is one of the latest ones without a diagnosis, the server will have to be rebuild from scratch.</p>
<p>A rootkit will have multiple applications for cracking the entire server, some of them are:</p>
<p><strong>Server Access Applications (Back door application)</strong><br />
These applications will create a backdoor to log in to the hacked system without using the exploit again.</p>
<p><strong>Log clearing Applications</strong><br />
These applications clear the logs of the events performed by the hacker or the applications used. They all the associated log files in the server.</p>
<p><strong>Packet sniffing Applications</strong><br />
These applications monitor the data through the various interfaces in the server at particular ports.</p>
<p><strong>Malicious Scripts</strong><br />
Many scripts will be installed like IRC bots, ddos daemons, spam servers, trojans, worms etc.</p>
<p>There are mainly two kinds of root kits. The application rootkit and the kernel rootkit.</p>
<p><strong>Application rootkits</strong><br />
These rootkits mimic a particular application and will hide the attackers files/processes from being revealed by the original application. To illustrate, a rootkit <em>ls </em>application will perform all the task of a normal ls but will not display any of the files of the attacker. Other application rootkits will create backdoors for unauthorised access, packet sniffers etc which go undetected or are hidden by renaming. Application rootkits are the most common.</p>
<p><strong>Kernel rootkits</strong><br />
Kernel rootkits modify the kernel and apply patches to the kernel and device drivers. They also hide the applications and files of the attacker. As antivirus and other applications run beneath the kernel, they are the most undetectable rootkits.</p>
<p>&#8216;Prevention is better than cure&#8217; &#8211; as this saying goes, it is always better to keep the system secure and updated when ever possible to stop these installations. There are some applications which help detect any known rootkits running in the system. One such is the chkrootkit.</p>
<p>chkrootkit is one of the popular rootkit detectors (an anti-rootkit) and it is know to detect common rootkits on unix/linux servers. chkrootkit relies on basic string processing techniques to determine the presence of rootkits. It scans specific sytem files and binaries targeted by rootkits for known signatures.</p>
<p>The following are the instructions to install chkrootkit version 0.49 in a server.</p>
<pre class="brush: bash; title: ; notranslate">cd /usr/local/

wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz

wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.md5

md5sum -c chkrootkit.md5 # to check if the downloaded file is intact

tar -xzf chkrootkit.tar.gz

cd chkrootkit-0.49/

make sense

./chkrootkit
</pre>
<p>chkroootkit will check all the files and display the status of the files analysed. This information may be logged for future reference. For this a cron job may be setup to be run at least once a month.</p>
<p>Inserting an entry like the one below into the systems cron tasks (executed atleast once a month) will send the report of the chkrootkit vulnerabilities to the administrator conserned.</p>
<pre class="brush: bash; title: ; notranslate">/usr/local/chkrootkit-0.49/chkrootkit | mail -s &quot;chkrootkit report $(date +%d/%m/%y)&quot; &quot;admin@domain.com&quot;</pre>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=RootKits+and+anti+rootkits+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1230" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=RootKits+and+anti+rootkits+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1230" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/09/rootkits-and-anti-rootkits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostgreSQL for the sage &#8211; Must know basics for the system administrators</title>
		<link>http://www.supportsages.com/blog/2010/08/postgresql-for-the-sage-must-know-basics-for-the-system-administrators/</link>
		<comments>http://www.supportsages.com/blog/2010/08/postgresql-for-the-sage-must-know-basics-for-the-system-administrators/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 16:24:44 +0000</pubDate>
		<dc:creator>victor</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[restore]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1144</guid>
		<description><![CDATA[﻿﻿PostgreSQL or Postgres is an object-relational database management system (ORDBMS). Unlike MySQL, PostgreSQL is not controlled by any single company, it is a community developed project. It is a advanced version of the 'Ingres' Database project (which is how the project gets the name post-ingres or postgres ).

Postgres is one of the best open-source database alternative which is fully object oriented and transactions compliant. It has stored procedures, multiple views and a huge set of datatypes. Some of the other notable features are as follows.

<strong>Objects and Inheritance</strong>

Database consists of objects and the database administrators can design custom or user-defined objects ...]]></description>
			<content:encoded><![CDATA[<p>﻿﻿PostgreSQL or Postgres is an object-relational database management system (ORDBMS). Unlike MySQL, PostgreSQL is not controlled by any single company, it is a community developed project. It is a advanced version of the &#8216;Ingres&#8217; Database project (which is how the project gets the name post-ingres or postgres ).</p>
<p>Postgres is one of the best open-source database alternative which is fully object oriented and transactions compliant. It has stored procedures, multiple views and a huge set of datatypes. Some of the other notable features are as follows.</p>
<p><strong>Objects and Inheritance</strong></p>
<p>Database consists of objects and the database administrators can design custom or user-defined objects for the tables. Inheritance is another feature. Tables can be set to inherit their characteristics from a &#8220;parent&#8221; table.</p>
<p><strong>Functions </strong></p>
<p>Functions can be used in Postgres. These can be written in the postgres&#8217; own procedural language called &#8216;PL/pgSQL&#8217; which resembles Oracle&#8217;s procedural language &#8216;PL/SQL&#8217; or any other common scripting languages which support posgtres&#8217; procedural language like PL/Perl, plPHP, PL/Python, PL/Ruby etc. Run the following in the psql client to determine if functions is enabled:</p>
<pre class="brush: bash; title: ; notranslate">SELECT true FROM pg_catalog.pg_language WHERE lanname = 'plpgsql'; </pre>
<p>To create user-defined functions we use the CREATE OR REPLACE FUNCTION  command.  Example:</p>
<pre class="brush: bash; title: ; notranslate">CREATE OR REPLACE FUNCTION fib (

fib_for integer

) RETURNS integer AS $$

BEGIN

IF fib_for &lt; 2 THEN

RETURN fib_for;

END IF;

RETURN fib(fib_for - 2) + fib(fib_for - 1);

END;

$$ LANGUAGE plpgsql;</pre>
<p><strong>Indexes </strong></p>
<p>An index is like a summary of a certain portion of the table. It is an optimization technique which increases speed of accessing records from a database. PostgreSQL supports indexes like Btree, hash etc. User-defined index methods can also be created. Indexes are created on tables with respect to a particular field (based on which there are a number of queries). As an example for a table:</p>
<pre class="brush: bash; title: ; notranslate">CREATE TABLE name (

id integer,

fname varchar

lname varchar

);</pre>
<p>To create an index on table name with respective to the field id (as there are many queries on this table requesting for firstname or lastname from the id provided), we use the index:</p>
<pre class="brush: bash; title: ; notranslate">CREATE INDEX name_id_index ON name (id);</pre>
<p><strong>Triggers</strong></p>
<p>Triggers are events or functions run upon the action of certain SQL statements which modify data in some records. Depending on the kind of modification we can have multiple triggers in a database. Postgres supports multiple triggers written in PL/PgSQL or it&#8217;s scripting counterparts like PL/Python. The trigger function must be defined before the trigger can be created. The trigger function must be declared as a function taking no arguments and returning type trigger. CREATE TRIGGER command is used to declare triggers.</p>
<p><strong>Concurrency </strong></p>
<p>PostgreSQL ensures concurrency with the help of MVCC (Multi-Version Concurrency Control), which gives the database user a &#8220;snapshot&#8221; of the database, allowing changes to be made without being visible to other users until a transaction is committed.</p>
<p>PostgreSQL&#8217;s MVCC keeps all of the versions of the data together in the same partition in the same table. By identifying which rows were added by which transactions, which rows were deleted by which transactions, and which transactions have actually committed, it becomes a straightforward check to see which rows are visible for which transactions.</p>
<p>Inorder to accomplish this, Rows of a table are stored in PostgreSQL as a tuple. Two fields of each tuple are xmin and xmax. Xmin is the transaction ID of the transaction that created the tuple. Xmax is the transaction ID of the transaction that deleted it (if any).</p>
<p>Along with the tuples in each table, a record of each transaction and its current state (in progress, committed, aborted) is kept in a universal transaction log.</p>
<p>When data in a table is selected, only those rows that are created and not destroyed are seen. That is, each row&#8217;s xmin is observed. If the xmin is a transaction that is in progress or aborted, then the row is invisible. If the xmin is a transaction that has committed, then the xmax is observed. If the xmax is a transaction that is in progress or aborted and not the current transaction, or if there is no xmax at all, then the row is seen. Otherwise, the row is considered as already deleted.</p>
<p>Insertions are straightforward. The transaction that inserts the tuple simply creates it with the xmax blank and the xmin set to its transaction ID. Deletions are also straightforward. The tuple&#8217;s xmax is set to the current transaction. Updates are no more than a concurrent insert and delete.</p>
<p><strong>Views</strong></p>
<p>A view is a table which does not exist in the database. It is a virtual table created from fields in various tables and is joined together based on some criteria. Views can be used in place of tables and will accomplish the task same as that of a table. The CREATE VIEW statement is used to accomplish this eg:</p>
<pre class="brush: bash; title: ; notranslate">CREATE VIEW best_sellers AS

SELECT * FROM publishers WHERE demand LIKE 'high';</pre>
<p><strong>Foreign Keys</strong></p>
<p>The primary key used in one table which is used to refer to the records in a second table is called the foreign key of the second table.</p>
<pre class="brush: bash; title: ; notranslate">CREATE TABLE products (
    product_no integer PRIMARY KEY,
    name text,
    price numeric
);
CREATE TABLE orders (
    order_id integer PRIMARY KEY,
    product_no integer REFERENCES products (product_no),
    quantity integer
);</pre>
<p>Here product_no is the foreign key in the second table created. The foreign key field may have values which are repeated unlike primary keys.</p>
<p><strong>Files Users and Configuration</strong></p>
<p>The main configuration file of Postgres is postgresql.conf. This can be located in the &#8216;data&#8217; directory. It may be present either in /var/lib (/var/lib/pgsql/data/postgresql.conf) or /usr/local (/usr/local/pgsql/data/postgresql.conf). Temporary changes to the configurations can be made using postmaster command.</p>
<p>The init script that starts the postgres service is /etc/init.d/postgresql . It runs a number of child processes concurrently. The postgres server process is postmaster. These processes and files associated with PosgreSQL are owned by the user/group postgres. The default port used for database connections is 5432</p>
<p>The user postgres is the PostgreSQL database superuser. We can create a number of super users for the database (this accomplished by the create role command ), however, the default super user is postgres. The postgres user has the privilege to access all the databases and files in the server (Unless the user root is created in postgres as a superuser).</p>
<p>Client Authentication is controlled by the file pg_hba.conf in the data directory, e.g., /var/lib/pgsql/data/pg_hba.conf. (HBA stands for host-based authentication.)</p>
<p>Each record specifies a connection type, a client IP address range (if relevant for the connection type), a database name or names, and the authentication method to be used for connections matching these parameters.A record is typically in one of two forms:</p>
<p>local   database authentication-method [ authentication-option ]</p>
<p>host    database IP-address IP-mask authentication-method [ authentication-option ]</p>
<p>local : This record pertains to connection attempts over Unix domain sockets.</p>
<p>host : This record pertains to connection attempts over TCP/IP networks.</p>
<p>database : Specifies the database that this record applies to. The value all specifies that it applies to all databases, while the value sameuser identifies the database with the same name as the connecting user.</p>
<p>authentication methods</p>
<p>trust: The connection is allowed unconditionally.</p>
<p>reject: The connection is rejected unconditionally.</p>
<p>password: The client is required to supply a password which is required to match the database password that was set up for the user.</p>
<p>md5: Like the password method, but the password is sent over the wire encrypted using a simple challenge-response protocol.</p>
<p>ident: This method uses the &#8220;Identification Protocol&#8221; as described in RFC 1413. It may be used to authenticate TCP/IP or Unix domain socket connections, but its reccomended use is for local connections only and not remote connections.</p>
<p><strong>Front-ends </strong></p>
<p>The minimalistic front-end for PostgreSQL is the psql command-line. It can be used to enter SQL queries directly, or execute them from a file. phpPgAdmin is a web-portal used for PostgreSQL administration written in PHP and based on the popular phpMyAdmin. Likewise pgAdmin is a graphical front-end administration tool for PostgreSQL, which has support on multiple platforms. The latest stable version of the same is pgAdmin III.</p>
<p><strong>Some administration related commands</strong></p>
<p>Command to login to psql database mydb as user myuser:</p>
<pre class="brush: bash; title: ; notranslate">psql -d mydb -U myuser</pre>
<p>Command to login to psql database mydb as user myuser on a different host myhost:</p>
<pre class="brush: bash; title: ; notranslate">psql -h myhost -d mydb -U myuser</pre>
<p>If the port the server runs is different we use -p [port number] . Upon entering the psql shell the prompt will show the database name currently being used. In the above example it will show</p>
<pre class="brush: bash; title: ; notranslate">mydb=&gt; (if logged in as an ordinary user )</pre>
<pre class="brush: bash; title: ; notranslate">mydb=# (if logged in as a super user like postgres)</pre>
<p><strong>Create a PostgreSQL user </strong></p>
<p>There are two ways to create a postgres database user. The only user initially allowed to create users is postgres. So one has to switch to this user before creating other users with varying privileges.</p>
<p>1. Creating the user in the shell prompt, with createuser command.</p>
<p>switch to the postgres user with:</p>
<pre class="brush: bash; title: ; notranslate">su - postgres

createuser tom

Shall the new role be a superuser? (y/n) n

Shall the new role be allowed to create databases? (y/n) y

Shall the new role be allowed to create more new roles? (y/n) n</pre>
<p>2. Creating the user in the PSQL prompt, with CREATE USER command.</p>
<p>switch to the postgres user with:</p>
<pre class="brush: bash; title: ; notranslate">su - postgres

create user mary with password 'marypass';</pre>
<p><strong>Creating and deleting a PostgreSQL Database </strong></p>
<p>There are two way to create databases.</p>
<p>1. Creating database in the PSQL prompt, with createuser command.</p>
<pre class="brush: bash; title: ; notranslate">CREATE DATABASE db1 WITH OWNER tom;</pre>
<p>2. Creating database in the shell prompt, with createdb command.</p>
<pre class="brush: bash; title: ; notranslate">createdb db2 -O mary</pre>
<p>To delete an entire database from within the psql prompt do :</p>
<pre class="brush: bash; title: ; notranslate">DROP DATABASE db1;</pre>
<p><strong>Determining execution time of a query</strong></p>
<p>Turn on timing with</p>
<pre class="brush: bash; title: ; notranslate">\timing</pre>
<p>Now execute the qery:</p>
<pre class="brush: bash; title: ; notranslate">SELECT * from db1.employees ;

Time: 0.065 ms</pre>
<p><strong>Calculate postgreSQL database size in disk </strong></p>
<pre class="brush: bash; title: ; notranslate">SELECT pg_database_size('db1');</pre>
<p>to get the values in human readable format</p>
<pre class="brush: bash; title: ; notranslate">SELECT pg_size_pretty(pg_database_size('db1'));</pre>
<p>to calculate postgreSQL table size in disk</p>
<p>SELECT pg_size_pretty(pg_total_relation_size(&#8216;big_table&#8217;));</p>
<p><strong>Slash commands used in psql</strong></p>
<p>To list all slash commands and thier purpose. Login to psql and issue to the command \? . Some of the most commonly used slash commands are the following:</p>
<table>
<tbody>
<tr>
<td>List databases</td>
<td>\l</td>
</tr>
<tr>
<td>System tables</td>
<td>\dS</td>
</tr>
<tr>
<td>Types</td>
<td>\dT</td>
</tr>
<tr>
<td>Functions</td>
<td>\df</td>
</tr>
<tr>
<td>Operators</td>
<td>\do</td>
</tr>
<tr>
<td>Aggregates</td>
<td>\da</td>
</tr>
<tr>
<td>Users</td>
<td>\du</td>
</tr>
<tr>
<td>Quit from psql</td>
<td>\q</td>
</tr>
<tr>
<td>Connect to different database db2</td>
<td>\c db2</td>
</tr>
<tr>
<td>Describe Table/index/view/sequence</td>
<td>\d</td>
</tr>
</tbody>
</table>
<p>The below can be used with a specific table/index/view name for description of the specific table/index/view</p>
<table>
<tbody>
<tr>
<td>Tables</td>
<td>\dt</td>
</tr>
<tr>
<td>Indexes</td>
<td>\di</td>
</tr>
<tr>
<td>Sequences</td>
<td>\ds</td>
</tr>
<tr>
<td>Views</td>
<td>\dv</td>
</tr>
</tbody>
</table>
<p><strong>Useful Bash commands</strong></p>
<p>Bash command to list all the postgresql databases:</p>
<pre class="brush: bash; title: ; notranslate">psql -l #This can be run as a unix user who is also a super user in postgresql</pre>
<p>Indirect bash command to list all the postgresl users:</p>
<pre class="brush: bash; title: ; notranslate">psql -c '\du' #-c is used to run an internal or sql command in psql shell</pre>
<p><strong>Backing up and restoring databases</strong></p>
<p>To dump the database to an sql file use the bash command:</p>
<pre class="brush: bash; title: ; notranslate">pg_dump mydb &amp;gt; db.out</pre>
<p>To restore a database from an sql backup file (via bash)</p>
<pre class="brush: bash; title: ; notranslate">psql -d newdb -f backupdb.out

or

psql -f backupdb.out newdb</pre>
<p>(here the database newdb must be already created and the file backupdb.out must be present in the current directory)</p>
<p>To take the backup of all the Postgres databases in the server:</p>
<pre class="brush: bash; title: ; notranslate">pg_dumpall &gt; /var/lib/pgsql/backups/dumpall.sql</pre>
<p>(Only possible with the postgres or the database superuser )</p>
<p><strong>Resetting database user&#8217;s password</strong></p>
<p>To change the password for a database user (say &#8216;thomas&#8217;):</p>
<pre class="brush: bash; title: ; notranslate">ALTER USER thomas WITH PASSWORD 'newpassword';</pre>
<p>This same command can be used to reset the password for the postgresql super user postgres, but in this case, you will have to enable password less login for postgres user by adding the following line to the top of the file pg_hba.conf in the data directory of postgres. Once the password is reset this line can be removed:</p>
<pre class="brush: bash; title: ; notranslate">local	all	postgres	trust</pre>
<p>Next we issue the same command but for the user postgres</p>
<pre class="brush: bash; title: ; notranslate">ALTER USER postgres WITH PASSWORD 'newpassword';</pre>
<p>To create a super user via bash with multiple roles</p>
<pre class="brush: bash; title: ; notranslate">createuser -sPE mysuperuser</pre>
<p>Instead of this we can also use the below psql shell command:</p>
<pre class="brush: bash; title: ; notranslate">CREATE ROLE mysuperuser2 WITH SUPERUSER CREATEDB CREATEROLE LOGIN ENCRYPTED PASSWORD 'mysuperpass2';</pre>
<p><strong>Physical database files in postgres</strong></p>
<p>The files in data/base are named by the oid (Object Identifier) of the database record in</p>
<p>pg_database, like this:</p>
<pre class="brush: bash; title: ; notranslate">cd /var/lib/pgsql/data/base

ls -l

total 33

drwx------ 22 postgres postgres 4096 Jul 23 20:06 ./

drwx------ 11 postgres postgres 4096 Aug  1 05:59 ../

drwx------  2 postgres postgres 4096 Jun 20 09:32 1/

drwx------  2 postgres postgres 4096 Mar  3 13:36 10792/

drwx------  2 postgres postgres 4096 Jun 20 15:09 10793/

drwx------  2 postgres postgres 4096 May 27 01:40 16497/

drwx------  2 postgres postgres 4096 May 27 01:40 16589/

drwx------  2 postgres postgres 4096 Jun 20 10:28 16702/

drwx------  2 postgres postgres 4096 May 27 01:40 16764/

drwx------  2 postgres postgres 4096 May 27 01:40 16785/

drwx------  2 postgres postgres 4096 Aug  1 04:37 16786/

drwx------  2 postgres postgres 4096 Aug  1 04:36 19992/

drwx------  2 postgres postgres 4096 May 27 01:40 19997/</pre>
<p>To obtain the oid, execute the following command in psql prompt</p>
<pre class="brush: bash; title: ; notranslate">postgres=# select oid,datname from pg_database order by oid;

   oid  |         datname

---------+--------------------------

1 | template1

10792 | template0

10793 | postgres

16497 | gadgetwi_Unable

16589 | vimusicc_filehost

16702 | personea_altissimo

16764 | shopping_businessfinance

16785 | ansonyi_wp2

16786 | ansonyi_wp

19992 | globook_PostgreSQL</pre>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=PostgreSQL+for+the+sage+-+Must+know+basics+for+the+system+administrators+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1144" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=PostgreSQL+for+the+sage+-+Must+know+basics+for+the+system+administrators+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1144" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/08/postgresql-for-the-sage-must-know-basics-for-the-system-administrators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>All about SSL</title>
		<link>http://www.supportsages.com/blog/2010/07/all-about-ssl/</link>
		<comments>http://www.supportsages.com/blog/2010/07/all-about-ssl/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 22:14:05 +0000</pubDate>
		<dc:creator>victor</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[ca bundle]]></category>
		<category><![CDATA[certificate]]></category>
		<category><![CDATA[crt]]></category>
		<category><![CDATA[csr]]></category>
		<category><![CDATA[digest]]></category>
		<category><![CDATA[digital signature]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=962</guid>
		<description><![CDATA[﻿﻿﻿﻿SSL or Secure Sockets Layer (Notice the last s in sockets) is used to secure the communication over the internet. This technique was introduced by Netscape. It uses the RSA public key cryptography for encryption/decryption.

In the protocol stack used in the internet. The SSL protocol runs above TCP/IP and below higher-level protocols such as HTTP or IMAP.

The SSL protocol includes two sub-protocols:
1) SSL record protocol
2) SSL handshake protocol

The SSL record protocol defines the format used to transmit data. The SSL handshake protocol involves using the SSL record protocol to exchange a series of messages between an SSL-enabled server and an ...]]></description>
			<content:encoded><![CDATA[<p>﻿﻿﻿﻿SSL or Secure Sockets Layer (Notice the last s in sockets) is used to secure the communication over the internet. This technique was introduced by Netscape. It uses the RSA public key cryptography for encryption/decryption.</p>
<p>In the protocol stack used in the internet. The SSL protocol runs above TCP/IP and below higher-level protocols such as HTTP or IMAP.</p>
<p>The SSL protocol includes two sub-protocols:<br />
1) SSL record protocol<br />
2) SSL handshake protocol</p>
<p>The SSL record protocol defines the format used to transmit data. The SSL handshake protocol involves using the SSL record protocol to exchange a series of messages between an SSL-enabled server and an SSL-enabled client when they first establish an SSL connection.</p>
<p><strong>Now SSL for the layman<br />
<span style="font-weight: normal;">SSL basically creates an encrypted communication channel between the two parties involved in the communication. For a third person involved in the middle of this communication channel, the data seems to be garbled.<span id="more-962"></span></span></strong></p>
<p>Suppose Alice (A, the browser) wishes to communicate with Bob (B, the server) then the exact steps that takes place inorder to begin the encrypted communication are:</p>
<p>1) A -&gt; B	hello<br />
Alice contacts Bob and requests for a private communication (request for an https link at port 443)</p>
<p>2) B -&gt; A	Hi, I&#8217;m Bob, <em>bobs-certificate</em><br />
Bob send back to Alice his certificate. A certificate authenticates that it is Bob who is actually communicating with Alice. It is like a unique ID card displayed.</p>
<p>3) A -&gt; B	prove it<br />
Alice requests Bob to prove his identity.</p>
<p>4) B -&gt; A	Alice, This Is bob <em>{ digest[Alice, This Is Bob] } bobs-private-key</em><br />
Bob sends back a message and its digest encrypted with his private key. This step can also be like sending a document with a digital signature (when you have Alice&#8217;s public key).</p>
<p>5) A -&gt; B	ok bob, here is a secret <em>{secret} bobs-public-key</em><br />
Alice sends back to Bob some secret. Usually a session key encrypted using Bob&#8217;s public key obtained from his certificate</p>
<p>6) B -&gt; A	<em>{some message,MAC}secret-key</em><br />
Next Bob generates a secret key from Alice&#8217;s secret (earlier step) and sends back to Alice the real message and its MAC encrypted with this secret key. This is actually the encrypted website.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/07/ssl-handshake.gif" class="thickbox no_icon" rel="gallery-962" title="ssl handshake"><img class="size-full wp-image-976 aligncenter" title="ssl handshake" src="http://www.supportsages.com/blog/wp-content/uploads/2010/07/ssl-handshake.gif" alt="" width="614" height="525" /></a><strong><span style="text-decoration: underline;">Terminologies</span></strong></p>
<p><strong>Certificate<br />
<span style="font-weight: normal;">This is actually bobs public key containing document which is digitally signed by a certificate issuer&#8217;s private key (like Verisign). In this process Verisign gets all the necessary documents to verify that Bob&#8217;s identity is correct and it gets Bob&#8217;s public key (and some other data like certificate expiry period, Bobs identity) and encrypts it with its own private key. Now Verisign&#8217;s public key comes built-in along with every browser (so that the browser can get bobs public key from within it).</span></strong></p>
<p><strong>Digest<br />
<span style="font-weight: normal;">Digest or more appropriately Message Digest is like a summary of the actual message or a portion of the message. The digest of a message is is unique for every unique message, it is a one way function such that obtaining the digest, it is never possible to recover the original message (This does not involve using any key in the process). Message Digest always appears with the original message. Upon reception of this Message and its digest at the receiver&#8217;s end, the receiver can once again calculate the digest from the original message and verify the integrity of the message.</span></strong></p>
<p><strong>Digital signature<br />
<span style="font-weight: normal;"><strong><span style="font-weight: normal;">Let Bob send a document to Alice which is digitally signed. For this Bob must have Alice&#8217;s public key and Alice must have Bob&#8217;s public key.Bob takes the document, encrypts it first with Alice&#8217;s public key and next with its own private key(Bob&#8217;s)</span></strong></span></strong></p>
<p>B -&gt; A<span style="white-space: pre;"> </span><em>[{message}alices-public-key ]bobs-public-key</em></p>
<p><strong>Session Key</strong><br />
The only secret which is communicated using public key encryption is a session key. Now the session key is chosen from the &#8216;secret&#8217; that the parties accept. the session key could be the secret itself or a portion of the secret or the result when the secret is passed through a previously agreed algorithm. The SSL encrypted communication does&#8217;t necessary have to be created using a public key encryption technique (This uses a lot of overhead, i.e. processing and time), it may be simple symmetric cypher(less overhead) using this session key once agreed upon. There are a variety of cypher suites available (IDEA Blow-fish RSA DES MD5 KEA) and both the parties may choose some encryption technique based on the protocol used (SSL1.0 SSL2.0 TLS etc)</p>
<p><strong>MAC</strong><br />
MAC or Message Authentication Code is similar to the Message Digest we have discussed. It is used to verify the integrity of the Message.</p>
<p><em>MAC := Digest[ some message, secret ]</em></p>
<p><strong><span style="text-decoration: underline;">Files associated with SSL</span></strong></p>
<p><strong>CSR</strong><br />
CSR or Certificate Signing Request is a string of text generated by the server. This file is sent to the SSL vendor while purchasing an SSL. In the process of generating your CSR, you provide a number of details regarding the domain being registered. Excerpts of text from all these are taken to generate your private key. This private key is present only within the server and nowhere else. The content of the CSR basically contains the public key along with all the details you have used. You get this as domain.com.csr or domain_com.csr.</p>
<p><strong>CA bundle</strong><br />
CA (Certificate Authority) bundle file is one which contains the public key of the Certificate Issuer (Like Verisign&#8217;s public key). Usually this is not required while installing the SSL and most browsers will have this detail in advance to decrypt the SSL certificate (the CRT file) from the server. You get this as domain.com.cabundle or domain_com.ca-bundle.</p>
<p><strong>CRT</strong><br />
This is the actuall SSL certificate as obtained from the SSL vendor. It is a file (containing the public key of the domain secured with SSL and other details like the expiry date, owner information, address etc of the SSL) which is encrypted with the private key of the SSL vendor (Digitaly signed by the SSL vendor). You get this as domain.com.crt or domain_com.crt .</p>
<p><strong>Key file</strong><br />
This is the file which holds your private key (strictly confidential material). The file will have the RSA private key as generated by your server software. You get this as customcardsplus.com.key or customcardsplus_com.key. This file is not usually send to your SSL vendor unlike the CSR. You get this as domain.com.key or domain_com.key .</p>
<p><strong>SSL in a cPanel server</strong><br />
Any service can be secured in a communication channel which is encrypted with SSL. Each of this service on the encrypted channel will be on a different port. Some of them are as follows:</p>
<table style="height: 148px;" border="1" cellpadding="3" width="160">
<tbody>
<tr style="text-align: center;">
<td>
<h2><strong>service</strong></h2>
</td>
<td>
<h2><strong>normal</strong></h2>
</td>
<td>
<h2><strong>ssl</strong></h2>
</td>
</tr>
<tr>
<td>http</td>
<td>80</td>
<td>443</td>
</tr>
<tr>
<td>telnet</td>
<td>23</td>
<td>992</td>
</tr>
<tr>
<td>imap</td>
<td>143/220</td>
<td>993</td>
</tr>
<tr>
<td>pop</td>
<td>109/110</td>
<td>995</td>
</tr>
<tr style="text-align: left;">
<td>smtp</td>
<td>25</td>
<td>465</td>
</tr>
</tbody>
</table>
<p>A domain served as a secure webpage will require a dedicated IP (in a shared environment). SSL protocol is designed to use IP-based mapping. SSL does not support host headers. Therefore, you should have a unique IP address assigned to your secure site. These pages are served from the port 443. Let us examine the configuration of such a website in the apache&#8217;s config file /usr/local/apache/conf/httpd.conf.</p>
<p>Every website (in our example domain.com with username: doma) enabled with SSL has a unique set of directives in the VirtualHost section for the 443 port as:</p>
<pre class="brush: bash; title: ; notranslate">
&lt;VirtualHost 266.11.208.293:443\&gt; Dedicated IP of the domain

ServerName domain.com #Domain name secured with SSL
ServerAlias www.domain.com

DocumentRoot /home/doma/public_html

ServerAdmin webmaster@domain.com
UseCanonicalName off
CustomLog /usr/local/apache/domlogs/domain.com combined

CustomLog /usr/local/apache/domlogs/domain.com-bytes_log &quot;%{%s}t %I .\n%{%s}t %O .&quot;
ScriptAlias /cgi-bin/ /home/doma/public_html/cgi-bin/
SSLEngine on #This directive enables the SSL on this domain
SSLCertificateFile /etc/ssl/certs/www.domain.com.crt #Location of CRT file
SSLCertificateKeyFile /etc/ssl/private/www.doma.com.key #Location of Private key
SSLCACertificateFile /etc/ssl/certs/www.domain.com.cabundle #Location of CAbundle file
CustomLog /usr/local/apache/domlogs/domain.com-ssl_log combined #Log specific for the SSL served webpage
SetEnvIf User-Agent &quot;.*MSIE.*&quot; nokeepalive ssl-unclean-shutdown

&lt;Directory &quot;/home/doma/public_html/cgi-bin&quot;&gt;
SSLOptions +StdEnvVars #This directive will pass mod_ssl environment variables to the server scripts.
&lt;/Directory&gt;

&lt;/VirtualHost&gt;
</pre>
<p>Some times the directive SSLCertificateChainFile is used in place of SSLCACertificateFile. The minimal addition you will have to make to enable SSL in your httpd.conf file is:</p>
<pre class="brush: bash; title: ; notranslate">
&lt;VirtualHost 192.168.0.1:443&gt;
DocumentRoot /var/www/html
ServerName www.yourdomain.com
SSLEngine on
SSLCertificateFile /path/to/your_domain_name.crt
SSLCertificateKeyFile /path/to/your_private.key
SSLCertificateChainFile /path/to/DigiCertCA.crt
&lt;/VirtualHost&gt;
</pre>
<p>There are two locations where you are likely to find the SSL related files in your cPanel server. Usually the crt, key and the ca bundle are present in the home directory of the user in /home/username/ssl/, if it was installed using the client&#8217;s cpanel. However if the WHM was used instead to install the same, you will find it in /etc/ssl/. In either of these locations you will find two directories: certs/ and private/. certs contain the crt and cabundle while the private contains the keys.</p>
<p>Now you know how ssl works in your server, Any more questions? just comment!</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=All+about+SSL+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F962" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=All+about+SSL+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F962" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/07/all-about-ssl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

