<?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>Fri, 16 Jul 2010 02:47:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<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[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[cPanel]]></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 &#8217;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;">
&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;">
&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>
<p align="left"><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/tt-twitter.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>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/07/all-about-ssl/feed/</wfw:commentRss>
		<slash:comments>0</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;">
[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;">
[root@linuxvps1 ~]# vzctl enter 103
</pre>
<p>Check if the inodes are full in the container</p>
<pre class="brush: bash;">
[root@linuxvps1 ~]# df -i
</pre>
<p>Most Probably it should display something like this :</p>
<pre class="brush: bash;">
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;">$ vzctl set veid --diskinodes softlimit:hardlimit </pre>
<p>Where &#8216;veid&#8217; is the VPS ID</p>
<pre class="brush: bash;">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>
<p align="left"><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/tt-twitter.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>]]></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;">
./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;">./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;">
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;">
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;">
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;">
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;">

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;">
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;">
make clean</pre>
<p>After this we repeat the make command and then issue:</p>
<pre class="brush: bash;">
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;">
#!/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;">
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;">
cd /usr/src/</pre>
<p>Download the PHP source tarball and extract it</p>
<pre class="brush: bash;">
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;">./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;">
./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;">
./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;">
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;">
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;">
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;">
&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;">
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;">
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>
<p align="left"><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/tt-twitter.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>]]></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;">

[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;">

[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;">

[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;">

[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>
<p align="left"><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/tt-twitter.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>]]></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>
<p align="left"><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/tt-twitter.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>]]></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>
<p align="left"><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/tt-twitter.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>]]></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>
<p align="left"><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/tt-twitter.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>]]></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>
		<item>
		<title>Kloxo restart fails giving entropy error</title>
		<link>http://www.supportsages.com/blog/2009/07/kloxo-restart-fails-giving-entropy-error/</link>
		<comments>http://www.supportsages.com/blog/2009/07/kloxo-restart-fails-giving-entropy-error/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 15:58:46 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=444</guid>
		<description><![CDATA[Kloxo, lighttpd as well as FTP restarting failed on a VPS after the installation of VNC there, 

<blockquote>Starting kloxo: 11
2009-07-17 08:35:38: (network.c.321) SSL: not enough entropy in the pool
mysqld (pid 29904) is running...</blockquote>

Solution was to create a urandom file. /proc/sys/kernel/random/entropy_avail was having the value of 3 or so, which I believe is too low. /proc/sys/kernel/random/poolsize now has 4096 . /dev/random will block if there is nothing left in the entropy bit bucket. /dev/urandom uses the same bucket - but will not block (it can reuse the pool of bits) and I believe lighttpd can use both random and urandom. Good ...]]></description>
			<content:encoded><![CDATA[<p>Kloxo, lighttpd as well as FTP restarting failed on a VPS after the installation of VNC there, </p>
<blockquote><p>Starting kloxo: 11<br />
2009-07-17 08:35:38: (network.c.321) SSL: not enough entropy in the pool<br />
mysqld (pid 29904) is running&#8230;</p></blockquote>
<p>Solution was to create a urandom file. /proc/sys/kernel/random/entropy_avail was having the value of 3 or so, which I believe is too low. /proc/sys/kernel/random/poolsize now has 4096 . /dev/random will block if there is nothing left in the entropy bit bucket. /dev/urandom uses the same bucket &#8211; but will not block (it can reuse the pool of bits) and I believe lighttpd can use both random and urandom. Good for us <img src='http://www.supportsages.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<strong><br />
mknod -m 644 /dev/urandom c 1 9</strong></p>
<p align="left"><a  class="tt" href="http://twitter.com/home/?status=Kloxo+restart+fails+giving+entropy+error+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F444" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=Kloxo+restart+fails+giving+entropy+error+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F444" title="Post to Twitter">Tweet This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/07/kloxo-restart-fails-giving-entropy-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pure-ftpd fails to start in a OpenVZ server</title>
		<link>http://www.supportsages.com/blog/2009/07/pure-ftpd-fails-to-start-in-a-openvz-server/</link>
		<comments>http://www.supportsages.com/blog/2009/07/pure-ftpd-fails-to-start-in-a-openvz-server/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 12:42:27 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[capability]]></category>
		<category><![CDATA[ispCP]]></category>
		<category><![CDATA[openvz]]></category>
		<category><![CDATA[pure-ftpd]]></category>
		<category><![CDATA[pureftpd]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=429</guid>
		<description><![CDATA[Issue : pure-ftpd was not starting in a ispCP enabled VPS server. It was showing failed status in both xinetd and standalone version. ispCP stores the information in MySQL database.

Troubleshooting :

Run the pure-ftpd script using the command itself, and without the sysV startup script.
<code>/usr/sbin/pure-ftpd --daemonize -A -c50 -B -C8 -D -E -fftp -H -I15 -lmysql:/etc/pure-ftpd/pureftpd-mysql.conf -L7500:8 -m4 -s -U133:022 -u500 -i -Oclf:/var/log/pureftpd.log -k99 -Z -4</code>

Again failure. Now turn for strace.
<code>yum install strace</code>

Error to be noted was below
<code>
capset(0x19980330, 0, {CAP_CHOWN&#124;CAP_DAC_READ_SEARCH&#124;CAP_SETGID&#124;CAP_SETUID&#124;CAP_NET_BIND_SERVICE&#124;CAP_NET_ADMIN&#124;CAP_SYS_CHROOT&#124;CAP_SYS_NICE, CAP_CHOWN&#124;CAP_DAC_READ_SEARCH&#124;CAP_SETGID&#124;CAP_SETUID&#124;CAP_NET_BIND_SERVICE&#124;CAP_NET_ADMIN&#124;CAP_SYS_CHROOT&#124;CAP_SYS_NICE, 0}) = -1 EPERM (Operation not permitted)</code>

followed by a log message in /var/log/messages as
<code>pure-ftpd: (?@?) [ERROR] Unable to switch capabilities ...]]></description>
			<content:encoded><![CDATA[<p>Issue : pure-ftpd was not starting in a ispCP enabled VPS server. It was showing failed status in both xinetd and standalone version. ispCP stores the information in MySQL database.</p>
<p>Troubleshooting :</p>
<p>Run the pure-ftpd script using the command itself, and without the sysV startup script.<br />
<code>/usr/sbin/pure-ftpd --daemonize -A -c50 -B -C8 -D -E -fftp -H -I15 -lmysql:/etc/pure-ftpd/pureftpd-mysql.conf -L7500:8 -m4 -s -U133:022 -u500 -i -Oclf:/var/log/pureftpd.log -k99 -Z -4</code></p>
<p>Again failure. Now turn for strace.<br />
<code>yum install strace</code></p>
<p>Error to be noted was below<br />
<code><br />
capset(0x19980330, 0, {CAP_CHOWN|CAP_DAC_READ_SEARCH|CAP_SETGID|CAP_SETUID|CAP_NET_BIND_SERVICE|CAP_NET_ADMIN|CAP_SYS_CHROOT|CAP_SYS_NICE, CAP_CHOWN|CAP_DAC_READ_SEARCH|CAP_SETGID|CAP_SETUID|CAP_NET_BIND_SERVICE|CAP_NET_ADMIN|CAP_SYS_CHROOT|CAP_SYS_NICE, 0}) = -1 EPERM (Operation not permitted)</code></p>
<p>followed by a log message in /var/log/messages as<br />
<code>pure-ftpd: (?@?) [ERROR] Unable to switch capabilities : Operation not permitted</code></p>
<p>Edit the VPS configuration file in the node to add lines below directly as below and then restart the vps from node or PIM or anything you use as the control panel.</p>
<blockquote><p>CAPABILITY=&#8221;CHOWN:on DAC_READ_SEARCH:on SETGID:on SETUID:on NET_BIND_SERVICE:on NET_ADMIN:on SYS_CHROOT:on SYS_NICE:on&#8221;</p></blockquote>
<p>A restart of VPS should fix the error</p>
<p align="left"><a  class="tt" href="http://twitter.com/home/?status=pure-ftpd+fails+to+start+in+a+OpenVZ+server+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F429" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=pure-ftpd+fails+to+start+in+a+OpenVZ+server+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F429" title="Post to Twitter">Tweet This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/07/pure-ftpd-fails-to-start-in-a-openvz-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>User stats in directadmin admin area &#8211; Solved with a good client&#8217;s help :)</title>
		<link>http://www.supportsages.com/blog/2009/06/user-stats-in-directadmin-admin-area-solved-with-a-good-clients-help/</link>
		<comments>http://www.supportsages.com/blog/2009/06/user-stats-in-directadmin-admin-area-solved-with-a-good-clients-help/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 20:58:46 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[DirectAdmin]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[bandwidth]]></category>
		<category><![CDATA[venet0]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=421</guid>
		<description><![CDATA[When one of our clients, Mr. Xavier opened an issue with us regarding the Usage stats not being shown, we were certain that this is a bug with DirectAdmin in the way how its license are read. We changed the ethernet_dev in directadmin.conf, but that didn't work out.

Client was asking us, 

<blockquote>In Admin Area --> Complete Usage Statistics --> Usage stats for venet0:0 is showing "None"

It's possible to fix this to reflect the traffic of this virtual adapter?</blockquote>

DirectAdmin didn't give a direct solution. Instead provided us with a complete packed files related to DirectAdmin. So the solution was this.

<code>cd /usr/local/directadmin
wget ...]]></description>
			<content:encoded><![CDATA[<p>When one of our clients, Mr. Xavier opened an issue with us regarding the Usage stats not being shown, we were certain that this is a bug with DirectAdmin in the way how its license are read. We changed the ethernet_dev in directadmin.conf, but that didn&#8217;t work out.</p>
<p>Client was asking us, </p>
<blockquote><p>In Admin Area &#8211;> Complete Usage Statistics &#8211;> Usage stats for venet0:0 is showing &#8220;None&#8221;</p>
<p>It&#8217;s possible to fix this to reflect the traffic of this virtual adapter?</p></blockquote>
<p>DirectAdmin didn&#8217;t give a direct solution. Instead provided us with a complete packed files related to DirectAdmin. So the solution was this.</p>
<p><code>cd /usr/local/directadmin<br />
wget -O new.tar.gz http://files.directadmin.com/7694310/packed_es50.tar.gz<br />
tar xvzf new.tar.gz<br />
./directadmin p<br />
killall -9 directadmin<br />
./directadmin d<br />
/etc/init.d/directadmin restart<br />
</code></p>
<p>For anyone facing this issue. I didn&#8217;t check more deeper into what changed, but must be related to htmls in data page on how device gets read.</p>
<p align="left"><a  class="tt" href="http://twitter.com/home/?status=User+stats+in+directadmin+admin+area+-+Solved+with+a+good+client%27s+help+%3A%29+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F421" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/tt-twitter.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=User+stats+in+directadmin+admin+area+-+Solved+with+a+good+client%27s+help+%3A%29+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F421" title="Post to Twitter">Tweet This Post</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/06/user-stats-in-directadmin-admin-area-solved-with-a-good-clients-help/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
