<?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; VPS</title>
	<atom:link href="http://www.supportsages.com/blog/category/vps-virtualization/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>VPS Node Management + 24/7 Live Chat Support + Ticket Support = $249 per month/node!</title>
		<link>http://www.supportsages.com/blog/2010/10/vps-node-management-247-live-chat-support-ticket-support-249-per-monthnode/</link>
		<comments>http://www.supportsages.com/blog/2010/10/vps-node-management-247-live-chat-support-ticket-support-249-per-monthnode/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 12:33:51 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Offers]]></category>
		<category><![CDATA[Specials]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[openvz]]></category>
		<category><![CDATA[Proxmox]]></category>
		<category><![CDATA[virtuozzo]]></category>
		<category><![CDATA[Xen Server Management]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1463</guid>
		<description><![CDATA[<p style="text-align: center;"><strong>NOW offer MANAGED VPSes for as low as $249 per VPS node</strong></p>

<ul>
	<li>How many times your clients have asked you whether you are offering Managed VPSes ?</li>
	<li>How many times you wished you had QUALITY support team with you to offer 24/7 managed VPSes ?</li>
	<li>Do you realize your clients prefer to have the issues solved over LiveChat insted of opening a ticket ?</li>
	<li>Does your current support, provide with quality you wish to offer your clients ?</li>
</ul>
Through us, now you can!!! If you are someone who places quality of service over all, opt us. You will never regret the decision.

Maximum of ...]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><strong>NOW offer MANAGED VPSes for as low as $249 per VPS node</strong></p>
<ul>
<li>How many times your clients have asked you whether you are offering Managed VPSes ?</li>
<li>How many times you wished you had QUALITY support team with you to offer 24/7 managed VPSes ?</li>
<li>Do you realize your clients prefer to have the issues solved over LiveChat insted of opening a ticket ?</li>
<li>Does your current support, provide with quality you wish to offer your clients ?</li>
</ul>
<p>Through us, now you can!!! If you are someone who places quality of service over all, opt us. You will never regret the decision.</p>
<p>Maximum of 15 minutes response time and 6 hours resolution time &#8211; Best response times in the industry (delivered by a technical support firm). Average is far far below that &#8211; 5 mins response time and 45 mins resolution time.</p>
<p>Here is our VPS management offer details<br />
<span style="color: green;"> </span></p>
<ul>
<li>24/7 Live Chat for you, the server owner (at no extra charge)</li>
<li>24/7 transparent support for end user &#8211; We login to your helpdesk and do the tickets</li>
<li>24/7 Proactive VPS node Monitoring</li>
<li>15 minutes guaranteed response time &#8211; Often a ticket is responded or resolved in 5 minutes time.</li>
<li>6 hours guaranteed resolution time &#8211; Often an issue is resolved in less than one hour time.</li>
<li>Installation of 3rd Party Software/Scripts in the VPSes, as per your client requests</li>
<li>Level 1, 2 and 3 Support</li>
<li>We can provide Pre-Sales &amp; Sales support too at this rate</li>
<li>We monitor each VPSes inside the node as well (upto 20 VPSes and for 20+ VPSes monitoring is charged $3 per VPS)</li>
<li>Level I,II &amp; Sales Chat support for end user</li>
<li>Firewall Installation and hardening of VPSes</li>
<li>Reactive, regular updates for the VPSes</li>
<li>Free setup of billing scripts and such for your VPS clients</li>
</ul>
<p>Trust us! we really care for your clients. We take pride in the reviews they give for you here, while we remain anonymous to them.</p>
<p>With this plan, you just need to arrange for the backup space of the VPSes and start offering managed VPS very easily.</p>
<p><strong>Pricing</strong></p>
<p><span style="color: green;">One VPS node &#8211; $249 per month<br />
2 &#8211; 5 VPS nodes &#8211; $229 per month<br />
5 &#8211; 10 VPS nodes &#8211; $199 per month<br />
10 &#8211; 20 VPS nodes &#8211; $179 per month<br />
20+ VPS nodes &#8211; $149 per month<br />
</span><br />
For order links, please contact our sales or chat us via IM.</p>
<p>Here is a brief of our other offers</p>
<p><span style="color: blue;">24&#215;7 Shared support &#8211; $999 per month (Live chat included + Unlimited tickets)<br />
24&#215;7 Dedicated support &#8211; $2999 per month (Live chat included + Unlimited tickets)</span></p>
<p>Till this offer lasts, we also offer dedicated Level III admin for just $1299 per month, while a semi-dedicated level III admin can be hired for just $799 per month.</p>
<p>With our dedicated staff,</p>
<ul>
<li>You can chat in person as if he is your hired employee</li>
<li>5-10 mins response times</li>
<li>10 mins &#8211; 3 hours resolution of issues</li>
<li>Server monitoring</li>
<li>Live chat</li>
<li>Forum postings</li>
</ul>
<p>And any customized requirements you would want (y)our staff to do.</p>
<p>For placing an order, please chat with us online from any of the instant messenger or Live Chat service provided to you from our website at <a href="../../" target="_blank">http://www.supportsages.com</a> or email sales [a][t] supportsages.com .</p>
<p>NB : SS supports all virtualization technologies and multi-platforms also.</p>
<p><!-- / message --></p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=VPS+Node+Management+%2B+24%2F7+Live+Chat+Support+%2B+Ticket+Support+%3D+%24249+per+month%2Fnode%21+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1463" 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=VPS+Node+Management+%2B+24%2F7+Live+Chat+Support+%2B+Ticket+Support+%3D+%24249+per+month%2Fnode%21+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1463" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/10/vps-node-management-247-live-chat-support-ticket-support-249-per-monthnode/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>How to resolve : Internal Server Error when accessing cpanel/WHM/Webmail</title>
		<link>http://www.supportsages.com/blog/2010/06/how-to-resolve-internal-server-error-when-accessing-cpanelwhmwebmail/</link>
		<comments>http://www.supportsages.com/blog/2010/06/how-to-resolve-internal-server-error-when-accessing-cpanelwhmwebmail/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 19:13:12 +0000</pubDate>
		<dc:creator>vince</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Specials]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[inode issue]]></category>
		<category><![CDATA[inodes]]></category>
		<category><![CDATA[internal server error]]></category>
		<category><![CDATA[more than 400 attempts to make a session failed]]></category>
		<category><![CDATA[Webmail]]></category>
		<category><![CDATA[WHM]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=927</guid>
		<description><![CDATA[Imagine you are accessing your Website WHM or cPanel or Webmail hosted (in your VPS) and what if you see this

<a href="http://www.supportsages.com/blog/wp-content/uploads/2010/06/cpanel-inode-full-issue.png"><img class="alignnone size-medium wp-image-929" title="cpanel inode full issue" src="http://www.supportsages.com/blog/wp-content/uploads/2010/06/cpanel-inode-full-issue-300x63.png" alt="Image showing the issue" width="300" height="63" /></a><span style="text-decoration: underline;"><strong> </strong></span>

<span style="text-decoration: underline;"><strong>How to solve this</strong></span>

Pre-Requisites : You should have Shell access (as root) to the Node server.

Mostly this happens due to inode issue. The inodes allocated to the server maybe full. <strong>inode</strong> is a data structure on a traditional Unix-style file system such as UFS. An inode stores basic information about a regular file, directory, or other file system object.

<strong>Steps</strong>

Say ...]]></description>
			<content:encoded><![CDATA[<p>Imagine you are accessing your Website WHM or cPanel or Webmail hosted (in your VPS) and what if you see this</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/06/cpanel-inode-full-issue.png" class="thickbox no_icon" rel="gallery-927" title="cpanel inode full issue"><img class="alignnone size-medium wp-image-929" title="cpanel inode full issue" src="http://www.supportsages.com/blog/wp-content/uploads/2010/06/cpanel-inode-full-issue-300x63.png" alt="Image showing the issue" width="300" height="63" /></a><span style="text-decoration: underline;"><strong> </strong></span></p>
<p><span style="text-decoration: underline;"><strong>How to solve this</strong></span></p>
<p>Pre-Requisites : You should have Shell access (as root) to the Node server.</p>
<p>Mostly this happens due to inode issue. The inodes allocated to the server maybe full. <strong>inode</strong> is a data structure on a traditional Unix-style file system such as UFS. An inode stores basic information about a regular file, directory, or other file system object.</p>
<p><strong>Steps</strong></p>
<p>Say we are logged into the Node Server. There we are going to list all the Containers existing on the Hardware Node. By default, only running Containers are shown.</p>
<pre class="brush: bash; title: ; notranslate">
[root@linuxvps1 ~]# vzlist -a
CTID    NPROC STATUS   IP_ADDR        HOSTNAME
100     18  running    100.20.11.111  WEB.EXAMPLE.COM
101     63  running    100.20.12.203  -
102     169 running    100.20.92.182  server2.example.com
103     81  running    100.20.56.169  example.net
78965   236 running    100.20.77.204  server1.example.com
</pre>
<p>Assume your container is 103. So simply enter into 103 by this command</p>
<pre class="brush: bash; title: ; notranslate">
[root@linuxvps1 ~]# vzctl enter 103
</pre>
<p>Check if the inodes are full in the container</p>
<pre class="brush: bash; title: ; notranslate">
[root@linuxvps1 ~]# df -i
</pre>
<p>Most Probably it should display something like this :</p>
<pre class="brush: bash; title: ; notranslate">
Filesystem      Inodes      IUsed        IFree     IUse%      Mounted on
/dev/vzfs       200000      200000       0         100%       /
none            65536       95           65441     1%         /dev
</pre>
<p>Bang ! The inodes on /dev/vzfs mounted on / are full. You&#8217;ve to go nowhere else to see why that error was delivered. A simple solution will work out, you&#8217;ve to increase the inode limit. You&#8217;ve two options, either through Shell or through the Node Control Panel (like Parallels Infrastructure Manager)</p>
<p>First we will go through Shell mode with this command :</p>
<pre class="brush: bash; title: ; notranslate">$ vzctl set veid --diskinodes softlimit:hardlimit </pre>
<p>Where &#8216;veid&#8217; is the VPS ID</p>
<pre class="brush: bash; title: ; notranslate">root@linuxvps1 ~]# vzctl set 103 --diskinodes 7680100:7680200</pre>
<p>Second we are going for Node Control Panel. In the infrastructure, you will see your VPS with a ! sign. That indicates your VPS is having some sort of issue.</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/06/cp12.png" class="thickbox no_icon" rel="gallery-927" title="cp1"><img class="alignnone size-full wp-image-934" title="cp1" src="http://www.supportsages.com/blog/wp-content/uploads/2010/06/cp12.png" alt="" width="195" height="159" /></a></p>
<p>So you&#8217;ve seen the Alert. Next access the VPS, go to Resources tab. I&#8217;m sorry to tell you that I grabbed this screenshot after resolving the issue, but it will help you anyway</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/06/cp2.png" class="thickbox no_icon" rel="gallery-927" title="cp2"><img class="alignnone size-full wp-image-935" title="cp2" src="http://www.supportsages.com/blog/wp-content/uploads/2010/06/cp2.png" alt="" width="616" height="408" /></a></p>
<p>You should see the &#8216;Disk Inodes&#8217; is full under &#8216;Disk Usage&#8217; category (Here it is not !). Next Click Configure to settle this one</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2010/06/cp41.png" class="thickbox no_icon" rel="gallery-927" title="cp4"><img class="alignnone size-full wp-image-937" title="cp4" src="http://www.supportsages.com/blog/wp-content/uploads/2010/06/cp41.png" alt="" width="1192" height="394" /></a>See the Highlighted part, the inodes should be limited to some size. Increase it or remove the check mark to make it unlimited.  Make sure you save the changes. Now try again accessing cpanel/WHM/Webmail. It should load with out any issues.That makes a smile in your face, isn&#8217;t it ? <img src='http://www.supportsages.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=How+to+resolve+%3A+Internal+Server+Error+when+accessing+cpanel%2FWHM%2FWebmail+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F927" 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+resolve+%3A+Internal+Server+Error+when+accessing+cpanel%2FWHM%2FWebmail+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F927" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/06/how-to-resolve-internal-server-error-when-accessing-cpanelwhmwebmail/feed/</wfw:commentRss>
		<slash:comments>0</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>How to do : Add or Delete an IP Address in the VPS</title>
		<link>http://www.supportsages.com/blog/2010/05/how-to-do-add-or-delete-an-ip-address-in-the-vps/</link>
		<comments>http://www.supportsages.com/blog/2010/05/how-to-do-add-or-delete-an-ip-address-in-the-vps/#comments</comments>
		<pubDate>Wed, 26 May 2010 00:36:33 +0000</pubDate>
		<dc:creator>vince</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[add ip]]></category>
		<category><![CDATA[add ip to server]]></category>
		<category><![CDATA[assign ip]]></category>
		<category><![CDATA[delete ip]]></category>
		<category><![CDATA[delete ip from server]]></category>
		<category><![CDATA[open vz]]></category>
		<category><![CDATA[virtuozzo]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=813</guid>
		<description><![CDATA[Hello there,

Usually, we need to add or remove an IP address in the VPS. Here we go :

<strong>Prerequisites</strong>

You need Node Server access for these (then only you can manage those VPS), that too SSH root access. The VPS should be either OpenVZ or Virtuozzo.

<strong>Steps</strong>

Say we are logged into the Node Server. There we are going to list all the Containers existing on the Hardware Node. By default, only running Containers are shown.

[bash]

[root@linuxvps1 ~]# vzlist -a
CTID    NPROC STATUS   IP_ADDR        HOSTNAME
100     18  running    100.20.11.111  WEB.EXAMPLE.COM
101     63  running    100.20.12.203  -
102    ...]]></description>
			<content:encoded><![CDATA[<p>Hello there,</p>
<p>Usually, we need to add or remove an IP address in the VPS. Here we go :</p>
<p><strong>Prerequisites</strong></p>
<p>You need Node Server access for these (then only you can manage those VPS), that too SSH root access. The VPS should be either OpenVZ or Virtuozzo.</p>
<p><strong>Steps</strong></p>
<p>Say we are logged into the Node Server. There we are going to list all the Containers existing on the Hardware Node. By default, only running Containers are shown.</p>
<pre class="brush: bash; title: ; notranslate">

[root@linuxvps1 ~]# vzlist -a
CTID    NPROC STATUS   IP_ADDR        HOSTNAME
100     18  running    100.20.11.111  WEB.EXAMPLE.COM
101     63  running    100.20.12.203  -
102     169 running    100.20.92.182  server2.example.com
103     81  running    100.20.56.169  test.example.net
78965   236 running    100.20.77.204  server1.example.com
</pre>
<p>Lets consider the VPS with ID 78965 needs the new IP 100.20.80.200 to be added. So the command will be :</p>
<pre class="brush: bash; title: ; notranslate">

[root@linuxvps1 ~]# vzctl set 78965 --ipadd 100.20.80.200
Adding IP address(es): 100.20.80.200 WARNING: Settings were not saved. On next start the original values will be applied.
Use --save to save the settings in the configuration file.
</pre>
<p>Save the Settings (this command will do the purpose instead of the above one)</p>
<pre class="brush: bash; title: ; notranslate">

[root@linuxvps1 ~]# vzctl set 78965 --save --ipadd 100.20.80.200
Adding IP address(es): 100.20.80.200 Saved parameters for Container 78965.
</pre>
<p>Thats it, now login to WHM and access &#8216;Change Site&#8217;s IP Address&#8217;. Select the website and change the IP address from the drop down list.</p>
<p><strong>To remove an IP from the VPS</strong></p>
<pre class="brush: bash; title: ; notranslate">

[root@linuxvps1 ~]# vzctl set 78965 --save --ipdel 100.20.80.200
Deleting IP address(es): 100.20.80.200 Saved parameters for Container 78965.
</pre>
<p>Mission Accomplished !</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=How+to+do+%3A+Add+or+Delete+an+IP+Address+in+the+VPS+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F813" 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+do+%3A+Add+or+Delete+an+IP+Address+in+the+VPS+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F813" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/05/how-to-do-add-or-delete-an-ip-address-in-the-vps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenVPN issues on a OpenVZ / Virtuozzo enabled VPS</title>
		<link>http://www.supportsages.com/blog/2009/09/openvpn-issues-on-a-openvz-virtuozzo-enabled-vps/</link>
		<comments>http://www.supportsages.com/blog/2009/09/openvpn-issues-on-a-openvz-virtuozzo-enabled-vps/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 16:00:19 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[OpenVPN]]></category>
		<category><![CDATA[openvz]]></category>
		<category><![CDATA[Tun/TAP]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=560</guid>
		<description><![CDATA[<strong>Error</strong> Note: Cannot open TUN/TAP dev /dev/net/tun: Permission denied (errno=13)

Just follow the KB at http://wiki.openvz.org/VPN_via_the_TUN/TAP_device

<strong>Error</strong> <span>Note: Cannot set tx queue length on tun0: Operation not permitted (errno=1) </span>

<span>As mentioned in the same KB URL, just do the steps below and things should be alright again</span>
<blockquote>
<pre>vzctl set 101 --devices c:10:200:rw --save
vzctl set 101 --capability net_admin:on --save</pre>
</blockquote>

Basically the errors are caused by the non-execution of the two commands mentioned above.]]></description>
			<content:encoded><![CDATA[<p><strong>Error</strong> Note: Cannot open TUN/TAP dev /dev/net/tun: Permission denied (errno=13)</p>
<p>Just follow the KB at http://wiki.openvz.org/VPN_via_the_TUN/TAP_device</p>
<p><strong>Error</strong> <span>Note: Cannot set tx queue length on tun0: Operation not permitted (errno=1) </span></p>
<p><span>As mentioned in the same KB URL, just do the steps below and things should be alright again</span></p>
<blockquote>
<pre>vzctl set 101 --devices c:10:200:rw --save
vzctl set 101 --capability net_admin:on --save</pre>
</blockquote>
<p>Basically the errors are caused by the non-execution of the two commands mentioned above.</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=OpenVPN+issues+on+a+OpenVZ+%2F+Virtuozzo+enabled+VPS+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F560" 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=OpenVPN+issues+on+a+OpenVZ+%2F+Virtuozzo+enabled+VPS+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F560" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/09/openvpn-issues-on-a-openvz-virtuozzo-enabled-vps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CRITICAL : Serious kernel bug!!! Root privilege escalation</title>
		<link>http://www.supportsages.com/blog/2009/08/critical-serious-kernel-bug-root-privilege-escalation/</link>
		<comments>http://www.supportsages.com/blog/2009/08/critical-serious-kernel-bug-root-privilege-escalation/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 06:27:02 +0000</pubDate>
		<dc:creator>arnold</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[Kernel bug]]></category>
		<category><![CDATA[root privilege escalation.]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=548</guid>
		<description><![CDATA[Tavis Ormandy and Julien Tinnes of the Google  Security Team has unleashed a major kernel bug. A serious and critical security flaw has been found in both 2.4 and 2.6 kernel, enabling the attacked to gain the complete root access. I believe this is one major kernel bug in last few years. Distros release the Update... or we have to patch the kernel...

Believe me, this works :( Seriously works! See below from an exploit running all over the net.
<blockquote><strong>[sages@tech ~]$ chmod +x run.sh
[sages@tech ~]$ ./run.sh
padlina z lublina!
sh-3.2# whoami
root
sh-3.2#</strong></blockquote>

While a patched kernel should show the output as below

<blockquote><strong>[sages@tech ~]$ chmod ...]]></description>
			<content:encoded><![CDATA[<p>Tavis Ormandy and Julien Tinnes of the Google  Security Team has unleashed a major kernel bug. A serious and critical security flaw has been found in both 2.4 and 2.6 kernel, enabling the attacked to gain the complete root access. I believe this is one major kernel bug in last few years. Distros release the Update&#8230; or we have to patch the kernel&#8230;</p>
<p>Believe me, this works <img src='http://www.supportsages.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  Seriously works! See below from an exploit running all over the net.</p>
<blockquote><p><strong>[sages@tech ~]$ chmod +x run.sh<br />
[sages@tech ~]$ ./run.sh<br />
padlina z lublina!<br />
sh-3.2# whoami<br />
root<br />
sh-3.2#</strong></p></blockquote>
<p>While a patched kernel should show the output as below</p>
<blockquote><p><strong>[sages@tech ~]$ chmod +x run.sh<br />
[sages@tech ~]$ ./run.sh<br />
padlina z lublina!<br />
mprotect: Cannot allocate memory<br />
[sages@tech ~]$ </strong></p></blockquote>
<p>===============================================================</p>
<p>Linux NULL pointer dereference due to incorrect proto_ops initializations<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>In the Linux kernel, each socket has an associated struct of operations<br />
called proto_ops which contain pointers to functions implementing various<br />
features, such as accept, bind, shutdown, and so on.</p>
<p>If an operation on a particular socket is unimplemented, they are expected<br />
to point the associated function pointer to predefined stubs, for example if<br />
the &#8220;accept&#8221; operation is undefined it would point to sock_no_accept(). However,<br />
we have found that this is not always the case and some of these pointers are<br />
left uninitialized.</p>
<p>This is not always a security issue, as the kernel validates the pointers at<br />
the call site, such as this example from sock_splice_read:</p>
<p>static ssize_t sock_splice_read(struct file *file, loff_t *ppos,<br />
struct pipe_inode_info *pipe, size_t len,<br />
unsigned int flags)<br />
{<br />
struct socket *sock = file-&gt;private_data;</p>
<p>if (unlikely(!sock-&gt;ops-&gt;splice_read))<br />
return -EINVAL;</p>
<p>return sock-&gt;ops-&gt;splice_read(sock, ppos, pipe, len, flags);<br />
}</p>
<p>But we have found an example where this is not the case; the sock_sendpage()<br />
routine does not validate the function pointer is valid before dereferencing<br />
it, and therefore relies on the correct initialization of the proto_ops<br />
structure.</p>
<p>We have identified several examples where the initialization is incomplete:</p>
<p>- The SOCKOPS_WRAP macro defined in include/linux/net.h, which appears correct<br />
at first glance, was actually affected. This includes PF_APPLETALK, PF_IPX,<br />
PF_IRDA, PF_X25 and PF_AX25 families.</p>
<p>- Initializations were missing in other protocols, including PF_BLUETOOTH,<br />
PF_IUCV, PF_INET6 (with IPPROTO_SCTP), PF_PPPOX and PF_ISDN.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Affected Software<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>All Linux 2.4/2.6 versions since May 2001 are believed to be affected:</p>
<p>- Linux 2.4, from 2.4.4 up to and including 2.4.37.4<br />
- Linux 2.6, from 2.6.0 up to and including 2.6.30.4</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Consequences<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>This issue is easily exploitable for local privilege escalation. In order to<br />
exploit this, an attacker would create a mapping at address zero containing<br />
code to be executed with privileges of the kernel, and then trigger a<br />
vulnerable operation using a sequence like this:</p>
<p>/* &#8230; */<br />
int fdin = mkstemp(template);<br />
int fdout = socket(PF_PPPOX, SOCK_DGRAM, 0);</p>
<p>unlink(template);</p>
<p>ftruncate(fdin, PAGE_SIZE);</p>
<p>sendfile(fdout, fdin, NULL, PAGE_SIZE);<br />
/* &#8230; */</p>
<p>Please note, sendfile() is just one of many ways to cause a sendpage<br />
operation on a socket.</p>
<p>Successful exploitation will lead to complete attacker control of the system.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Mitigation<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Recent kernels with mmap_min_addr support may prevent exploitation if<br />
the sysctl vm.mmap_min_addr is set above zero. However, administrators<br />
should be aware that LSM based mandatory access control systems, such<br />
as SELinux, may alter this functionality.</p>
<p>It should also be noted that all kernels up to 2.6.30.2 are vulnerable to<br />
published attacks against mmap_min_addr.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Solution<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Linus committed a patch correcting this issue on 13th August 2009.</p>
<p>http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e694958388c50148389b0e9b9e9e8945cf0f1b98</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Credit<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>This bug was discovered by Tavis Ormandy and Julien Tinnes of the Google<br />
Security Team.</p>
<p>================================================================</p>
<p>Sad part is that there isn&#8217;t a patch from distro developers. And we have to manually compile the kernel. Oh guys.. release a patch soon or else my dear servers. Blog of Julien, http://blog.cr0.org/2009/06/bypassing-linux-null-pointer.html has more in depth details.</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=CRITICAL+%3A+Serious+kernel+bug%21%21%21+Root+privilege+escalation++http%3A%2F%2Fwww.supportsages.com%2Fblog%2F548" 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=CRITICAL+%3A+Serious+kernel+bug%21%21%21+Root+privilege+escalation++http%3A%2F%2Fwww.supportsages.com%2Fblog%2F548" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/08/critical-serious-kernel-bug-root-privilege-escalation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to enable IPtable modules on a VPS</title>
		<link>http://www.supportsages.com/blog/2009/08/how-to-enable-iptable-modules-on-a-vps/</link>
		<comments>http://www.supportsages.com/blog/2009/08/how-to-enable-iptable-modules-on-a-vps/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 05:19:26 +0000</pubDate>
		<dc:creator>Fabian</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[enable iptable modules for VPS]]></category>
		<category><![CDATA[VPS iptable modules]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=520</guid>
		<description><![CDATA[Before trying to enable iptable modules on the VPS, make sure that those modules are enabled on the root node server. To check whether the particular iptable modules are enabled or not on the root node, execute the following command.
<blockquote>lsmod</blockquote>
A Sample out put for the lsmod is :
<blockquote>Module                  Size  Used by
xt_helper              35584  0
ip_conntrack_ftp       42320  2
ipt_LOG                39808  0
ipt_owner              34944  0
ipt_REDIRECT           34944  0
ipt_recent             43404  2
xt_state               35200  5
sch_sfq                38912  1
cls_u32                41352  1
sch_cbq                50688  1
ppp_deflate            39168  0
zlib_deflate           52760  1 ppp_deflate
ppp_async              45184  0
ppp_generic            62624  2 ppp_deflate,ppp_async
slhc                   39552  1 ppp_generic
crc_ccitt              35200  1 ppp_async
tun                    47872  0
vzethdev               47264  0
simfs                  38296  36
vzrst                 173096  0
vzcpt                 148792  0
vzdquota               78832  36 [permanent]
xt_tcpudp              ...]]></description>
			<content:encoded><![CDATA[<p>Before trying to enable iptable modules on the VPS, make sure that those modules are enabled on the root node server. To check whether the particular iptable modules are enabled or not on the root node, execute the following command.</p>
<blockquote><p>lsmod</p></blockquote>
<p>A Sample out put for the lsmod is :</p>
<blockquote><p>Module                  Size  Used by<br />
xt_helper              35584  0<br />
ip_conntrack_ftp       42320  2<br />
ipt_LOG                39808  0<br />
ipt_owner              34944  0<br />
ipt_REDIRECT           34944  0<br />
ipt_recent             43404  2<br />
xt_state               35200  5<br />
sch_sfq                38912  1<br />
cls_u32                41352  1<br />
sch_cbq                50688  1<br />
ppp_deflate            39168  0<br />
zlib_deflate           52760  1 ppp_deflate<br />
ppp_async              45184  0<br />
ppp_generic            62624  2 ppp_deflate,ppp_async<br />
slhc                   39552  1 ppp_generic<br />
crc_ccitt              35200  1 ppp_async<br />
tun                    47872  0<br />
vzethdev               47264  0<br />
simfs                  38296  36<br />
vzrst                 173096  0<br />
vzcpt                 148792  0<br />
vzdquota               78832  36 [permanent]<br />
xt_tcpudp              36224  21<br />
xt_length              34944  0<br />
ipt_ttl                34816  0<br />
xt_tcpmss              35328  0<br />
ipt_TCPMSS             37248  0<br />
iptable_mangle         37888  36<br />
xt_multiport           36224  0<br />
xt_limit               36352  4<br />
ipt_tos                34560  0<br />
ipt_REJECT             39556  1<br />
iptable_nat            43532  46<br />
ip_nat                 53392  3 ipt_REDIRECT,vzrst,iptable_nat<br />
iptable_filter         37760  42<br />
ip_conntrack          100884  29 xt_helper,ip_conntrack_ftp,xt_state,vzrst,vzcpt,iptable_nat,ip_nat<br />
nfnetlink              40392  2 ip_nat,ip_conntrack<br />
ip_tables              57440  3 iptable_mangle,iptable_nat,iptable_filter<br />
x_tables               52744  17 xt_helper,ipt_LOG,ipt_owner,ipt_REDIRECT,ipt_recent,xt_state,xt_tcpudp,xt_length,ipt_ttl,xt_tcpmss,ipt_TCPMSS,xt_multiport,xt_limit,ipt_tos,ipt_REJECT,iptable_nat,ip_tables<br />
autofs4                57480  2<br />
hidp                   83584  2<br />
rfcomm                105000  0</p></blockquote>
<p>Here we can see most of the modules are already enabled on the node server. If not enabled, execute the following commands one by one to enable those.</p>
<blockquote><p>modprobe ipt_helper<br />
modprobe ipt_REDIRECT<br />
modprobe ipt_state<br />
modprobe ipt_TCPMSS<br />
modprobe ipt_LOG<br />
modprobe ipt_TOS<br />
modprobe iptable_nat<br />
modprobe ipt_length<br />
modprobe ipt_tcpmss<br />
modprobe iptable_mangle<br />
modprobe ipt_limit<br />
modprobe ipt_tos<br />
modprobe iptable_filter<br />
modprobe ipt_helper<br />
modprobe ipt_tos<br />
modprobe ipt_ttl<br />
modprobe ipt_REJECT<br />
modprobe ipt_helper<br />
modprobe ipt_owner</p></blockquote>
<p>Next step is to enable these modules on the VPS.</p>
<p>Stop the container first :  vzctl stop 960 ( replace 960 with the concerned VPS ID )</p>
<p>Execute the following command :</p>
<blockquote><p>vzctl set 960 &#8211;iptables ipt_REJECT &#8211;iptables ipt_tos &#8211;iptables ipt_TOS &#8211;iptables ipt_LOG &#8211;iptables ip_conntrack &#8211;iptables ipt_limit &#8211;iptables ipt_multiport &#8211;iptables iptable_filter &#8211;iptables iptable_mangle &#8211;iptables ipt_TCPMSS &#8211;iptables ipt_tcpmss &#8211;iptables ipt_ttl &#8211;iptables ipt_length &#8211;iptables ipt_state &#8211;iptables iptable_nat &#8211;iptables ip_nat_ftp &#8211;iptables ip_conntrack_ftp &#8211;iptables ip_conntrack_irc &#8211;iptables ip_nat_irc &#8211;iptables ipt_owner &#8211;iptables ipt_helper &#8211;save</p></blockquote>
<p>Start the container : vzctl start 960</p>
<p>check whether the modules are enabled from the configuration file cat /etc/vz/conf/960.conf. You are DONE.</p>
<p>Please note that if the command &#8220;vzctl set 960 &#8211;iptables ipt_ &#8230;.&#8221; is executed for the second time for the same VPS, it will over write the previous configuration.</p>
<p><strong>For enabling it on all VPSes, please add to /etc/sysconfig/vz all those modules like IPTABLES=&#8221;module1 module2 &#8230;.etc&#8221;</strong></p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=How+to+enable+IPtable+modules+on+a+VPS++http%3A%2F%2Fwww.supportsages.com%2Fblog%2F520" 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+enable+IPtable+modules+on+a+VPS++http%3A%2F%2Fwww.supportsages.com%2Fblog%2F520" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/08/how-to-enable-iptable-modules-on-a-vps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

