<?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; Snippets</title>
	<atom:link href="http://www.supportsages.com/blog/category/snippets/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>How to install 32 bit and 64 bit applications on 64 bit Ubuntu OS</title>
		<link>http://www.supportsages.com/blog/2011/05/how-to-install-32-bit-and-64-bit-applications-on-64-bit-ubuntu-os/</link>
		<comments>http://www.supportsages.com/blog/2011/05/how-to-install-32-bit-and-64-bit-applications-on-64-bit-ubuntu-os/#comments</comments>
		<pubDate>Thu, 26 May 2011 17:24:30 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[getlibs]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1853</guid>
		<description><![CDATA[Earlier, with Drapper Drake , you only had to install ia32libs. But after that, may be they decided not to release for future versions, no more release. Hackers always find a way round to get their thing done and that exactly what happened with this as well. A bash file was written and released to the public available at http://frozenfox.freehostia.com/cappy/

I recently had to use this frequently and thought about mentioning it. In last two days, I had two such requirements as well. Here in India, Tata Docomo's USB installation binary, will work only on i386 linux boxes. I would admit ...]]></description>
			<content:encoded><![CDATA[<p>Earlier, with Drapper Drake , you only had to install ia32libs. But after that, may be they decided not to release for future versions, no more release. Hackers always find a way round to get their thing done and that exactly what happened with this as well. A bash file was written and released to the public available at http://frozenfox.freehostia.com/cappy/</p>
<p>I recently had to use this frequently and thought about mentioning it. In last two days, I had two such requirements as well. Here in India, Tata Docomo&#8217;s USB installation binary, will work only on i386 linux boxes. I would admit that that itself is an achievement <img src='http://www.supportsages.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  But I had to get it working on a x64 architecture as well. And it was complaining about libqt and a few other 32 bit packages. dkpg&#8217;s &#8211;force-architecture option was also not working because of dependency issue.</p>
<p>This also helped me install a Task Management Software as well, http://codea-dev.com/gtd/download/linux/</p>
<p>Below text is copied from Ubuntu Forum&#8217;s. Author&#8217;s original post can be found at http://ubuntuforums.org/showthread.php?t=474790</p>
<p><span style="font-size: small;"><strong>getlibs works on:</strong></span></p>
<ul>
<li>All Ubuntu and Debian systems</li>
<li>Debian or Ubuntu based distributions (best to use the package name)</li>
</ul>
<p>Tip: To install a 32-bit debian package for a program (not a library!) use</p>
<div>
<div>Code:</div>
<pre dir="ltr">sudo dpkg -i --force-all package_name.deb</pre>
</div>
<p><span style="font-size: small;"><strong>Usage Examples:</strong></span></p>
<p>getlibs on a program to download all missing libraries:</p>
<div>
<div>Code:</div>
<pre dir="ltr">getlibs /usr/bin/skype</pre>
</div>
<p>&#8212;&#8211;</p>
<p>Use getlibs to install a 32-bit library using the library name:</p>
<div>
<div>Code:</div>
<pre dir="ltr">getlibs -l libogg.so.0 libSDL-1.2.so.0</pre>
</div>
<p>&#8212;&#8211;</p>
<p>Use getlibs to install a 32-bit library using the package name:</p>
<div>
<div>Code:</div>
<pre dir="ltr">getlibs -p libqt4-core libqt4-gui</pre>
</div>
<p>&#8212;&#8211;</p>
<p>Install a 32-bit library file (.deb):</p>
<div>
<div>Code:</div>
<pre dir="ltr">getlibs -i ~/i386_library_1.deb</pre>
</div>
<p>&#8212;&#8211;</p>
<p>Download and install a 32-bit library file (.deb):</p>
<div>
<div>Code:</div>
<pre dir="ltr">getlibs -w http://mirrors.kernel.org/ubuntu/pool/main/s/sdl-image1.2/libsdl-image1.2_1.2.5-3_i386.deb</pre>
</div>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=How+to+install+32+bit+and+64+bit+applications+on+64+bit+Ubuntu+OS+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1853" 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+install+32+bit+and+64+bit+applications+on+64+bit+Ubuntu+OS+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1853" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2011/05/how-to-install-32-bit-and-64-bit-applications-on-64-bit-ubuntu-os/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby Gems not getting updated</title>
		<link>http://www.supportsages.com/blog/2010/10/ruby-gems-not-getting-updated/</link>
		<comments>http://www.supportsages.com/blog/2010/10/ruby-gems-not-getting-updated/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 10:42:03 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[giving response code 302]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1425</guid>
		<description><![CDATA[On a cPanel server, I ran /scripts/installruby which updated the ruby version from 1.8.6 to 1.8.7

[bash]ruby -v
ruby 1.8.7 (2009-06-08 patchlevel 173) [i686-linux][/bash]

But when updating the gems and the gem itself, we were getting error as below,

<code>
gem update --system
Updating RubyGems...
ERROR:  While executing gem ... (Gem::RemoteSourceException)
    HTTP Response 302 fetching http://gems.rubyforge.org/yaml
</code>

Solution was to specify another source as below, which was the 302 redirection of http://gems.rubyforge.org/yaml . May be gem now handles the 302 redirection properly.

[bash]gem install rubygems-update --source http://production.s3.rubygems.org/ [/bash]

followed by the gem update itself.

[bash]sudo gem update --system --source http://production.s3.rubygems.org/[/bash]

To add the source permanently, use the command below ...]]></description>
			<content:encoded><![CDATA[<p>On a cPanel server, I ran /scripts/installruby which updated the ruby version from 1.8.6 to 1.8.7</p>
<pre class="brush: bash; title: ; notranslate">ruby -v
ruby 1.8.7 (2009-06-08 patchlevel 173) [i686-linux]</pre>
<p>But when updating the gems and the gem itself, we were getting error as below,</p>
<p><code><br />
gem update --system<br />
Updating RubyGems...<br />
ERROR:  While executing gem ... (Gem::RemoteSourceException)<br />
    HTTP Response 302 fetching http://gems.rubyforge.org/yaml<br />
</code></p>
<p>Solution was to specify another source as below, which was the 302 redirection of http://gems.rubyforge.org/yaml . May be gem now handles the 302 redirection properly.</p>
<pre class="brush: bash; title: ; notranslate">gem install rubygems-update --source http://production.s3.rubygems.org/ </pre>
<p>followed by the gem update itself.</p>
<pre class="brush: bash; title: ; notranslate">sudo gem update --system --source http://production.s3.rubygems.org/</pre>
<p>To add the source permanently, use the command below and for more help
<pre class="brush: plain; title: ; notranslate">gem help sources</pre>
<pre class="brush: bash; title: ; notranslate">gem sources -a http://production.s3.rubygems.org/</pre>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Ruby+Gems+not+getting+updated++http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1425" 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=Ruby+Gems+not+getting+updated++http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1425" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/10/ruby-gems-not-getting-updated/feed/</wfw:commentRss>
		<slash:comments>1</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>
		<item>
		<title>Source compilation of Apache</title>
		<link>http://www.supportsages.com/blog/2010/06/source-compilation-of-apache/</link>
		<comments>http://www.supportsages.com/blog/2010/06/source-compilation-of-apache/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 21:03:45 +0000</pubDate>
		<dc:creator>victor</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Training]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=871</guid>
		<description><![CDATA[<strong>﻿Basics of Compilation of Apache with PHP</strong>

Here we are going to install apache using the source only. The choice of Operating System here is Linux (distro: Centos). The procedure we follow here will lead to a simple apache installation for dynamic loading of php. PHP will be installed as a module to apache. With a little bit of patience and time, all the necessary modules can be installed with apache. I will be giving a brief idea about the installation of the other modules later.
The basics of installation from the source involves mainly three <em>simple</em> steps (assuming you are lucky):

[bash]
./configure
make
make ...]]></description>
			<content:encoded><![CDATA[<p><strong>﻿Basics of Compilation of Apache with PHP</strong></p>
<p>Here we are going to install apache using the source only. The choice of Operating System here is Linux (distro: Centos). The procedure we follow here will lead to a simple apache installation for dynamic loading of php. PHP will be installed as a module to apache. With a little bit of patience and time, all the necessary modules can be installed with apache. I will be giving a brief idea about the installation of the other modules later.<br />
The basics of installation from the source involves mainly three <em>simple</em> steps (assuming you are lucky):</p>
<pre class="brush: bash; title: ; notranslate">
./configure
make
make install</pre>
<p>./configure creates the MAKEFILE on the fly. We can provide the necessary options to configure. To list the available options in the configuring step use</p>
<pre class="brush: bash; title: ; notranslate">./configure --help</pre>
<p>&#8211;prefix=/path/&#8230; mentions where the executable and its files are installed. If not mentioned it takes the default values.<br />
&#8211;enable-[Feature] will enable the specified Feature in apache as it is being built. We are only interested in the DSO capability and hence we enable it with: &#8211;enable-so</p>
<p>As a convention we always keep the source code tar ball inside a directory in /usr/src/, thus source installation begins in this directory.</p>
<p><strong>Apache Compilation</strong></p>
<p>Download the required source tar ball of the apache you would like to compile. Here I am installing httpd-2.0.63 from http://httpd.apache.org/download.cgi#apache20. I save it in the /usr/src/ folder.</p>
<pre class="brush: bash; title: ; notranslate">
cd /usr/src/
wget http://www.bizdirusa.com/mirrors/apache/httpd/httpd-2.0.63.tar.gz</pre>
<p>This will result in the generation of the file httpd-2.0.63.tar.gz</p>
<pre class="brush: bash; title: ; notranslate">
tar -xzf httpd-2.0.63.tar.gz</pre>
<p>This will result in the creation of the directory httpd-2.0.63. Next enter inside this directory and execute the ./configure command.</p>
<pre class="brush: bash; title: ; notranslate">
cd httpd-2.0.63
./configure --prefix=/usr/local/webserver --enable-so</pre>
<p>We are installing apache inside /usr/local/webserver and enable DSO to run php as a module to apache. During this process we may get a lot of errors. We resolve these by manually installing the unresolved dependencies either by obtaining their rpms or by using yum. Normally the first dependency we will get to resolve are:</p>
<pre class="brush: bash; title: ; notranslate">
gcc
glibc
libxml and
their corresponding devel packages</pre>
<p>In the days where there were no package management tools like yum, pirut, apt-get etc. The old rpms served the installation of these packages with some effort. The task of determining the required rpm package for the required architecture and resolving the other dependencies which arise due to the installation of this rpm may be a tedious task. Some sites which helped in obtaining the necessary rpm suited for our installation and its other dependancies are:</p>
<pre class="brush: bash; title: ; notranslate">

http://rpm.pbone.net/

http://www.rpmfind.net/linux/RPM/

http://ftp.freshrpms.net/

http://dries.ulyssis.org/rpm/packages.html

http://apt.sw.be/

http://rpms.famillecollet.com/ (Remi RPM Repository)</pre>
<p>Once everything goes well (we do the ./configure step again to determine this), the make command is executed.</p>
<pre class="brush: bash; title: ; notranslate">
make</pre>
<p>If errors are encountered in this stage, We resolve them by installing the unresolved dependencies (Same as the previous step) and then do:</p>
<pre class="brush: bash; title: ; notranslate">
make clean</pre>
<p>After this we repeat the make command and then issue:</p>
<pre class="brush: bash; title: ; notranslate">
make install</pre>
<p>This process installs the package finally within the system. Modify the init script ( /etc/rc.d/init.d/httpd or /etc/init.d/httpd they are symbolic links) Or sometimes you may even have to create one from the apache site.</p>
<p>The following is the content of one such init script I have used. The line beginning with apachectl/some/path/here and httpd=/some/path/here have to replaced with the appropriate line we have used in the &#8211;prefix portion of ./configure.</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/bash
#
# Startup script for the Apache Web Server
#
# chkconfig: - 85 15
# description: Apache is a World Wide Web server.  It is used to serve \
#              HTML files and CGI.
# processname: httpd
# processname: httpd
# pidfile: /usr/local/apache2/logs/httpd.pid
# config: /usr/local/apache2/conf/httpd.conf
# Source function library.
. /etc/rc.d/init.d/functions
if [ -f /etc/sysconfig/httpd ]; then
. /etc/sysconfig/httpd
fi
# This will prevent initlog from swallowing up a pass-phrase prompt if
# mod_ssl needs a pass-phrase from the user.
INITLOG_ARGS=&quot;&quot;
# Path to the apachectl script, server binary, and short-form for messages.
apachectl=/usr/local/webserver/bin/apachectl
httpd=/usr/local/webserver/bin/httpd
pid=$httpd/logs/httpd.pid
prog=httpd
RETVAL=0
# The semantics of these two functions differ from the way apachectl does
# things -- attempting to start while running is a failure, and shutdown
# when not running is also a failure.  So we just do it the way init scripts
# are expected to behave here.
start() {
echo -n $&quot;Starting $prog: &quot;
daemon $httpd $OPTIONS
RETVAL=$?
echo
[ $RETVAL = 0 ] &amp;amp;&amp;amp; touch /var/lock/subsys/httpd
return $RETVAL
}
stop() {
echo -n $&quot;Stopping $prog: &quot;
killproc $httpd
RETVAL=$?
echo
[ $RETVAL = 0 ] &amp;amp;&amp;amp; rm -f /var/lock/subsys/httpd $pid
}
reload() {
echo -n $&quot;Reloading $prog: &quot;
killproc $httpd -HUP
RETVAL=$?
echo
}
# See how we were called.
case &quot;$1&quot; in
start)
start
;;
stop)
stop
;;
status)
status $httpd
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if [ -f $pid ] ; then
stop
start
fi
;;
reload)
reload
;;
graceful|help|configtest|fullstatus)
$apachectl $@
RETVAL=$?
;;
*)
echo $&quot;Usage: $prog {start|stop|restart|condrestart|reload|status&quot;
echo $&quot;|fullstatus|graceful|help|configtest}&quot;
exit 1
esac
exit $RETVAL</pre>
<p>Next we add the daemon name to the list of services and run it. For this follow the below steps.</p>
<pre class="brush: bash; title: ; notranslate">
chkconfig --add httpd
chkconfig --level 2345 httpd on
chkconfig --list httpd
/etc/init.d/httpd start
lynx http://localhost/ will display the default apache page which means success.</pre>
<p><strong>PHP Compilation</strong><br />
Now we are going to install PHP 5.2.13 from source!<br />
Go to /usr/src/</p>
<pre class="brush: bash; title: ; notranslate">
cd /usr/src/</pre>
<p>Download the PHP source tarball and extract it</p>
<pre class="brush: bash; title: ; notranslate">
wget http://in3.php.net/get/php-5.2.13.tar.gz/from/in.php.net/mirror
tar -xzf php*
cd php*</pre>
<p>Just like in the previous apache installation, we are going to do the ./configure step with the required setting which are displayed using</p>
<pre class="brush: bash; title: ; notranslate">./configure --help</pre>
<p>We are only interested in enabling php as a module (&#8211;with-apxs2) support for mysql (&#8211;with-mysql) and prefix line. So we go for:</p>
<pre class="brush: bash; title: ; notranslate">
./configure --with-apxs2=/usr/local/webserver/bin/apxs --with-mysql --prefix=/usr/local/webserver/php</pre>
<p>The long command can be written in a shorter, more clearer format with:</p>
<pre class="brush: bash; title: ; notranslate">
./configure --with-apxs2=/usr/local/webserver/bin/apxs \
--with-mysql \
--prefix=/usr/local/webserver/php</pre>
<p>The same instructions go for the errors here.<br />
Once everything goes smooth:</p>
<pre class="brush: bash; title: ; notranslate">
make
make install</pre>
<p>We can provide the recommeneded php.ini setting in the path /usr/local/webserver/php/lib (what ever is the &#8211;prefix + /lib) or just copy the recommended settings to /usr/local/webserver/php/lib (This file may have the name php.ini-recommended or php.ini-production)<br />
cp php.ini-recommended /usr/local/webserver/php/lib/php.ini</p>
<p>From now on we can have php&#8217;s index page to be the default index page. For this in the apache&#8217;s config file append index.php to the directive &#8211; DirectoryIndex</p>
<p>The line would thus look like:</p>
<pre class="brush: bash; title: ; notranslate">
DirectoryIndex index.html index.html.var index.php</pre>
<p>To make make apache call modular php to execute the php script when encountered, add the following lines to the conf file.</p>
<pre class="brush: bash; title: ; notranslate">
AddType application/x-httpd-php .php
DirectoryIndex index.html index.html.var index.php</pre>
<p>Next to test your installation.<br />
In the default document root, create a phpinfo file with the file name index.php an d the contents as:</p>
<pre class="brush: bash; title: ; notranslate">
&amp;lt;?
phpinfo();
?&amp;gt;</pre>
<p>Now we will test the apache configuration for any syntax errors and then reload the apache webserver:</p>
<pre class="brush: bash; title: ; notranslate">
apachectl configtest (No errors should be reported)
/etc/init.d/httpd reload</pre>
<p>Open a browser window and load the localhost as URL, we will be viewing the phpinfo page in here. In the phpinfo page, the portion Configure Command shows the actual compilation time options used while ./configure is used. The row corresponding to Server API mentions how the php is loaded. &#8216;Apache 2.0 Handler&#8217; means that php was loaded as a module of apache. The rest of the values can be globally changed by making the required changes in php.ini or locally in .htaccess (which is possible only because it is loaded as an apache module).</p>
<p><strong>Tips on installing PHP as a CGI</strong></p>
<p>Here we do not require installing apache with the &#8211;enable-so option. A normal installation will do. The installation of php will not require the option &#8211;with-apxs2. However we will have to mention the location of apache source directory with &#8211;with-apache=../apache_1.3.14</p>
<p>In the httpd.conf file you will require adding:</p>
<pre class="brush: bash; title: ; notranslate">
ScriptAlias /php/ [path where your php folder is located]
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .phtml
Action application/x-httpd-php /php/php5</pre>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Source+compilation+of+Apache+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F871" 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=Source+compilation+of+Apache+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F871" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/06/source-compilation-of-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adjusting the language settings in spamassassin</title>
		<link>http://www.supportsages.com/blog/2009/08/adjusting-the-language-settings-in-spamassassin/</link>
		<comments>http://www.supportsages.com/blog/2009/08/adjusting-the-language-settings-in-spamassassin/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 22:44:43 +0000</pubDate>
		<dc:creator>Jince</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[ok_languages]]></category>
		<category><![CDATA[spamassassin]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=514</guid>
		<description><![CDATA[To change the language settings of spamassassin edit the file <strong>user_prefs</strong> located at  <strong>/home/username/.spamassassin</strong> if it isn't located there you need to create one.

We need to edit or add values <strong>ok_languages</strong> with the extra languages you would like to have in the two letter code.
This option is used to specify which languages are considered OK for incoming mail.
<blockquote>ok_languages all (allow all languages)
ok_languages en (only allow English)
ok_languages en ja hi (allow English, Japanese, and Hindi)</blockquote>]]></description>
			<content:encoded><![CDATA[<p>To change the language settings of spamassassin edit the file <strong>user_prefs</strong> located at  <strong>/home/username/.spamassassin</strong> if it isn&#8217;t located there you need to create one.</p>
<p>We need to edit or add values <strong>ok_languages</strong> with the extra languages you would like to have in the two letter code.<br />
This option is used to specify which languages are considered OK for incoming mail.</p>
<blockquote><p>ok_languages all (allow all languages)<br />
ok_languages en (only allow English)<br />
ok_languages en ja hi (allow English, Japanese, and Hindi)</p></blockquote>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Adjusting+the+language+settings+in+spamassassin+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F514" 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=Adjusting+the+language+settings+in+spamassassin+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F514" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/08/adjusting-the-language-settings-in-spamassassin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Magento Installation SOAP error in loading WSDL</title>
		<link>http://www.supportsages.com/blog/2009/07/magento-installation-soap-error-in-loading-wsdl/</link>
		<comments>http://www.supportsages.com/blog/2009/07/magento-installation-soap-error-in-loading-wsdl/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 12:42:32 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=437</guid>
		<description><![CDATA[When you are trying to access the URL at http://www.example.com/api/soap/index/ , it gets redirected to http://www.example.com/index.php/api/soap/index/ you get the following error. But if you try to load the API directly, you get the WSDL as it should be in a XML format.

<code><span style="color: #007700;">&#60;</span><span style="color: #0000bb;">SOAP</span><span style="color: #007700;">-</span><span style="color: #0000bb;">ENV</span><span style="color: #007700;">:</span><span style="color: #0000bb;">Envelope xmlns</span><span style="color: #007700;">:</span><span style="color: #0000bb;">SOAP</span><span style="color: #007700;">-</span><span style="color: #0000bb;">ENV</span><span style="color: #007700;">=</span><span style="color: #dd0000;">"http://schemas.xmlsoap.org/soap/envelope/"</span><span style="color: #007700;">&#62;
&#60;</span><span style="color: #0000bb;">SOAP</span><span style="color: #007700;">-</span><span style="color: #0000bb;">ENV</span><span style="color: #007700;">:</span><span style="color: #0000bb;">Body</span><span style="color: #007700;">&#62;
&#60;</span><span style="color: #0000bb;">SOAP</span><span style="color: #007700;">-</span><span style="color: #0000bb;">ENV</span><span style="color: #007700;">:</span><span style="color: #0000bb;">Fault</span><span style="color: #007700;">&#62;
&#60;</span><span style="color: #0000bb;">faultcode</span><span style="color: #007700;">&#62;</span><span style="color: #0000bb;">WSDL</span><span style="color: #007700;">&#60;/</span><span ...]]></description>
			<content:encoded><![CDATA[<p>When you are trying to access the URL at http://www.example.com/api/soap/index/ , it gets redirected to http://www.example.com/index.php/api/soap/index/ you get the following error. But if you try to load the API directly, you get the WSDL as it should be in a XML format.</p>
<p><code><span style="color: #007700;">&lt;</span><span style="color: #0000bb;">SOAP</span><span style="color: #007700;">-</span><span style="color: #0000bb;">ENV</span><span style="color: #007700;">:</span><span style="color: #0000bb;">Envelope xmlns</span><span style="color: #007700;">:</span><span style="color: #0000bb;">SOAP</span><span style="color: #007700;">-</span><span style="color: #0000bb;">ENV</span><span style="color: #007700;">=</span><span style="color: #dd0000;">"http://schemas.xmlsoap.org/soap/envelope/"</span><span style="color: #007700;">&gt;<br />
&lt;</span><span style="color: #0000bb;">SOAP</span><span style="color: #007700;">-</span><span style="color: #0000bb;">ENV</span><span style="color: #007700;">:</span><span style="color: #0000bb;">Body</span><span style="color: #007700;">&gt;<br />
&lt;</span><span style="color: #0000bb;">SOAP</span><span style="color: #007700;">-</span><span style="color: #0000bb;">ENV</span><span style="color: #007700;">:</span><span style="color: #0000bb;">Fault</span><span style="color: #007700;">&gt;<br />
&lt;</span><span style="color: #0000bb;">faultcode</span><span style="color: #007700;">&gt;</span><span style="color: #0000bb;">WSDL</span><span style="color: #007700;">&lt;/</span><span style="color: #0000bb;">faultcode</span><span style="color: #007700;">&gt;<br />
&lt;</span><span style="color: #0000bb;">faultstring</span><span style="color: #007700;">&gt;</span><span style="color: #0000bb;">SOAP</span><span style="color: #007700;">-</span><span style="color: #0000bb;">ERROR</span><span style="color: #007700;">: </span><span style="color: #0000bb;">Parsing WSDL</span><span style="color: #007700;">: </span><span style="color: #0000bb;">Couldn</span><span style="color: #dd0000;">'t load from '</span><span style="color: #0000bb;">http</span><span style="color: #007700;">:</span><span style="color: #ff8000;">//www.example.com/api/soap/index/wsdl/1/'&lt;/faultstring&gt;<br />
</span><span style="color: #007700;">&lt;/</span><span style="color: #0000bb;">SOAP</span><span style="color: #007700;">-</span><span style="color: #0000bb;">ENV</span><span style="color: #007700;">:</span><span style="color: #0000bb;">Fault</span><span style="color: #007700;">&gt;<br />
&lt;/</span><span style="color: #0000bb;">SOAP</span><span style="color: #007700;">-</span><span style="color: #0000bb;">ENV</span><span style="color: #007700;">:</span><span style="color: #0000bb;">Body</span><span style="color: #007700;">&gt;<br />
&lt;/</span><span style="color: #0000bb;">SOAP</span><span style="color: #007700;">-</span><span style="color: #0000bb;">ENV</span><span style="color: #007700;">:</span><span style="color: #0000bb;">Envelope</span><span style="color: #007700;">&gt;</span></code></p>
<p>There could be many reasons for this. But the issue with us for that particular issue is that www.example.com was not resolving from the server. A simple /etc/hosts entry in the server (poor solution) or making it resolve from the server should solve the issue.</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Magento+Installation+SOAP+error+in+loading+WSDL++http%3A%2F%2Fwww.supportsages.com%2Fblog%2F437" 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=Magento+Installation+SOAP+error+in+loading+WSDL++http%3A%2F%2Fwww.supportsages.com%2Fblog%2F437" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/07/magento-installation-soap-error-in-loading-wsdl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>rar and unrar archives in linux</title>
		<link>http://www.supportsages.com/blog/2009/07/rar-and-unrar-archives-in-linux/</link>
		<comments>http://www.supportsages.com/blog/2009/07/rar-and-unrar-archives-in-linux/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 11:10:39 +0000</pubDate>
		<dc:creator>victor</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Snippets]]></category>
		<category><![CDATA[Training]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=431</guid>
		<description><![CDATA[<p style="text-align: left;">Rar archived files are very common these days and we have a solution for rar file extraction and compression in linux. To extract rar files we have the unrar application.</p>
<blockquote>
<p style="text-align: left;">To use unrar to extract use the following commands:
unrar e &#60;filename.rar&#62; use this to unpack the rar file in current directory
unrar l &#60;filename.rar&#62; use this to list the files inside the archive
unrar x &#60;filename.rar&#62; use this to extract the files with the full path
unrar t &#60;filename.rar&#62; use this to test the integrity of archive</blockquote>
<p style="text-align: left;">Now for those who wish to compress files into the rar archived ...]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">Rar archived files are very common these days and we have a solution for rar file extraction and compression in linux. To extract rar files we have the unrar application.</p>
<blockquote>
<p style="text-align: left;">To use unrar to extract use the following commands:<br />
unrar e &lt;filename.rar&gt; use this to unpack the rar file in current directory<br />
unrar l &lt;filename.rar&gt; use this to list the files inside the archive<br />
unrar x &lt;filename.rar&gt; use this to extract the files with the full path<br />
unrar t &lt;filename.rar&gt; use this to test the integrity of archive</p></blockquote>
<p style="text-align: left;">Now for those who wish to compress files into the rar archived format, we have the rar application and the following commands will come in handy:</p>
<blockquote><p>rar a &lt;desired filename.rar&gt; &lt;path of directory to archieve&gt; use this to create a normal compressed rar archieve<br />
rar a &lt;desired filename.rar&gt; &lt;path to file1&gt; &lt;path to file2&gt; &lt;path to file3&gt; &#8230; use this more multiple individual files to be archived into a sigle rar file.<br />
rar a -p&lt;password&gt; &lt;desired filename.rar&gt; &lt;path to dir or file&gt; use this to password protect the rar files<br />
rar a -m&lt;level of compression 1-least 5-best&gt; -v&lt;size of each rar file&gt; &lt;desired filename.rar&gt;&lt;path to dir or file&gt; use this to split the file to a number of rar archived files of desired size.</p></blockquote>
<p style="text-align: left;">Now to get all this and install the rar and unrar application, proceed with the following commands:</p>
<blockquote><p>wget http://www.rarlab.com/rar/rarlinux-3.6.0.tar.gz<br />
tar -zxvf rarlinux-3.6.0.tar.gz<br />
cd rar<br />
cp rar unrar /bin</p></blockquote>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=rar+and+unrar+archives+in+linux+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F431" 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=rar+and+unrar+archives+in+linux+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F431" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/07/rar-and-unrar-archives-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

