<?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; Linux</title>
	<atom:link href="http://www.supportsages.com/blog/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.supportsages.com/blog</link>
	<description>Technical Support and Server Management : Musings in the fox hole.</description>
	<lastBuildDate>Thu, 05 Jan 2012 03:05:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>cPanel Website Transfer &#8211; Part 1 &#8211; Changing an Add-on Domain to a Primary Domain</title>
		<link>http://www.supportsages.com/blog/2011/07/cpanel-website-transfer-part-1-changing-an-add-on-domain-to-a-primary-domain/</link>
		<comments>http://www.supportsages.com/blog/2011/07/cpanel-website-transfer-part-1-changing-an-add-on-domain-to-a-primary-domain/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 12:52:52 +0000</pubDate>
		<dc:creator>vince</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[magento]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[restore]]></category>
		<category><![CDATA[transfer]]></category>
		<category><![CDATA[website]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=728</guid>
		<description><![CDATA[For Beginners, Learn how to transfer and restore a website in a Linux cPanel envrioment]]></description>
			<content:encoded><![CDATA[<h3><span style="color: #ff0000;"><strong><em><strong><em>Converting an Add-on Domain to a Primary Domain</em></strong></em></strong></span></h3>
<p><strong>Skill Level : Beginner</strong></p>
<p>In this post, I will explain how to convert an add-on domain to a primary domain. Considering a complex case, lets consider the primary domain should be a different one from the one that holds the Add-on domain.</p>
<p><strong>Pre Requisites</strong></p>
<p>Server Platform : Linux</p>
<p>User requires     : cPanel and SSH access (root)</p>
<p>This is a Site transfer. Also both the sites I&#8217;ve mentioned here is on same server.</p>
<p><strong>Case</strong></p>
<p>The Add-on Domain under a website has to be converted as its Primary Domain. If you have a Full backup, its another case. I&#8217;ll explain it in another post.</p>
<p><strong>Solution</strong></p>
<p>Lets consider the Add-on Domain is addon.com under the user admin and the document root of the add-on domain is :</p>
<p>/home/admin/public_html/addon</p>
<p>Now it should be transferred as the Primary Domain</p>
<p>* Using WHM Create a New account primary.com, the document root is then say /home/primary<br />
We&#8217;ve to transfer the whole data from /home/admin/public_html/addon.com to /home/primary/public_html first.</p>
<p>* The Steps will be :</p>
<p>root@server [/home/admin/public_html/addon]# cp -r ./* /home/primary/public_html</p>
<p>This will recursively copy everything inside the PWD to the specified location<br />
<span id="more-728"></span></p>
<p>Don&#8217;t forget to copy .htaccess too</p>
<p>root@server [/home/admin/public_html/addon]# cp .htaccess /home/primary/public_html</p>
<p>* Thats it, the contents are moved, but there is a database too which has to be moved eventually.<br />
* I&#8217;ll site some type of websites like CMS and Blog :</p>
<p>For a Magento website, the database configuration is specified inside the local.xml file which is placed inside the /app/etc directory inside a domain. For example</p>
<p>root@server [/home/admin/public_html/addon]# cd /app/etc<br />
root@server [/home/admin/public_html/addon/app/etc]# cat local.xml</p>
<p>* Watch for these lines in the local.xml file</p>
<p>&lt;username&gt;&lt;![CDATA[admin_user]]&gt;&lt;/username&gt;<br />
&lt;password&gt;&lt;![CDATA[password]]&gt;&lt;/password&gt;<br />
&lt;dbname&gt;&lt;![CDATA[admin_db]]&gt;&lt;/dbname&gt;</p>
<p><![CDATA[admin_user]]&gt;</username></p>
<password><! [CDATA[password]]-->                     <!--[CDATA[admin_user]]&gt;</p>
<p>* From this the DB Name, DB Username and Password can be fetched.</p>
<p>DB Name            :    admin_db<br />
DB Username    :    admin_user<br />
Password       :    password</p>
<p><strong>Other DB Configuration Files</strong></p>
<p>For a WordPress website, the configuration file will be the wp-config.php. Check these lines for the Database configuration details :</p>
<p>// ** MySQL settings &#8211; You can get this info from your web host ** //<br />
/** The name of the database for WordPress */<br />
define(&#8216;DB_NAME&#8217;, &#8216;admin_db&#8217;);</p>
<p>/** MySQL database username */<br />
define(&#8216;DB_USER&#8217;, &#8216;admin_user&#8217;);</p>
<p>/** MySQL database password */<br />
define(&#8216;DB_PASSWORD&#8217;, &#8216;password&#8217;);</p>
<p>/** MySQL hostname */<br />
define(&#8216;DB_HOST&#8217;, &#8216;localhost&#8217;);</p>
<p>For a Joomla website it is the configuration.php where the database details would be defined.</p>
<p>* Access the cPanel of the new primary domain primary.com. Create a new MySQL Database from Databases -&gt; MySQL option, along with a new MySQL user. Make sure you are providing    exact names as in the local.xml file of the addon.com. Next add the user to the database. So the corresponding database credentials at primary.com will be :</p>
<p>DB Name           :    primary_db<br />
DB Username    :    primary_user<br />
Password                 :     password</p>
<p>Screen-shots of Creating a new database and database user :</p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/05/1.png" class="thickbox no_icon" rel="gallery-728" title="1"><img class="alignnone size-medium wp-image-1860" title="1" src="http://www.supportsages.com/blog/wp-content/uploads/2011/05/1-300x68.png" alt="" width="300" height="68" /></a></p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/05/2.png" class="thickbox no_icon" rel="gallery-728" title="2"><img class="alignnone size-medium wp-image-1861" title="2" src="http://www.supportsages.com/blog/wp-content/uploads/2011/05/2-300x79.png" alt="" width="300" height="79" /></a></p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/05/3.png" class="thickbox no_icon" rel="gallery-728" title="3"><img class="alignnone size-medium wp-image-1862" title="3" src="http://www.supportsages.com/blog/wp-content/uploads/2011/05/3-300x140.png" alt="" width="300" height="140" /></a></p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/05/5.png" class="thickbox no_icon" rel="gallery-728" title="5"><img class="alignnone size-full wp-image-1863" title="5" src="http://www.supportsages.com/blog/wp-content/uploads/2011/05/5.png" alt="" width="276" height="118" /></a></p>
<p><a  href="http://www.supportsages.com/blog/wp-content/uploads/2011/05/6.png" class="thickbox no_icon" rel="gallery-728" title="6"><img class="alignnone size-medium wp-image-1864" title="6" src="http://www.supportsages.com/blog/wp-content/uploads/2011/05/6-300x201.png" alt="" width="300" height="201" /></a></p>
<p><strong>Creating DB through Shell</strong></p>
<p>Access MySQL prompt :</p>
<p>$ mysql //Login as Root</p>
<p>mysql&gt; use mysql; //Use MySQL</p>
<p>﻿﻿﻿﻿﻿﻿mysql&gt; create database [﻿primary_db]; //Create a Database</p>
<p>mysql&gt; INSERT INTO primary_user (Host,User,Password) VALUES(&#8216;host&#8217;,'primary_user&#8217;,PASSWORD(&#8216;password&#8217;)); //Insert User</p>
<p>mysql&gt; grant all privileges on primary_db.sql to primary_user@localhost; //Granting all Privileges to user primary_user on the database</p>
<p>Perform Dump :</p>
<p>root@server [/home/primary]# mysqldump dbname &gt; dbname.sql   (Here mysqldump admin_db &gt; admin_db.sql)</p>
<p>* Enter the mysql terminal through the command mysql</p>
<p>mysql &gt; use newdatabasename;          (Here mysql &gt; use primary_db;)<br />
mysql &gt; source olddatabasename.sql;      (Here mysql &gt; source admin_db.sql;)</p>
<p>* For a normal website, you may backup the database by checking the config files and restore it. Use cPanel for that.</p>
<p>* Guess what, You&#8217;re done, the restoration is complete now. Now the primary.com should be working like addon.com.</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=cPanel+Website+Transfer+-+Part+1+-+Changing+an+Add-on+Domain+to+a+Primary+Domain+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F728" title="Post to Twitter"><img class="nothumb" src="http://www.supportsages.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter3.png" alt="Post to Twitter" /></a> <a  class="tt" href="http://twitter.com/home/?status=cPanel+Website+Transfer+-+Part+1+-+Changing+an+Add-on+Domain+to+a+Primary+Domain+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F728" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2011/07/cpanel-website-transfer-part-1-changing-an-add-on-domain-to-a-primary-domain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Performance Tuning (Part III/III) &#8211; Measuring Apache&#8217;s Performance</title>
		<link>http://www.supportsages.com/blog/2011/01/apache-performance-tuning-part-iiiiii-measuring-apaches-performance/</link>
		<comments>http://www.supportsages.com/blog/2011/01/apache-performance-tuning-part-iiiiii-measuring-apaches-performance/#comments</comments>
		<pubDate>Tue, 04 Jan 2011 10:08:04 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ab]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[bennchmarking]]></category>
		<category><![CDATA[httperf]]></category>
		<category><![CDATA[measuring]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1646</guid>
		<description><![CDATA[<!-- p { margin-bottom: 0.21cm; }a:link {  } --><span style="font-size: small;">I will introduce two benchmarking tools here: <strong>ab</strong> &#38; <strong>httperf</strong> with some other utilities. </span>

<span style="font-size: small;"><strong>1. ab </strong>is shipped with most linux distributions. It is used to simulate load test on to your webserver and check how it behaves during such situations. It is run from the command line and the command is ab followed by the required options and the name of a website served by the server that you need to test. There are two ways to which you can run the test. One is to ...]]></description>
			<content:encoded><![CDATA[<p><!-- p { margin-bottom: 0.21cm; }a:link {  } --><span style="font-size: small;">I will introduce two benchmarking tools here: <strong>ab</strong> &amp; <strong>httperf</strong> with some other utilities. </span></p>
<p><span style="font-size: small;"><strong>1. ab </strong>is shipped with most linux distributions. It is used to simulate load test on to your webserver and check how it behaves during such situations. It is run from the command line and the command is ab followed by the required options and the name of a website served by the server that you need to test. There are two ways to which you can run the test. One is to run the ab tool in the same machine where Apache is installed. The sencond is the practical way which is to run the tool to a remote webserver which helps in taking into account the network related accessibility issues. Lets see how to use it.</span></p>
<p><span style="font-size: x-small;"><span style="font-size: small;">The most common options of ab  are -n and -c. A test to <a  href="http://www.google.com/">www.google.com</a> would be as below:</span></span></p>
<p><span style="font-size: small;">root@sage3-desktop:~# ab -n 100 -c 10 http://www.google.com/ </span></p>
<p><span style="font-size: small;">This is ApacheBench, Version 2.3 &lt;$Revision: 655654 $&gt;</span></p>
<p><span style="font-size: small;">Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ </span></p>
<p><span style="font-size: small;">Licensed to The Apache Software Foundation, http://www.apache.org/ </span></p>
<p><span style="font-size: small;">Benchmarking www.google.com (be patient)&#8230;..done </span></p>
<p><span style="font-size: small;">Server Software:        gws </span></p>
<p><span style="font-size: small;">Server Hostname:        www.google.com </span></p>
<p><span style="font-size: small;">Server Port:            80 </span></p>
<p><span style="font-size: small;">Document Path:          / </span></p>
<p><span style="font-size: small;">Document Length:        221 bytes </span></p>
<p><span style="font-size: small;">Concurrency Level:      10 </span></p>
<p><span style="font-size: small;">Time taken for tests:   1.455 seconds </span></p>
<p><span style="font-size: small;">Complete requests:      100 </span></p>
<p><span style="font-size: small;">Failed requests:        0 </span></p>
<p><span style="font-size: small;">Write errors:           0 </span></p>
<p><span style="font-size: small;">Non-2xx responses:      100 </span></p>
<p><span style="font-size: small;">Total transferred:      83000 bytes </span></p>
<p><span style="font-size: small;">HTML transferred:       22100 bytes </span></p>
<p><span style="font-size: small;">Requests per second:    68.72 [#/sec] (mean) </span></p>
<p><span style="font-size: small;">Time per request:       145.509 [ms] (mean) </span></p>
<p><span style="font-size: small;">Time per request:       14.551 [ms] (mean, across all concurrent requests) </span></p>
<p><span style="font-size: small;">Transfer rate:          55.70 [Kbytes/sec] received </span></p>
<p><span style="font-size: small;">Connection Times (ms) </span></p>
<p><span style="font-size: small;">min  mean[+/-sd] median   max </span></p>
<p><span style="font-size: small;">Connect:       45   49   3.2     48      62 </span></p>
<p><span style="font-size: small;">Processing:    89   94   3.3     94     108 </span></p>
<p><span style="font-size: small;">Waiting:       89   94   3.3     93     107 </span></p>
<p><span style="font-size: small;">Total:        136  143   5.5    142     170 </span></p>
<p><span style="font-size: small;">Percentage of the requests served within a certain time (ms) </span></p>
<p><span style="font-size: small;">50%    142 </span></p>
<p><span style="font-size: small;">66%    144 </span></p>
<p><span style="font-size: small;">75%    144 </span></p>
<p><span style="font-size: small;">80%    145 </span></p>
<p><span style="font-size: small;">90%    148 </span></p>
<p><span style="font-size: small;">95%    155 </span></p>
<p><span style="font-size: small;">98%    166 </span></p>
<p><span style="font-size: small;">99%    170 </span></p>
<p><span style="font-size: small;">100%    170 (longest request) </span></p>
<p><span style="font-size: small;">-n : Number of requests to perform for the benchmarking session. The default is to just perform a single request which   usually  leads to non-representative benchmarking results.</span></p>
<p><span style="font-size: small;">-c : Number of multiple requests to perform at a time. Default is one request at a time.</span></p>
<p><span style="font-size: small;">Let me explain the options. -n denotes the total number of requests to send to the webserver in the ab session. By specifying -c 10 we ensure that at any instant of the ab session we keep the webserver busy with 10 requests until the total limit of 100 requests is reached.  The requests may be sent through a single connection if the server permits KeepAlive and browser supports persistent connections. The main points in performace to note for are: Failed requests, Connection Times &amp; Transfer rate. </span></p>
<p><span style="font-size: small;"> </span></p>
<p><span style="font-size: small;"><strong>2.  httperf</strong> Usage :</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --> <!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;"><span style="font-size: small;">httperf </span>&#8211;hog &#8211;server www.google.com &#8211;num-conn 50 &#8211;rate 10 &#8211;timeout 5</span></p>
<p><span style="font-size: small;">-hog : Use as many TCP ports as necessary to generate stats</span></p>
<p><span style="font-size: small;">&#8211;server: the host. IP or hostname can be specified</span></p>
<p><span style="font-size: small;">&#8211;num-conn : number of connections to create for the session</span></p>
<p><span style="font-size: small;">&#8211;rate : create connections at the rate of 10 per second</span></p>
<p><span style="font-size: small;">More simple and direct usage examples can be found at the man page for httperf. </span></p>
<p><span style="font-size: small;"><strong>3. </strong>Apart from command line tools, there are online websites for analysing webserver performance: </span></p>
<p><span style="font-size: x-small;"><strong><span style="font-size: small;"><a  href="http://www.webpagetest.org/">http://www.webpagetest.org/</a> </span></strong></span></p>
<p><span style="font-size: x-small;"><span style="font-size: small;"><strong><a  href="http://linuxbox.co.uk/website_performance_test.php">http://linuxbox.co.uk/website_performance_test.php</a> </strong></span></span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;"><strong>4. Page Speed</strong> by Google is an open-source project started at Google to help developers optimize their web pages by applying web performance best practices. Page Speed started as an open-source Firefox/Firebug add-on  and is now deployed in third-party products such as Webpagetest.org, Show Slow and Google Webmaster Tools. Please see:</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: x-small;"><code><span style="font-family: Nimbus Roman No9 L,serif;"><span style="font-size: small;"><strong>http://code.google.com/speed/page-speed/</strong></span></span></code></span></p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Apache+Performance+Tuning+%28Part+III%2FIII%29+-+Measuring+Apache%27s+Performance+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1646" 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=Apache+Performance+Tuning+%28Part+III%2FIII%29+-+Measuring+Apache%27s+Performance+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1646" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2011/01/apache-performance-tuning-part-iiiiii-measuring-apaches-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Performance Tuning (Part II/III) &#8211; Editing Apache for Performance</title>
		<link>http://www.supportsages.com/blog/2011/01/apache-performance-tuning-part-iiiii-editing-apache-for-performance/</link>
		<comments>http://www.supportsages.com/blog/2011/01/apache-performance-tuning-part-iiiii-editing-apache-for-performance/#comments</comments>
		<pubDate>Tue, 04 Jan 2011 10:00:53 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[apache performance]]></category>
		<category><![CDATA[tuning]]></category>
		<category><![CDATA[tuning apache]]></category>
		<category><![CDATA[tweaking]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1642</guid>
		<description><![CDATA[<!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">2. Editing Apache for Performance</span>

From hereon I will be writing for Linux platform configuration of Apache unless stated otherwise. Once the Hardware, OS selection and optimization are done, we have to implement Apache. Editing apache for performance can be 2 levels: Before Installation &#38; After Installation

<strong>2.1 Before Installation (Compile Time Tuning)</strong>

2.1.(a) Choosing the appropriate MPM

MPM stands for Multi Processing Module. It is just one of the modules of apache. Its features being:

- It modifies the basic functionality of the apache server related to multi-thread &#38; multi-processes style of working.
- It must be ...]]></description>
			<content:encoded><![CDATA[<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">2. Editing Apache for Performance</span></p>
<p>From hereon I will be writing for Linux platform configuration of Apache unless stated otherwise. Once the Hardware, OS selection and optimization are done, we have to implement Apache. Editing apache for performance can be 2 levels: Before Installation &amp; After Installation</p>
<p><strong>2.1 Before Installation (Compile Time Tuning)</strong></p>
<p>2.1.(a) Choosing the appropriate MPM</p>
<p>MPM stands for Multi Processing Module. It is just one of the modules of apache. Its features being:</p>
<p>- It modifies the basic functionality of the apache server related to multi-thread &amp; multi-processes style of working.<br />
- It must be built into apache at compilation like http_core and mod_so modules.<br />
- Only one MPM can be loaded into the server at any time.</p>
<p><!-- p { margin-bottom: 0.21cm; }h5 { margin-bottom: 0.21cm; }h5.western { font-family: "Liberation Serif",serif; }h5.cjk { font-family: "DejaVu LGC Sans"; }h5.ctl { font-family: "DejaVu LGC Sans"; } --><span style="font-size: small;"><strong>( Note: </strong>If you need to know more on differeences between Processes &amp; Threads, you may want to refer books on &#8216;Operating System Concepts&#8217; which has in-depth treatment of each.)</span></p>
<p><span style="font-size: small;">Its simple to understand. The MPM type you choose for apache is responsible for binding to network ports on the machine, accepting requests, handling requests etc. Choosing an MPM depends on various factors, such as whether the OS supports threads, how much memory is available, scalability versus stability, whether non-thread-safe third-party modules are used, etc. Linux systems can choose to use a hybridMPM (which means that it is multi-processed and multi-threaded implementation) like &#8216;worker&#8217; or a non-threaded MPM (only multi-process functionality)like &#8216;prefork&#8217;. Windows has only one choice which is &#8216;winnt&#8217; MPM (only multi-process functionality). Let me discuss some of the key features of these:</span></p>
<h5><span style="font-size: small;">prefork:</span></h5>
<ul>
<li><span style="font-size: small;">Apache 	1.3-based. </span></li>
<li><span style="font-size: small;">Multiple 	processes, 1 thread per process, processes handle requests. </span></li>
<li><span style="font-size: small;">Used 	for security and stability. </span></li>
<li><span style="font-size: small;">Has higher memory 	consumption and lower performance over the newer Apache 2.0-based 	threaded MPMs. </span></li>
</ul>
<h5><span style="font-size: small;">worker (Hybrid MPM):</span></h5>
<ul>
<li><span style="font-size: small;">Apache 	2.0-based. </span></li>
<li><span style="font-size: small;">Multiple 	processes, many threads per process, threads in a child handle 	requests. </span></li>
<li><span style="font-size: small;">Used 	for lower memory consumption and higher performance. </span></li>
<li><span style="font-size: small;">Does not provide the 	same level of isolation request-to-request, as a process-based MPM 	does. </span></li>
</ul>
<p><!-- p { margin-bottom: 0.21cm; }h5 { margin-bottom: 0.21cm; }h5.western { font-family: "Liberation Serif",serif; }h5.cjk { font-family: "DejaVu LGC Sans"; }h5.ctl { font-family: "DejaVu LGC Sans"; } --></p>
<h5><span style="font-size: small;">winnt:</span></h5>
<ul>
<li><span style="font-size: small;">The 	only MPM choice under Windows. </span></li>
<li><span style="font-size: small;">1 	parent process, exactly 1 child process with many threads, threads 	handle requests. </span></li>
<li><span style="font-size: small;">Best 	solution under Windows, as on this platform, threads are always 	&#8220;cheaper&#8221; to use over processes. </span></li>
</ul>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">Once the required module is loaded, we tweak them by the apache &#8216;Directives&#8217; that are dedicated for configuring MPMs like MaxClients, StartServers, MaxRequestsPerChild etc in the httpd.conf file. </span></p>
<p><span style="font-size: small;">2.1.(ii) Loading only the required modules</span></p>
<p><span style="font-size: small;">Before installation, only compile in the modules that are provide the basic functions of a web server. This is because as more modules are compiled in statically, the size of the running httpd binary will increase(neglecting the dynamic modules. Once dynamic modules are also loaded, the size will increase again). Normally, the statically  compiled modules are http_core, mod_so &amp; the required MPM module. </span></p>
<p><span style="font-size: small;">If you have built the modules as DSOs, eliminating modules is a simple matter of commenting out the associated LoadModule directive for that module.<span style="font-family: Nimbus Roman No9 L,serif;">If, on the other hand, you have modules statically linked into your Apache binary, you will need to recompile Apache in order to remove unwanted modules.</span></span></p>
<p><span style="font-size: x-small;"><span style="font-size: small;">2.1.(iii) </span><code><span style="font-family: Nimbus Roman No9 L,serif;"><span style="font-size: small;">DYNAMIC_MODULE_LIMIT</span></span></code></span></p>
<p><span style="font-size: x-small;"><span style="font-size: small;">This is one of the compile time flags you give in for apache. If you have no thoughts for DSO support for apache, then you will need to compile apache with </span><code><span style="font-family: Nimbus Roman No9 L,serif;"><span style="font-size: small;">DYNAMIC_MODULE_LIMIT=0. This will save the amount of RAM that is only dedicated for loading dynamically loading modules. The default value is 64 which will be usually sufficient.</span></span></code></span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;"><strong>2.2 After Installation (Once the server is installed and ready to run or running)</strong></span></p>
<p><span style="font-size: small;">This is where the bulk of apache tuning comes in. But first I will need to give you some intro about the 2 most common MPMs that are used with Apache in Linux environment. </span></p>
<p><span style="font-size: small;">The &#8216;prefork&#8217; MPM:</span></p>
<p><span style="font-size: small;">It was the only mode of operation available in Apache 1.3. In this configuration, the main Apache process also known as the &#8216;master server&#8217;(the apache process started by &#8216;root&#8217; user with full privileges) will at startup create (fork() ) multiple child servers(running under user with less privileges w.r.t those mentioned in User &amp; Group directive in the apache conf file). In the pool of child servers, these child servers can be considered to stand in a queue. The child at the front of the queue or standing 1<sup>st</sup> is known as the &#8216;Listener&#8217; and all the rest, counted from the 2<sup>nd</sup> child onwards are known as the &#8216;Idle Worker&#8217;. Only the listener child is allowed to listen for connection from sockets. When a request is received, this child makes a transition in its state from &#8216;Listener&#8217; to &#8216;Worker&#8217;. This particular child then goes on to process </span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">the received request. In the meantime  the child which was standing 2<sup>nd </sup>gets the &#8216;Listener&#8217; status. When the 1<sup>st</sup> child, which became the &#8216;worker&#8217;, is done processing the request, it will change its state back to &#8216;Idle Worker&#8217; and will then stand at the end of the same queue in which it was standing 1<sup>st</sup> previously. This cycle repeats as each request arrives. Each child server will only handle one request at a time. When it is detected that the number of available processes is running out, additional child servers will be created by the master server. But there is a limit for the maximum number of child servers and this is given in the conf file for apache. When the limit was reached and still sufficient requests arriving, the client may instead receive an error resulting from not being able to establish a connection with the web server. When the number of requests has subsequently dropped off, the excess child servers will be shutdown and killed. Child processes may also be shutdown and killed off after they have handled some set number of requests which depends upon the directives set in the conf file which I will discuss in the succeeding sections. </span></p>
<p><span style="font-size: small;">So the actual worker here is the child server and not the master server! The method imparts a lot of stability because each request is handled by a separate &#8216;process&#8217;. If a process dies/or is killed it will not affect other processes. Each process is an independent entity to which resources are allocated.</span></p>
<p><span style="font-size: small;">The &#8216;worker&#8217; MPM:</span></p>
<p><span style="font-size: small;">The &#8216;worker&#8217; MPM implemented from version 2.0,  is similar to &#8216;prefork&#8217; mode except that within each child process there will exist a number of worker threads according to ThreadsPerChild directive. A request will be handled by a &#8216;thread&#8217; within a child process rather than each request being handled by a separate child process in case of prefork MPM. If some of the threads in a process are already handling  requests, when a new request arrives, this is handed over to the thread which is ready and idle in the same process. If all worker threads within a child process were busy when a new request arrives the request would be processed by an idle worker thread in another child process. If all the threads in all the running child processses are engaged, Apache &#8216;master server&#8217; (server run with root privileges) may still create new child processes on demand if necessary. Apache master server may also still shutdown and kill off excess child processes, or child processes that have handled more than a set number of requests. </span></p>
<p><span style="font-size: small;">Overall, use of &#8216;worker&#8217; MPM will result in less child processes needing to be created, but resource usage of individual child processes will be greater. But where is the advantage then? It is in avoiding the delay and overhead incurred on creating a new child process for every request.</span></p>
<p><!-- p { margin-bottom: 0.21cm; }a:link {  } --><span style="font-size: x-small;"><span style="font-size: small;">Now lets discuss the Directives which are also known as apache&#8217;s Performance directives. Much of these I discuss can be found at: <a  href="http://httpd.apache.org/docs/2.0/misc/perf-tuning.html">http://httpd.apache.org/docs/2.0/misc/perf-tuning.html</a>. But may not be much comprehensive to a novice. So I shall try my best to break it down.</span></span></p>
<p><span style="font-size: small;">2.2(a) ThreadsPerChild</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">This implies if apache is compiled to use &#8216;worker&#8217; MPM and mpm_winnt (windows) only. It denotes the number of threads that will be created in an individual child process at startup. This value multiplied by the &#8216;number of child&#8217; will give us the total number of threads in the server. Once a child has started, it will never change ThreadsPerChild value. The conf file needs to be edited and the apache master server must be restarted for the changes to take effect. Once this is done childs created from thereon will have the new value but the already existing child will have  old value. The default value in for worker is 25 and 64 for mpm_winnt. </span></p>
<p><span style="font-size: small;">2.2(b) ThreadLimit</span></p>
<p><span style="font-size: small;">However, there is a limit to which the ThreadsPerChild value can be increased. This limit is the ThreadLimit. While setting this directive:</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">(i) If ThreadLimit is set to a value much higher than ThreadsPerChild, extra unused shared memory will be allocated.</span></p>
<p><span style="font-size: small;">(ii) If both ThreadLimit and ThreadsPerChild are set to values higher than the system can handle, Apache may not start or the system may become unstable.</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">So how to set value of this directive?</span></p>
<p><span style="font-size: small;">Set the value of this directive equal to the greatest value of ThreadsPerChild that might be required for Apache during the most peak time. Consequently when apache is shipped, if 25 is the ThreadsPerChild value, ThreadLimit is defaluted to 64. However all this, will again depend upon how busy your apache will be and the hardware resources you have alloted for apache.</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">2.2(c) MaxClients</span></p>
<p><span style="font-size: small;">The MaxClients indicates the limit on the maximum number of simultaneous requests that will be served. For preforking apache each request is handled by each child. Therefore MaxClients in this case can be interpreted as the maximum number of apache childs that will be launched in its single lifetime. The default value is 256 servers(in effect, in case of prefork, 256 simultaneous requests). Any connection attempts over this value will be queued according to ListenBackLog (default is in the range of 500). </span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">For worker, since each requests are handled by single threads, the MaxClients= ServerLimit x ThreadLimit = the maximum number of apache threads that can be possibly launched during the an apache lifetime. ServerLimit in short means the maximum number of apache servers(child process or child server) that can be launched in apache&#8217;s lifetime be it prefork or worker implementation. So for:</span></p>
<p><span style="font-size: small;">prefork, MaxClients= Total number of child servers in apache lifetime</span></p>
<p><span style="font-size: small;">worker,  MaxClients= Total number of threads in apache lifetime</span></p>
<p><span style="font-size: small;">Lets do some Math now. I have a apache running with the following specs: Apache/2.0.63, Prefork MPM and mulitple statically compiled in modules. </span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">By theory,</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">MaxClients= RAM available to Apache/ Memory for each apache process </span></p>
<p><span style="font-size: small;">Let us assume if the concept of shared memory is implemented into IPC. Assume 250M as the system RAM. Setting MaxClients will always require the administrator to see for the memory usage of apache process during idle time and peak usage time. I shall give a very short method on how to do this here. </span></p>
<p><span style="font-size: small;">The best tool we are going to use here is the well known &#8216;ps&#8217; command. Lets see how.</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">Do a  ps aux &#8211;sort -rss|grep httpd httpd from the commandline. Here is what I got for an apache server installed via EasyApche.</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">#ps aux &#8211;sort -rss|grep httpd </span></p>
<p><span style="font-size: small;">USER       PID  %CPU %MEM    VSZ   RSS   TTY   STAT START  TIME     COMMAND</span></p>
<p><span style="font-size: small;">root          3902  	0.0  	0.0        9800  3312   ?        Ss       Nov25   0:00     /usr/local/apache/bin/httpd -k start -DSSL</span></p>
<p><span style="font-size: small;">nobody    1899  	0.0  	0.0        9936  2948   ?        S        Nov25   0:00     /usr/local/apache/bin/httpd -k start -DSSL </span></p>
<p><span style="font-size: small;">nobody    1903  	0.0  	0.0        9936  2948   ?        S        Nov25   0:00     /usr/local/apache/bin/httpd -k start -DSSL </span></p>
<p><span style="font-size: small;">nobody    3912  	0.0  	0.0        9936  2948   ?        S        Nov25   0:00     /usr/local/apache/bin/httpd -k start -DSSL </span></p>
<p><span style="font-size: small;">nobody    3913  	0.0  	0.0        9936  2948   ?        S        Nov25   0:00     /usr/local/apache/bin/httpd -k start -DSSL </span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">In this context we need to look for fields RSS &amp; VSZ. Lets see.</span></p>
<p><span style="font-size: small;">VSZ (Virtual memory SIZE) &#8211; This is the aggregate of memory the process is currently using  including the RAM and also the SWAP memory(if used).</span></p>
<p><span style="font-size: small;">RSS (Resident Set Size) &#8211;  It is the portion of the process that exists in “RAM only”. The rest if any, will be in swap.</span></p>
<p><span style="font-size: small;">If the process is using no swap space, then RSS will be = SZ.</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">The above indicates that the process is being swapped by about 6-7M. This should not be the case as the process should not be allowed to swap and the required memory should be alloted or the conf should be edited so that the process is not swapped. Now lets get back to the math for MaxClients. </span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">So the actual apache process size here is 9.936M. If if there were enough memory, then RSS= VSZ= 9.936M and the whole 9.936M would have been in the RAM. Lets round it to 10M. We had assumed that our available system RAM for apache was 250M. </span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">So:</span></p>
<p><span style="font-size: small;">MaxClients=  250M/10M = 25 apache process. This means that 25 apache process is the maximum advisable range for setting the MaxClients to. Since we see that the process already swaps, we will need to allocate more memory and then set it to 25 or if not, lower the value. </span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">Now lets calculate the above case considering shared memory concepts in place(OS support required). Lets say we have a shared memory of 4M. So the available RAM to apache becomes 250-4 = 246M.</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">So:</span></p>
<p><span style="font-size: small;">MaxClients = 250-4/10-4= 61 processes. Compare the result with the above. We see that the number has increased significantly. Optmizing shared memory concepts not only increases process number but also improves IPC so this is to be considered into while optimizing apache. </span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">The above calculated is still only accurate to the extent that we can implement this in the http.conf file. Try to set a MaxClients value a but lower than the result always. In the last calculation, 50-55 would be advisable.. I have said this becuase, the actual calculation taking into account of shared memory is a bit complex for any process. </span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">2.2(d) HostnameLookups</span></p>
<p><span style="font-size: small;">This directive is used for reverse lookup of the IP address of the accessing machine initiating the connection. This adds a great delay since this lookup is done for every new request generated by the established connection. There are 3 options for this: Off, On, Double. When Double is set, one forward and sucessively a backward lookup os also performed to ensure that domain name is not being spoofed. It is usually set to Off.</span></p>
<p><span style="font-size: small;">In addition to making this Off, while implementing ACLs, you should try to avoid Hostnames. Otherwise the server will perform Double DNS lookups. See the eg:</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">&lt;Location /serverstat &gt;</span></p>
<p><span style="font-size: small;">Order deny, allow</span></p>
<p><span style="font-size: small;">Deny from all </span></p>
<p><span style="font-size: small;">Allow from www.example.com</span></p>
<p><span style="font-size: small;">&lt;/Location&gt; </span></p>
<p><span style="font-size: small;">Instead, try to use IP address in above. However accordig to our example, the lookup will only be performed for URLs starting with /serverstat. </span></p>
<p><!-- p { margin-bottom: 0.21cm; } --></p>
<p><span style="font-size: small;">2.2(e) FollowSymLinks and SymLinksIfOwnerMatch</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">Lets talk in general. Actually FollowSymLinks enable the server to follow symbolic links to files to wherever they are if there are any in the directory it is enabled. Actually this is a security threat since blindly having this enabled can have a webcliet wander in filesystems into which it is actually not allowed. Say, the user has created a symlink to /etc/passwd in his DocumentRoot. This can reveal the file to him. So disable this option on the whole? No, this will not only disable the user from using safe and useful symbolic links within his permitted directory, but also induce extra overhead for apache. Extra overhead? Yes. When this option is disabled, when ever a resource is requested, apache will look whether the requested resource and its preceeding directories are a symlink or not from the server root &#8216;/&#8217;. Didn&#8217;t get it? See the below:</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">DocumentRoot /www/htdocs </span></p>
<p><span style="font-size: small;">&lt;Directory /&gt; </span></p>
<p><span style="font-size: small;">Options -FollowSymLinks </span></p>
<p><span style="font-size: small;">&lt;/Directory&gt;</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">When index.html is requested, apache will check whether: /www, /www/htdocs, /www/htdocs/index.html are symbolic links or not. Why does apache check this? Because we have told in &#8216;Options&#8217; directive that not to serve contents if they are symlinks. So if /www/htdocs/index.html or  www/htdocs or www was a symlink to something else, apache would have returned an error. This number of this check will increase if the requested resource is in deeper sub-directories and  the result of these checks are also not cached so check is made with every request even if the resource is in the same directory as the previous resource that was sought. The key point to note here is that if FollowSymLinks  was enabled, apache will not perform these checks, but will simply follow if a link is found.  This is highly derogatory to pertformace. So disabling FollowSymLinks on the whole is not at all advisable. </span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">Next, the SymLinksIfOwnerMatch directive. This was used as a workaround for the security leak created by FollowSymLinks of apache serving files outside user&#8217;s directories. This ensures that apache will follow the symbolic link iff the owner of the destination file is same as the owner of the link. This again, is an overhead since for each request, apache will have to do a check on the ownership of the destination files. </span></p>
<p><span style="font-size: small;">Now its really stuck. How do we do then? A practical case is to divide the directories in which these directives have the influence. We may deploy the following considering the Document root as: /var/www/htdocs.</span></p>
<p><span style="font-size: small;">&lt;Directory /&gt; </span></p>
<p><span style="font-size: small;">Options FollowSymLinks </span></p>
<p><span style="font-size: small;">&lt;/Directory&gt;</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">&lt;Directory /var/www/htdocs&gt; </span></p>
<p><span style="font-size: small;">Options -FollowSymLinks +SymLinksIfOwnerMatch </span></p>
<p><span style="font-size: small;">&lt;/Directory&gt;</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --> <!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">Now this is a good solution. Suppose a reques is made for index.html in /var/www/htdocs. We have enabled  FollowSymLinks for &#8216;/&#8217; and disabled it for /var/www/htdocs only. So this will eliminate the need for checking whether: /var, /var/www/, /var/www/htdocs are symbolic links or not. Apache will only need to check if /var/www/htdocs/ index.html is a symlink since FollowSymLinks  has been disabled under /var/www/htdocs and index.html is under it. +SymLinksIfOwnerMatch ensures that destination file of the link served only if its owned by the same user of the link. </span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">2.2.(f) MaxRequestsPerChild</span></p>
<p><span style="font-size: small;">This can be set to either 0 or &gt;0. When set to 0, the apache process will handle infinite number of requests and will not terminate by itself. When set to a value &gt;0, the apache process will terminate voluntarily after handling the specified number of requests in MaxRequestsPerChild directive.</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">Setting this to zero has shown memory leakage issues. In simple words, the process after temination(will be done by the master process), will not release the meomry space that it had held so that it could be used by the upcoming or the in need apache processes. So if the process has run for a long time loading up more modules as it ran, it is possible to lock a hefty amount of memory after termination. The drawback need not be pointed to apache, but can be the underlying shortcoming of the platform or the poor programming of the loaded modules. One might need to monitor this carefully using pmap, ps and top. Check for the buggy modules etc, correct it out and then set this to 0 since this is more preferred if performance is sought.</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><a name="htacess"></a><span style="font-size: small;">2.2.(g) AllowOverride</span></p>
<p><span style="font-size: small;">If this is enabled in a directory, whenever apache traverses this directory and its sub-directories, it will look for the file &#8216;.htaccess&#8217; and try to read its contents. If found, it will display contents in this directory only according to the options mentioned in this, overriding the global server settings. Like the case of 2.2(e), it is advisable to divide this setting into   two. One for the / partition and other for the DocumentRoot of the users. If /var/www/htdocs is the DocumentRoot it can be given like: </span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">&lt;Directory /&gt; </span></p>
<p><span style="font-size: small;">AllowOverride None </span></p>
<p><span style="font-size: small;">&lt;/Directory&gt;</span></p>
<p><span style="font-size: small;">&lt;Directory /var/www/htdocs&gt; </span></p>
<p><span style="font-size: small;">AllowOverride All </span></p>
<p><span style="font-size: small;">&lt;/Directory&gt;</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">2.2.(h) </span><code><span style="font-family: Nimbus Roman No9 L,serif;"><span style="font-size: small;">EnableSendfile</span></span></code></p>
<p><code><span style="font-family: Nimbus Roman No9 L,serif;"><span style="font-size: small;">If your OS supports sendfile system call, you might need to consfier using this since it enables direct delivery of files to sockets. This can also be used on a per-directory basis. </span></span></code></p>
<p><!-- p { margin-bottom: 0.21cm; } --><code><span style="font-family: Nimbus Roman No9 L,serif;"><span style="font-size: small;">2.2.(i) StartServers, MinSpareServers, and MaxSpareServers</span></span></code></p>
<p><!-- p { margin-bottom: 0.21cm; } --><code><span style="font-family: Nimbus Roman No9 L,serif;"><span style="font-size: small;">This indicates the number of processes that apache is to create while starting, the minimum and maximum number of idle servers to maintain respectively. This should be set on account of the server load. The default values are given below:</span></span></code></p>
<p><code><span style="font-family: Nimbus Roman No9 L,serif;"><span style="font-size: small;">StartServers 		5</span></span></code></p>
<p><code><span style="font-family: Nimbus Roman No9 L,serif;"><span style="font-size: small;">MinSpareServers 	5</span></span></code></p>
<p><code><span style="font-family: Nimbus Roman No9 L,serif;"><span style="font-size: small;">MaxSpareServers  	10</span></span></code></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">2.2.(j) ListenBacklog </span></p>
<p><span style="font-size: small;">If all the apache servers are busy processing requests, then new requests will not be rejected but queued if this directive is enabled. What is defined by this is the length of this queue. By default, it is 511. There is no need to change this value in many cases. </span></p>
<p><span style="font-size: small;">2.2.(k) KeepAlive </span></p>
<p><span style="font-size: small;">This is a platform independent and http related apache performance directive. Persistent connections allow a client to send more than one request over the same connection . This is a very useful feature that must be enabled which is highly beneficial to the clients. The preferred chioce is to keep this On.</span></p>
<p><span style="font-size: small;">2.2.(l) KeepAliveTimeout </span></p>
<p><span style="font-size: small;">This specifies the time in seconds apache process(or thread) will wait for the next request from the client once the previous is processed and delivered. If the client does not make the next request within this time, apache closes the connection and the same client, for a new request, will have to open a new connection with apache server. This may or may not be delayed since it will depend on the available idle apache servers to accept new connections. The default value is about 15 seconds.</span></p>
<p><span style="font-size: small;">2.2.(m) MaxKeepAliveRequests </span></p>
<p><span style="font-size: small;">When the number of requests defined by this directive is reached, apache will automatically terminate the persistent connection even if  KeepAliveTimeout value hasn&#8217;t expired. The value should be high such as 100 which is the most used. </span></p>
<p><span style="font-size: small;">2.2.(n) I will now mention some HTTP  intensive directives that are not much looked upon and left to their default in most cases. </span></p>
<p><span style="font-size: small;">LimitRequestBody</span></p>
<p><span style="font-size: small;">This directive specifies the number of bytes from 0 (meaning unlimited) to 2GB that are allowed in a equest body . It can be given server, per-directory, per-file or per-location basis. If the client request exceeds that limit, the server will return an error response instead of servicing the request. It is usually defeulted to 0. </span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">LimitRequestFields</span></p>
<p><span style="font-size: small;">This directive allows the server administrator to modify the limit on the number of request header fields allowed in an HTTP request. A server needs this value to be larger than the number of fields that a normal client request might include. The number of request header fields used by a client rarely exceeds 20 . This directive gives the server administrator greater control over abnormal client request behavior, which may be useful for avoiding some forms of denial-of-service attacks. It is defeulted to 100. </span></p>
<p><span style="font-size: small;">LimitRequestFieldSize</span></p>
<p><span style="font-size: small;">This directive allows the server administrator to reduce the limit on the allowed size of an HTTP request header field and is mentioned in bytes. This is also useful in preventing DOS attacks. The default is 8190 bytes.</span></p>
<p><span style="font-size: small;">LimitRequestLine </span></p>
<p><span style="font-size: small;">This directive allows the server administrator to reduce the limit on the allowed size of a client’s HTTP request-line .                                                                              Since the request-line consists of the HTTP method, URI, and protocol version, the LimitRequestLine directive places a restriction on the length of a request-URI allowed for a request on the server. This also helps in preventing DOS attacks to an extent. The default is 8190 characters. </span></p>
<p><span style="font-size: small;">2.2.(o) If a proxy web server is used supplementing your main server, then we must consider in including the apache module mod_expires since directives supplied by this is very useful in reducing the hits to main server by implementing the method of caching. The cache is maintained by the proxy. It is the headers of the resource sent to the proxy that tells it to cache the page or not. The directiuves of concern are: </span></p>
<p><span style="font-size: small;">ExpiresActive: This directive enables or disables the generation of the Expires header for the document that apache servers to the proxy. If set to Off or On, this can be overriden in .htaccess file. </span></p>
<p><span style="font-size: small;">ExpiresByType: This directive defines the value of the Expires header generated for documents of the specified type (e.g., text/html). The second argument sets the number of seconds that will be added to a base time to construct the expiration date. The base time is either the last modification time of the file, or the time of the client’s access to the document.</span></p>
<p><span style="font-size: small;">ExpiresDefault: This directive sets the default algorithm for calculating the expiration time for all documents in the affected realm.</span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">I shall give an example:</span></p>
<p><span style="font-size: small;"># enable expirations </span></p>
<p><span style="font-size: small;">ExpiresActive On </span></p>
<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;"># expire GIF images after a month in the client’s cache </span></p>
<p><span style="font-size: small;">ExpiresByType image/gif A604800</span></p>
<p><span style="font-size: small;"># HTML documents are good for a week from the time they were changed </span></p>
<p><span style="font-size: small;">ExpiresByType text/html M604800 </span></p>
<p><!-- p { margin-bottom: 0.21cm; } --></p>
<p><span style="font-size: small;">By the 2<sup>nd</sup> line, we have set this feature to On. By the 4<sup>th</sup> and 6<sup>th</sup> line, we specify the the type of data for which caching should be enabled. We have set caching for image files of the format gif to a week. The character A before the time stands for &#8216;Access&#8217;. This tells apache that to send a header which will make the cached file expire 1 week  after the file was &#8216;Accessed&#8217; by the client. We have set the caching of text documents of the type html to 1 week. This time we have mentioned &#8216;M&#8217; before the time in seconds. M stands for modification. This tells Apache to send an Expires header so that documents expire 604800 seconds after the date they were last modified. The options available are M &amp; A  only. </span></p>
<p><span style="font-size: small;">Thus caching brings down the hit to webserver tremendously.</span></p>
<p><!-- p { margin-bottom: 0.21cm; }h3 { margin-bottom: 0.21cm; }h3.western { font-family: "Nimbus Roman No9 L",serif; } --><span style="font-size: small;">2.2.(p) ExtendedStatus</span></p>
<p><span style="font-size: small;">When this directive is set to On, it makes apache to issue two system calls to the OS to get time: gettimeofday(2) and time(2). This is done so that the status report contains indications of time. Its better to set this to Off. </span></p>
<p><!-- p { margin-bottom: 0.21cm; } --></p>
<p><span style="font-size: small;">2.2.(q) Scoreboard File</span></p>
<p><span style="font-size: small;">Since apache master server and its children communicate using the scoreborad file, it is always better to implement it in the shared memory area. Usually this will be on the disk. This change is made in </span><code><span style="font-family: Nimbus Roman No9 L,serif;"><span style="font-size: small;">src/main/conf.h file.</span></span></code></p>
<p><!-- p { margin-bottom: 0.21cm; } --><code><span style="font-family: Nimbus Roman No9 L,serif;"><span style="font-size: small;"><em><strong>I would suggest the reader to go through the below link for some of the best suggestions from professionals at Google for overall optimization of website and the webserver. Its really worth it. </strong></em></span></span></code></p>
<p><code><span style="font-family: Nimbus Roman No9 L,serif;"><span style="font-size: small;"><strong>http://code.google.com/speed/page-speed/docs/rules_intro.html</strong></span></span></code></p>
<p><!-- p { margin-bottom: 0.21cm; } --><code><span style="font-family: Nimbus Roman No9 L,serif;"><span style="font-size: small;">So I guess this would be the some of the main areas of apache to look on while configuring the software. In the next section we will see a bit on testing or benchmarking the Apache server. </span></span></code></p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Apache+Performance+Tuning+%28Part+II%2FIII%29+-+Editing+Apache+for+Performance+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1642" 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=Apache+Performance+Tuning+%28Part+II%2FIII%29+-+Editing+Apache+for+Performance+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1642" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2011/01/apache-performance-tuning-part-iiiii-editing-apache-for-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Performance Tuning (Part I/III) &#8211; Choosing the Best Platform for Apache</title>
		<link>http://www.supportsages.com/blog/2011/01/apache-performance-tuning-part-iiii-choosing-the-best-platform-for-apache/</link>
		<comments>http://www.supportsages.com/blog/2011/01/apache-performance-tuning-part-iiii-choosing-the-best-platform-for-apache/#comments</comments>
		<pubDate>Tue, 04 Jan 2011 09:31:14 +0000</pubDate>
		<dc:creator>steve</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache performance]]></category>
		<category><![CDATA[tuning]]></category>
		<category><![CDATA[tuning apache]]></category>
		<category><![CDATA[tweaking]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=1635</guid>
		<description><![CDATA[<!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">Apache is a highly configurable software. Apache tuning can be learned effectively only by getting first hand experiences in live environments. But, all the knowledge in this world, before being put into practical usage, will need proper theoretical explanation and analysis. This is what this document intends to provide you with references from online articles and books on Apache.</span>

<span style="font-size: small;">Configuring Apache for maximum performance requires our interest in 2 areas:</span>

<span style="font-size: small;"><strong>i) Tuning Apache so that it exploits the maximum out of the system's available Hardware and Software.</strong> The term Hardware ...]]></description>
			<content:encoded><![CDATA[<p><!-- p { margin-bottom: 0.21cm; } --><span style="font-size: small;">Apache is a highly configurable software. Apache tuning can be learned effectively only by getting first hand experiences in live environments. But, all the knowledge in this world, before being put into practical usage, will need proper theoretical explanation and analysis. This is what this document intends to provide you with references from online articles and books on Apache.</span></p>
<p><span style="font-size: small;">Configuring Apache for maximum performance requires our interest in 2 areas:</span></p>
<p><span style="font-size: small;"><strong>i) Tuning Apache so that it exploits the maximum out of the system&#8217;s available Hardware and Software.</strong> The term Hardware signifies the system CPU, RAM and the disk I/O. Software signifies apache-modules and system OS. Be it software or hardware, I haveoverhead mentioned only those components which the apache software is in direct concern with.</span></p>
<p><span style="font-size: small;"><strong>ii)Tuning Apache so that it withstands attacks.</strong> Just imagine. All our above efforts in (i)would be in vain if the software is not properly configured to resist attacks such as DOS and even more undesirable, the DDOS. Web server administrators in trying to do so discovered that this itself was a vast area to study and explore and lead to a stream called as &#8216;Apache Security&#8217;. This is why I have placed apache tuning into 2 areas. </span></p>
<p><span style="font-size: small;">So we are now going to journey into the former part. Although, I will not be able to give you a comprehensive detail on each subject (which will require hundreds of pages!) I will try to throw light on some of the most important areas to cover. </span></p>
<p><span style="font-size: small;">The performance tuning of apache will be done in a few stages. These are:</span></p>
<p><span style="font-size: small;">1. Choosing the Best Platform for Apache</span></p>
<p><span style="font-size: small;">2. Editing the Apache Software for Performance</span></p>
<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } 		H3 { margin-bottom: 0.21cm } --><span style="font-size: small;">From Part I through Part III, I have references from:</span></p>
<p><span style="font-size: small;"><em>- FMC – The Apache Modelling Project</em></span></p>
<p><em><span style="font-size: small;">- Pro Apache by Peter Wainwright</span></em></p>
<p><em><span style="font-size: small;">- http://perl.apache.org/docs/1.0/guide/performance.html</span></em></p>
<p><span style="font-size: small;">Lets discuss the former part.</span></p>
<p><span style="font-size: small;">A fine performing and well tuned software is of no use unless it has a good foundation to work on. It must have the best suited combination of both the Hardware &amp; Software(primarily the OS). Below I attempt to discuss some points which should be kept in mind.</span></p>
<p><span style="font-size: small;"><strong>1.1 </strong><span style="text-decoration: underline;"><strong>Choosing the Right Operating System</strong></span> </span></p>
<p><span style="font-size: small;">This is one of the main key element required for proper functioning of the server software. The characteristics of this highly influences the Apache software. Search for the below points when choosing the OS for apache.</span></p>
<p><span style="font-size: small;">1.1.(i) mod_perl Support for the Operating System </span></p>
<p><span style="font-size: small;">This is to be considered seriously since the module mod_perl is a very handy tool which can help in extracting the maximum out Apache. I will be discussing its significance(not tuning with mod_perl) towards the end of this document.</span></p>
<p><span style="font-size: small;">1.1.(ii) Supports &#8216;sendfile&#8217; system call</span></p>
<p><span style="font-size: small;">This mainly benefits applications following the client-server arhitecture. A sendfile system call in general improves delivery of data from disk over to sockets. For retriveing a client requrested data, from disk, applications spends much time in transferring data from disk to many intermediate buffers and only then, to the socket. This induces much delay. With OS having kernel supporting sendfile, this can be achieved in a single operation.</span></p>
<p><span style="font-size: small;">1. 1.(iii) Good Memory Management </span></p>
<p><span style="font-size: small;">The reason why I mention this is because for the same script, some OS will tend to use the twice as much as memory used by another. Please consider from discarding such OS from your list immediately.</span></p>
<p><span style="font-size: small;">1.1.(iv) Avoiding Memory Leaks </span></p>
<p><span style="font-size: small;">A memory leak happens when some process occupies some blocks of memory and does not release it after it completes the execution of instructions which require those memory blocks. As a result, this part of the memory becomes unusable to other processes until the process that has occupied it has died. We certainly do not want that.</span></p>
<p><span style="font-size: small;">1.1.(iv) Memory-Sharing Capabilities </span></p>
<p><span style="font-size: small;">The new processes(children) that are spawned by apache should be able to share the features of the loaded modules of the parent apache process. This can save much memory and can be realized only if the OS supports memory sharing.</span></p>
<p><span style="font-size: small;">1.1.(v) The Support for OS</span></p>
<p><span style="font-size: small;">Good technical support must be available for the OS you implement and the support team remain vigilant about the holes and other aspects so that they do not give way for hackers. They should also be able to provide you personal support regarding the issues you have with your OS.</span></p>
<p><span style="font-size: small;">1.1.(vi) Discontinued Products</span></p>
<p><span style="font-size: small;">The company of your OS should not all of a sudden withdraw the release of new products and this can prove very bad in course of time even if you are satisfied with the functioning of the OS currently.</span></p>
<p><span style="font-size: small;">1.1.(vii) Regular OS releases</span></p>
<p><span style="font-size: small;">The OS needs to be kept up to date with the latest technology and kernel updates which are utmost necessary to keep the OS stable and free from security leaks.</span></p>
<p><span style="font-size: small;"><strong>1.2 <span style="text-decoration: underline;">Choosing the Right Hardware</span></strong></span></p>
<p><span style="font-size: small;">In concern with Hardware, there are no hard-set rules in calculating the appropriate number(the number specification of hardware. Eg: 128M RAM). This is because the number needed will be depend on the environment you place Apache in. A well functioning OS can be built on a good hardware and implementation such as:</span></p>
<p><span style="font-size: small;">1.2.(i) Random Access Memory (RAM)</span></p>
<p><span style="font-size: small;">Although you may see everywhere as the amount of installed RAM on the system, this is misleading. What actually counts is the RAM that is actually available to apache process. So we should actually calculate the amount of RAM usage on the system with all the process except apache started. This will be the available RAM for apache. The main goal while calculating the RAM for the server should be: the system never goes into a state to use the SWAP memory. When you need to write something into memory, and it is full, it swaps pages out of the memory that are less frequently used to the SWAP space. Only then you will be able to perform write operation to RAM memory. Thus delay is caused. </span></p>
<p><span style="font-size: small;">In the meantime if an other application supplementing the web server requests some pages and if it happens to be in one of the swapped pages, then the processor will have to load those pages again into main memory(RAM) swapping out some other data which might be needed in a short while. Let to repeat this, the state of the system can get worse. While configuring, you should also be aware that other essential system processes also need to be running smoothly. </span></p>
<p><span style="font-size: small;">1.2.(ii) CPU</span></p>
<p><span style="font-size: small;">This is the &#8216;Processor&#8217;. Using multicore processor with multi cache levels is a general and accepted implementation.</span></p>
<p><span style="font-size: small;">1.2.(iii) Disks with good I/O</span></p>
<p><span style="font-size: small;">Since apache is constant process of retrieval and writing data into disk, a good disk with high I/O capabilities is very much essential. This can also be achieved by implementing RAID.</span></p>
<p><span style="font-size: small;">1.2.(iv) Network Interface Card (NIC)</span></p>
<p><span style="font-size: small;">A hardware component that allows your machine to connect to the network. It sends and receives packets. NICs come in different speeds, varying from 10 MBps to 10 GBps and faster. The most widely used NIC type is the one that implements the Ethernet networking protocol.</span></p>
<p><span style="font-size: small;">1.2.(v) Cluster Implementation</span></p>
<p><span style="font-size: small;">As the name suggests, one or more interconnected machines working together to perform one big task is the core idea behind clustering. This is also implemented to provide backup during failure of one machine in the cluster. Similar to implementing RAID in disks to account for recovery from data loss due to disk failure.</span></p>
<p><span style="font-size: small;">1.2.(vi) Load balancing</span></p>
<p><span style="font-size: small;">This is a by product of clustering. If a web server is unable to handle load, it then dispatches the requests it receives to the web servers in it&#8217;s cluster to server the requests. In this mode of implementation, the http request will always reach first to the main server which is configured to hold the sites(or the as mentioned in the DNS). The server according to its load, will either server the request or dispatch the request to its&#8217;s load balancing server which handles the request from thereon.</span></p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Apache+Performance+Tuning+%28Part+I%2FIII%29+-+Choosing+the+Best+Platform+for+Apache++http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1635" 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=Apache+Performance+Tuning+%28Part+I%2FIII%29+-+Choosing+the+Best+Platform+for+Apache++http%3A%2F%2Fwww.supportsages.com%2Fblog%2F1635" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2011/01/apache-performance-tuning-part-iiii-choosing-the-best-platform-for-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How do I change the default Plesk Backup Repository location ?</title>
		<link>http://www.supportsages.com/blog/2010/05/how-do-i-change-the-default-plesk-backup-repository-location/</link>
		<comments>http://www.supportsages.com/blog/2010/05/how-do-i-change-the-default-plesk-backup-repository-location/#comments</comments>
		<pubDate>Thu, 20 May 2010 02:25:53 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[backup respository]]></category>
		<category><![CDATA[windows 32 bit editions]]></category>
		<category><![CDATA[windows 64 bit editions]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=755</guid>
		<description><![CDATA[<strong>Windows 32 bit edition</strong>

You can edit default server backup repository directory path through registry. Go to 

Regedit and then browse the keys
HKEY_LOCAL_MACHINE\SOFTWARE\PLESK\PSA Config\Config

Right Click on variable "DUMP_D" select Modify and set the server backup repository path as you wish. Default Directory Path for Plesk Backup is "C:\Program Files\Parallels\Plesk\Backup\". Go ahead and change it to a location of your wish, say "E:\Backup"

<strong>Windows 64 bit edition</strong>

Again it's the registry only, but the location may be a bit different. You need to browse to 
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\PLESK\PSA Config\Config

And repeat the steps mentioned above. If you cant find these keys, search for the "DUMP_D" without quotes ...]]></description>
			<content:encoded><![CDATA[<p><strong>Windows 32 bit edition</strong></p>
<p>You can edit default server backup repository directory path through registry. Go to </p>
<p>Regedit and then browse the keys<br />
HKEY_LOCAL_MACHINE\SOFTWARE\PLESK\PSA Config\Config</p>
<p>Right Click on variable &#8220;DUMP_D&#8221; select Modify and set the server backup repository path as you wish. Default Directory Path for Plesk Backup is &#8220;C:\Program Files\Parallels\Plesk\Backup\&#8221;. Go ahead and change it to a location of your wish, say &#8220;E:\Backup&#8221;</p>
<p><strong>Windows 64 bit edition</strong></p>
<p>Again it&#8217;s the registry only, but the location may be a bit different. You need to browse to<br />
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\PLESK\PSA Config\Config</p>
<p>And repeat the steps mentioned above. If you cant find these keys, search for the &#8220;DUMP_D&#8221; without quotes and update it.</p>
<p><strong>Linux 32/64 bit editions</strong></p>
<p>#vi /etc/psa/psa.conf</p>
<p>Find the following variable, DUMP_D  and edit the server backup repository directory PATH as you wish. Default Directory Path for Plesk Backup is &#8220;/var/lib/psa/dumps&#8221; You may change it to /media/backups</p>
<p># Backups directory<br />
DUMP_D /var/lib/psa/dumps</p>
<p>Okay. Those were the steps of a sysadmin not so greenhorn. If you are not comfortable with running regedit, use Plesk Panel Reconfigurator.</p>
<p>By using Parallels Plesk Panel Reconfigurator you can move the Parallels Plesk Panel backup files storage directory to another location on the same or another partition.</p>
<p>To change location of the backup files directory, follow these steps:</p>
<p>   1. Run Parallels Plesk Panel Reconfigurator and select the Change Plesk Backup Data location option.<br />
   2. Specify the destination directory name. If the directory does not exist, it will be created.<br />
   3. Click Next. During this operation all Parallels Plesk Panel services will be restarted.</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=How+do+I+change+the+default+Plesk+Backup+Repository+location+%3F+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F755" 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+do+I+change+the+default+Plesk+Backup+Repository+location+%3F+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F755" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2010/05/how-do-i-change-the-default-plesk-backup-repository-location/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Load Average and CPU usage in Linux!</title>
		<link>http://www.supportsages.com/blog/2009/05/load-average-and-cpu-usage-in-linux/</link>
		<comments>http://www.supportsages.com/blog/2009/05/load-average-and-cpu-usage-in-linux/#comments</comments>
		<pubDate>Thu, 28 May 2009 20:16:15 +0000</pubDate>
		<dc:creator>victor</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Specials]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Load]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=389</guid>
		<description><![CDATA[Load Average and CPU usage in Linux
====================================

The three common commands that give the load average details are:

* uptime
* w
* top

* tload graphical but in terminal
* xload graphical in the X display

It is the average sum of the number of processes waiting in the run-queue plus the processes currently executing over 1, 5, and 15 minute time periods.

It represents the average number of processes that are in the running (using the CPU) or runnable (waiting for the CPU) states. The notable exception in Linux is that it includes processes in uninterruptible sleep states like waiting for some I/O activity to complete. ...]]></description>
			<content:encoded><![CDATA[<p>Load Average and CPU usage in Linux<br />
====================================</p>
<p>The three common commands that give the load average details are:</p>
<p>* uptime<br />
* w<br />
* top</p>
<p>* tload graphical but in terminal<br />
* xload graphical in the X display</p>
<p>It is the average sum of the number of processes waiting in the run-queue plus the processes currently executing over 1, 5, and 15 minute time periods.</p>
<p>It represents the average number of processes that are in the running (using the CPU) or runnable (waiting for the CPU) states. The notable exception in Linux is that it includes processes in uninterruptible sleep states like waiting for some I/O activity to complete. This can markedly increase the load average on Linux systems.</p>
<p>For a single processor machine a load average of 1 means that, on average, there is always a process in the running or runnable state. Thus, the CPU is being utilized 100% of the time and is at capacity. If you tried to run another process, it would have to wait in the run queue before being executed. For multiprocessor systems, however, the system isn’t CPU bound until the load average equals the number of processors (or cores, for multi-core processors) in the machine. If a database server, for example, has two dual core processors(2&#215;2 processors), the system isn’t fully utilized until the load average reaches 4.</p>
<p>As a general rule of thumb we dont have to panic untill the load average is 3 (3 for single core 6 for dual core and so on ). This is strictly a general concept.</p>
<p>CPU persentage or CPU usage<br />
===========================</p>
<p>CPU percentage is the amount of a time interval that the system&#8217;s processes were found to be active on the CPU. If the system CPU usage (by using top command) is 45%, 45% of the samples taken by top found your process active on the CPU. The rest of the time the application was in a wait. (It is important to remember that a CPU is a discrete state machine. It really can be at only 100%, executing an instruction, or at 0%, waiting for something to do. There is no such thing as using 45% of a CPU. The CPU percentage is a function of time.)</p>
<p>To summarize CPU load is no. of processes waiting or running in the processor. CPU usages is time taken by any process in the CPU before complete execution.</p>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Load+Average+and+CPU+usage+in+Linux%21+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F389" 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=Load+Average+and+CPU+usage+in+Linux%21+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F389" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/05/load-average-and-cpu-usage-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chapter 5 Logging to a Linux system!</title>
		<link>http://www.supportsages.com/blog/2009/05/chapter-5-logging-to-a-linux-system/</link>
		<comments>http://www.supportsages.com/blog/2009/05/chapter-5-logging-to-a-linux-system/#comments</comments>
		<pubDate>Sun, 03 May 2009 11:40:44 +0000</pubDate>
		<dc:creator>Fabian</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[features of linux]]></category>
		<category><![CDATA[linux desktops]]></category>
		<category><![CDATA[linux window manager]]></category>
		<category><![CDATA[multitasking in linux]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=232</guid>
		<description><![CDATA[Linux is a Multi-user and Multi-tasking operating system. The system can be used by more than one user simultaneously, and the computer can also run multiple programsat a time.

<strong>Types of Multi-tasking :-</strong>

1. Cooperative multitasking - Decision is taken by application/programs cooperatively. A poorly designed program or a crashed process can potentially crash the entire operating system since it could prevent a process from relinquishing the CPU to other processes.

2. Preemptive multitasking - Decision is taken by OS. Permits the system to respond immediately to important external events, such as incoming data from a keyboard or network.

Types of Logins :-
<ul>
	<li>Command Line ...]]></description>
			<content:encoded><![CDATA[<p>Linux is a Multi-user and Multi-tasking operating system. The system can be used by more than one user simultaneously, and the computer can also run multiple programsat a time.</p>
<p><strong>Types of Multi-tasking :-</strong></p>
<p>1. Cooperative multitasking &#8211; Decision is taken by application/programs cooperatively. A poorly designed program or a crashed process can potentially crash the entire operating system since it could prevent a process from relinquishing the CPU to other processes.</p>
<p>2. Preemptive multitasking &#8211; Decision is taken by OS. Permits the system to respond immediately to important external events, such as incoming data from a keyboard or network.</p>
<p>Types of Logins :-</p>
<ul>
<li>Command Line login</li>
<li>GUI based login</li>
</ul>
<p>Case-Sensitivity in login : fossil and FOSSIL are two different user names! The same applies to the passwords!</p>
<p><strong>Virtual Consoles -</strong></p>
<p>The linux based system provides different virual consoles for login.<br />
Alt+F1 ,Alt+F2 till Alt+F6 (by default) sometimes it is Ctrl+Alt+F1 allows you to multi-task in console mode also. Alt + F7 is the GUI</p>
<p>How to login:-</p>
<ul>
<li>Console &#8211; ttys and pts    (ttys is Terminal Type and  pts is  pseudo terminal).</li>
</ul>
<ul>
<li> Serial Terminal &#8211; Hyperterminal</li>
</ul>
<ul>
<li> Network Connection &#8211; SSH / telnet etc( connects between the systems remotely )</li>
</ul>
<p><strong>CUI  :-</strong> CUI (Composite User Interface) is a compound type of user interface which incorporates the features of the GUI (Graphical User Interface) and the CLI (Command Line Interface) by realizing both interface in one area at the same time</p>
<p><strong>GUIs In Linux :-</strong></p>
<p>Unlike Windows, GUI is an application in itself.</p>
<p>XFree86, Xorg  are two free X server implementations and VNC &#8211; client/server architecture The Client and Server communicates using TCP/IP protocol even in local system and not the usual way of local communication, Unix sockets.</p>
<p>In Linux we have a  dozens of choices for  GUI:-</p>
<p>Desktops:-</p>
<ul>
<li> GNOME</li>
<li> KDE</li>
<li> XFCE</li>
<li> CDE</li>
</ul>
<p>Window Managers &#8211; Clients application of X :-</p>
<ul>
<li> FVWM</li>
<li> IceWM</li>
<li> FluxBOX</li>
<li> Enlightenment</li>
<li> BlackBox</li>
<li> Metacity &#8211; GNOME&#8217;s WM</li>
</ul>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Chapter+5+Logging+to+a+Linux+system%21+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F232" 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=Chapter+5+Logging+to+a+Linux+system%21+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F232" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/05/chapter-5-logging-to-a-linux-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Monitoring with Nagios and NRPE</title>
		<link>http://www.supportsages.com/blog/2009/05/monitoring-with-nagios-and-nrpe/</link>
		<comments>http://www.supportsages.com/blog/2009/05/monitoring-with-nagios-and-nrpe/#comments</comments>
		<pubDate>Fri, 01 May 2009 20:47:50 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
				<category><![CDATA[Howtos]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[NRPE]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=131</guid>
		<description><![CDATA[<strong>Nagios</strong>

Nagios is a versatile and functional network management tool with a GUI (graphicuser interface) comparable to other commercial tools. It is a system and network monitoring application. It watches hosts and services that you specify, alerting you when things go bad and when they get better. Nagios was originally designed to run under Linux, but now it also runs well on other Unix variants.

<strong>Nagios Installation Guides</strong>:

This blog is intended to provide you with simple instructions on how to install Nagios from source (code) in Fedora.

<strong>Prerequisites</strong>:

Before installing Nagios,you need to install the following packages:
Apache
GCC compiler
GD development libraries

You can use yum to ...]]></description>
			<content:encoded><![CDATA[<p><strong>Nagios</strong></p>
<p>Nagios is a versatile and functional network management tool with a GUI (graphicuser interface) comparable to other commercial tools. It is a system and network monitoring application. It watches hosts and services that you specify, alerting you when things go bad and when they get better. Nagios was originally designed to run under Linux, but now it also runs well on other Unix variants.</p>
<p><strong>Nagios Installation Guides</strong>:</p>
<p>This blog is intended to provide you with simple instructions on how to install Nagios from source (code) in Fedora.</p>
<p><strong>Prerequisites</strong>:</p>
<p>Before installing Nagios,you need to install the following packages:<br />
Apache<br />
GCC compiler<br />
GD development libraries</p>
<p>You can use yum to install these packages by running the following commands (as root):</p>
<blockquote><p>yum install  httpd<br />
yum install  gcc<br />
yum install  glibc glibc-common<br />
yum install  gd gd-devel</p></blockquote>
<p>1) <em>Create Account Information</em></p>
<p>Create a new nagios user account.</p>
<blockquote><p>/usr/sbin/useradd -m nagios</p></blockquote>
<p>Create a new nagcmd group for allowing external commands to be submitted through the web interface. Add both the nagios user and the apache user to the group.</p>
<blockquote><p>/usr/sbin/groupadd nagcmd<br />
/usr/sbin/usermod -a -G nagcmd nagios<br />
/usr/sbin/usermod -a -G nagcmd apache</p></blockquote>
<p>2) <em>Download Nagios</em>:</p>
<p>Create a directory for storing the downloads.</p>
<blockquote><p>mkdir ~/ssages<br />
cd ~/ssages<br />
wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-3.0.6.tar.gz</p></blockquote>
<p>3) <em>Compile and Install Nagios</em></p>
<p>Extract the Nagios source code tarball.</p>
<blockquote><p>tar xzf nagios-3.0.6.tar.gz<em><br />
</em>cd nagios-3.0.6<br />
./configure &#8211;with-command-group=nagcmd<br />
make install<br />
make install-init<br />
make install-config<br />
make install-commandmode<br />
nagios-3.0.6</p></blockquote>
<p>4) <em>Configure the Web Interface<br />
</em><br />
Install the Nagios web config file in the Apache conf.d directory.</p>
<blockquote><p>make install-webconf</p></blockquote>
<p>Create a nagiosadmin account for logging into the Nagios web interface.</p>
<blockquote><p>htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin</p></blockquote>
<p>Edit the file<em> /usr/local/apache/conf/includes/pre_virtualhost_global.conf</em> and append the following lines to the virtual host directories.</p>
<blockquote><p>AuthName &#8220;Nagios&#8221;<br />
AuthType Basic<br />
AuthUserFile /usr/local/nagios/etc/htpasswd.users<br />
Require valid-user</p></blockquote>
<p>Restart Apache to make the new settings take effect.</p>
<blockquote><p>service httpd restart</p></blockquote>
<p>5)<strong> </strong><em>Compile and Install the Nagios Plugins</em></p>
<blockquote><p>wget http://osdn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz</p>
<p>cd ~/ssages</p>
<p>tar xzf nagios-plugins-1.4.11.tar.gz<br />
cd nagios-plugins-1.4.11</p></blockquote>
<p>Compile and install the plugins.</p>
<blockquote><p>./configure &#8211;with-nagios-user=nagios &#8211;with-nagios-group=nagios<br />
make<br />
make install<em><br />
</em></p></blockquote>
<p>6) Start Nagios</p>
<p>Add Nagios to the list of system services and have it automatically start when the system boots.<br />
<em></em></p>
<blockquote><p>chkconfig &#8211;add nagios<br />
chkconfig nagios on</p></blockquote>
<p>Verify the sample Nagios configuration files.</p>
<blockquote><p>/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg</p></blockquote>
<p>If there are no errors, start Nagios.</p>
<blockquote><p>service nagios start</p></blockquote>
<p>you can check the Nagios in your browser typing the following url:</p>
<blockquote><p><em>http://localhost/nagios</em></p></blockquote>
<p>You should now be able to access the Nagios web interface at the URL below. You&#8217;ll be prompted for the username (nagiosadmin) and password you specified earlier.</p>
<p><em><strong>NRPE Installation and Configuration</strong></em></p>
<p>The NRPE addon is designed to allow you to execute Nagios plugins on remote Linux/Unix machines. The main reason for doing this is to allow Nagios to monitor &#8220;local&#8221; resources (like CPU load, memory usage, etc.) on remote machines. Since these public resources are not usually exposed to external machines, an agent like NRPE must be installed on the remote Linux/Unix machines.</p>
<p><em>The NRPE addon consists of two pieces</em>:</p>
<p>The check_nrpe plugin, which resides on the local monitoring machine.<br />
The NRPE daemon, which runs on the remote Linux/Unix machine.</p>
<p><em>When Nagios needs to monitor a resource of service from a remote Linux/Unix machine</em>:<br />
Nagios will execute the check_nrpe plugin and tell it what service needs to bechecked.<br />
The check_nrpe plugin contacts the NRPE daemon on the remote host over an (optionally) SSL-protected connection.<br />
The NRPE daemon runs the appropriate Nagios plugin to check the service or resource.<br />
The results from the service check are passed from the NRPE daemon back to thecheck_nrpe plugin, which then returns the check results to the Nagios process.</p>
<p><strong>INSTALLATION</strong></p>
<p><em>Remote Host Setup</em>:</p>
<p>Create a new nagios user account.</p>
<blockquote><p>/usr/sbin/useradd nagios</p></blockquote>
<p>Create a directory for storing the downloads.</p>
<blockquote><p>mkdir ~/ssages<br />
cd ~/ssages</p>
<p>wget http://osdn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz</p></blockquote>
<p>Extract the Nagios plugins source code tarball.</p>
<blockquote><p>tar xzf nagios-plugins-1.4.11.tar.gz<br />
cd nagios-plugins-1.4.11</p></blockquote>
<p>Compile and install the plugins.</p>
<blockquote><p>./configure<br />
make<br />
make install</p></blockquote>
<p>The permissions on the plugin directory and the plugins will need to be fixed at this point, for this run the following commands.</p>
<blockquote><p>chown nagios.nagios /usr/local/nagios<br />
chown -R nagios.nagios /usr/local/nagios/libexec</p></blockquote>
<p><strong>I</strong><em><strong>nstall the NRPE daemon</strong></em>:</p>
<blockquote><p>cd ~/ssages<br />
wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nrpe-2.8.tar.gz</p>
<p>tar xzf nrpe-2.8.tar.gz<br />
cd nrpe-2.8<br />
Compile the NRPE addon.<br />
./configure<br />
make all</p></blockquote>
<p><em>Install the NRPE plugin (for testing), daemon, and sample daemon config file</em>.</p>
<blockquote><p>make install-plugin</p>
<p>make install-daemon</p>
<p>make install-daemon-config</p></blockquote>
<p>Add the following entry for the NRPE daemon to the /etc/services file.</p>
<blockquote><p>nrpe            5666/tcp# NRPE</p></blockquote>
<p>Next we add an init script for nrpe. For this,</p>
<blockquote><p>cd nrp-2.12/<br />
cp ./src/nrpe /usr/sbin/<br />
cp ./sample-config/nrpe.cfg /etc /<br />
cat init-script.in &gt; /etc/init.d/nrpe<br />
mod a+x /etc/init.d/nrpe<br />
open  the /etc/init.d/nrpe and edit<br />
NrpeBin=/usr/sbin/nrpe<br />
NrpeCfg=/usr/local/nagios/etc/nrpe.conf</p></blockquote>
<p>Then restart nrpe services</p>
<blockquote><p>/etc/init.d/nrpe restart</p></blockquote>
<p>Then edit the nrpe configuration file and allow the monitoring hoast ipaddress.</p>
<blockquote><p>allowed_hosts=ipaddress of monitoring host</p></blockquote>
<p>Next to open nrpe port in the firewall.</p>
<blockquote><p>vi  /etc/apf/conf.apf</p></blockquote>
<p>edit the follwing section and add the port number 5666</p>
<blockquote><p>IG_tcp_cports=&#8221;5666,20&#8230;&#8230;&#8230;..etc&#8221;</p></blockquote>
<p>Restart the services</p>
<blockquote><p>/etc/init.d/apf restart</p></blockquote>
<p>Make sure the nrpe daemon is running under xinetd.</p>
<blockquote><p>netstat -at | grep nrpe</p></blockquote>
<p>The output out this command should show something like this:</p>
<blockquote><p>tcp         0           0 *:nrpe    *:*          LISTEN</p></blockquote>
<p><em>Monitoring Host Setup</em></p>
<p>For monitoring remote host, you need to install nrpe plugin to the monitoring host. For this,</p>
<blockquote><p>cd ~/ssages<br />
wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nrpe-2.8.tar.gz</p>
<p>tar xzf nrpe-2.8.tar.gz<br />
cd nrpe-2.8/</p></blockquote>
<p><em>Compile the NRPE addon.</em></p>
<blockquote><p>./configure<br />
make all</p></blockquote>
<p>Install the NRPE plugin.</p>
<blockquote><p>make install-plugin</p></blockquote>
<p>Create a command definition</p>
<blockquote><p>vi /usr/local/nagios/etc/commands.cfg</p></blockquote>
<p>and add the following definition to the file:</p>
<blockquote><p>define command{<br />
command_name         check_nrpe<br />
command_line         $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$<br />
}</p></blockquote>
<p>You can insert each remote system services in one file. For that you have to edit the configuration file</p>
<blockquote><p>vi /usr/local/nagios/etc/nagios.cfg</p></blockquote>
<p>and append the following line.</p>
<blockquote><p>cfg_file=/usr/local/nagios/etc/objects/remotehost.cfg</p></blockquote>
<p><em>Create host and service definitions</em></p>
<p>First create a new template for each different type of host you&#8217;ll be monitoring. Let&#8217;s create a new template for linux boxes.<br />
edit <em>/usr/local/nagios/etc/objects/templates.cfg</em> and add the following lines,</p>
<blockquote><p>define host{<br />
name                  linux-box             ; Name of this template<br />
use                   generic-host          ; Inherit default values<br />
check_period          24&#215;7<br />
check_interval        5<br />
retry_interval        1<br />
max_check_attempts    10<br />
check_command         check-host-alive<br />
notification_period   24&#215;7<br />
notification_interval 30<br />
notification_options  d,r<br />
contact_groups        admins<br />
register              0 ; DONT REGISTER THIS &#8211; ITS A TEMPLATE<br />
}</p></blockquote>
<p>Notice that the linux-box template definition is inheriting default values from the generic-host template, which is defined in the localhost.cfg file.</p>
<p>Next, define a new host for the remote Linux/Unix box that references the newly created linux-box host template.<br />
For this edit<em> /usr/local/nagios/etc/objects/remotehost.cfg</em></p>
<blockquote><p>define host{<br />
use       linux-box  ; Inherit default values from a template<br />
host_name remotehost  ; The name we&#8217;re giving to this server<br />
address   192.168.0.1  ; IP address of the server<br />
check_command check-host-alive<br />
}</p></blockquote>
<p>Then define contact name and contact goup name in same file</p>
<blockquote><p>define contact{<br />
contact_name clientcontact<br />
host_name remote_host<br />
use generic-contact<br />
alias Nagios client<br />
email remotehost@gmail.com<br />
}<br />
define contactgroup{<br />
contactgroup_name groupname<br />
host_name remote_host<br />
alias Nagios group<br />
members clientcontact,membersof remote_host<br />
}</p></blockquote>
<p>Now define some services to monitor the remote Linux/Unix box. These service definitions will use the commands that have been defined in the nrpe.cfg file in the remote host.</p>
<p>The following service will monitor the CPU load in the remote host. The &#8220;check_load&#8221; argument that is passed to the check_nrpe command definition tells the NRPE daemon to run the &#8220;check_load&#8221; command as defined in the nrpe.cfg file.</p>
<blockquote><p>define service{<br />
use                 generic-service<br />
host_name           remotehost<br />
service_description CPU Load<br />
check_command       check_nrpe!check_load<br />
}</p></blockquote>
<p>The following service will monitor the the number of currently logged-in users in the remote host.</p>
<blockquote><p>define service{<br />
use                         generic-service<br />
host_name                   remotehost<br />
service_description         Current Users<br />
check_command               check_nrpe!check_users<br />
}</p></blockquote>
<p>The following service will monitor the free drive space on /dev/hda1 in the remote host.</p>
<blockquote><p>define service{<br />
use                         generic-service<br />
host_name                   remotehost<br />
service_description         /dev/hda1 Free Space<br />
check_command               check_nrpe!check_hda1<br />
}</p></blockquote>
<p>The following service will monitor the total number of processes in the remote host.</p>
<blockquote><p>define service{<br />
use                        generic-service<br />
host_name                  remotehost<br />
service_description        Total Processes<br />
check_command              check_nrpe!check_total_procs<br />
}</p></blockquote>
<blockquote><p>The following service will monitor the number of zombie processes in the remote host.</p>
<p>define service{<br />
use                        generic-service<br />
host_name                  remotehost<br />
service_description        Zombie Processes<br />
check_command              check_nrpe!check_zombie_procs<br />
}</p></blockquote>
<p>The following service will monitor http status in the remote host.</p>
<blockquote><p>define service{<br />
use generic-service<br />
host_name remote_host<br />
service_description HyperVM<br />
check_command check_nrpe!check_http<br />
}</p></blockquote>
<p><em>Restarting Nagios</em>:</p>
<p>Verify your Nagios configuration files.</p>
<blockquote><p>/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg</p></blockquote>
<p>If there are errors, fix them. If everything is fine, restart Nagios.</p>
<blockquote><p>service nagios restart</p></blockquote>
<p><em>Remote Host Configuration</em>:</p>
<p>Edit the nrpe configuration file and add the folowing lines:</p>
<blockquote><p>vi /usr/local/nagios/etc/nrpe.cfg<br />
command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10<br />
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20<br />
command[check_hda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1<br />
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z<br />
command[check_http]=/usr/local/nagios/libexec/check_http -H 127.0.0.1 -w 5 -c 10</p></blockquote>
<p><em>Restart the nrpe: </em></p>
<blockquote><p>/etc/init.d/nrpe restart</p></blockquote>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Monitoring+with+Nagios+and+NRPE+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F131" 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=Monitoring+with+Nagios+and+NRPE+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F131" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/05/monitoring-with-nagios-and-nrpe/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Some of my favorite quotations on Linux,Unix and Open Source philosophy</title>
		<link>http://www.supportsages.com/blog/2009/04/some-of-my-favorite-quotations-on-linuxunix-and-open-source-philosophy/</link>
		<comments>http://www.supportsages.com/blog/2009/04/some-of-my-favorite-quotations-on-linuxunix-and-open-source-philosophy/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 14:44:56 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Quotations]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=81</guid>
		<description><![CDATA[<blockquote>Unix is extremely user friendly. It also happens to be extremely selective when picking its friends</blockquote>
Isn't it ? That could be the reason why many don't like it. Linux don't want to be friends with them.
<blockquote>Knowledge isn't anybody's private property</blockquote>
and we value that. We share whatever we know and also encourage all our staff to do so.
<blockquote>If I am not for myself, who will be for me?
If I am only for myself, what am I?
If not now, when?</blockquote>
Closed source should die!
<blockquote>Avoid the Gates of Hell. Use Linux</blockquote>
You don't have to tell us that!!!
<blockquote>No fences, No Gates!</blockquote>
World is free!!
<blockquote>For the brave, ...]]></description>
			<content:encoded><![CDATA[<blockquote><p>Unix is extremely user friendly. It also happens to be extremely selective when picking its friends</p></blockquote>
<p>Isn&#8217;t it ? That could be the reason why many don&#8217;t like it. Linux don&#8217;t want to be friends with them.</p>
<blockquote><p>Knowledge isn&#8217;t anybody&#8217;s private property</p></blockquote>
<p>and we value that. We share whatever we know and also encourage all our staff to do so.</p>
<blockquote><p>If I am not for myself, who will be for me?<br />
If I am only for myself, what am I?<br />
If not now, when?</p></blockquote>
<p>Closed source should die!</p>
<blockquote><p>Avoid the Gates of Hell. Use Linux</p></blockquote>
<p>You don&#8217;t have to tell us that!!!</p>
<blockquote><p>No fences, No Gates!</p></blockquote>
<p>World is free!!</p>
<blockquote><p>For the brave, there is a door named Linux to success. For the rest there are windows.</p></blockquote>
<blockquote><p>Really, I&#8217;m not out to destroy Microsoft. That will just be a completely unintentional side effect.</p></blockquote>
<blockquote><p>Intelligence is the ability to avoid doing work, yet getting the work done.</p></blockquote>
<blockquote><p>Software is like Sex, It&#8217;s better when it is FREE</p></blockquote>
<blockquote><p>Make using your computer a joy and not a hell loaded with tons of viruses and spyware.</p></blockquote>
<blockquote><p>People aren&#8217;t as dumb as Microsoft needs them to be and that&#8217;s our success.</p></blockquote>
<blockquote><p>To mess up a Linux box, you need to work at it; to mess up your Windows box, you just have to work on it.</p></blockquote>
<blockquote><p>Windows is a bonfire, Linux is the sun. Linux only looks smaller if you lack perspective</p></blockquote>
<blockquote><p>Teamwork is essential &#8212; it allows you to blame someone else.</p></blockquote>
<blockquote><p>If Linux doesn&#8217;t have the solution, you have the wrong problem</p></blockquote>
<p>Or you don&#8217;t know Linux.</p>
<blockquote><p>Programming is like sex&#8230; make one mistake, and support it the rest of your life</p></blockquote>
<blockquote><p>Microsoft and Apple make the easy things very easy and the hard things impossible. BSDs and Linux make the easy things challenging and the hard things difficult but possible</p></blockquote>
<blockquote><p>Linux is for people who want to know why it works.<br />
Mac is for people who don&#8217;t want to know why it works.<br />
DOS is for people who want to know why it does not work.<br />
Windows is for people who don&#8217;t want to know why it does not work.</p></blockquote>
<blockquote><p>A Windows user spends 1/3 of his life sleeping, 1/3 working, 1/3 waiting</p></blockquote>
<blockquote><p>Linux means productivity and fun. NT means &#8216;Not Today&#8217;.</p></blockquote>
<blockquote><p>Love is Hate. War is Peace. Windows is stable.</p></blockquote>
<blockquote><p>&#8220;Unix is simple, but it takes a genius to understand the simplicity.&#8221; &#8211; Dennis Ritchie</p></blockquote>
<blockquote><p>Unix is the answer, but only if you phrase the question very carefully.</p></blockquote>
<blockquote><p>&#8220;&#8230;Unix, MS-DOS, and Windows NT (also known as the Good, the Bad, and the Ugly).&#8221;</p></blockquote>
<blockquote><p>When you open Windows&#8230;BUGS GET IN!!!</p></blockquote>
<blockquote><p>Windows isn&#8217;t a virus, viruses do something.</p></blockquote>
<blockquote><p>Use Linux: because a PC is a terrible thing to waste</p></blockquote>
<blockquote><p>&#8220;The box said that I needed to have Windows 98 or better&#8230; so I installed Linux&#8221;</p></blockquote>
<blockquote><p>Operating systems are like underwear. nobody really wants to look at them.</p></blockquote>
<blockquote><p>I&#8217;m not one of those who think Bill Gates is the devil. I simply suspect that if Microsoft ever met up with the devil, it wouldn&#8217;t need an interpreter.</p></blockquote>
<blockquote><p>No, I will not fix your computer again. USE LINUX</p></blockquote>
<p>- I used to say it in my college <img src='http://www.supportsages.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> </p>
<blockquote><p>LINUX &#8211; The Best Things In Life Are Free</p></blockquote>
<blockquote><p>REAL MEN USE LINUX</p></blockquote>
<blockquote><p>Geek by birth, Linux by choice</p></blockquote>
<blockquote><p>Linux &#8211; Because I am better than you</p></blockquote>
<blockquote><p>Open Windows and see the world!! Open Linux and create your own world!!</p></blockquote>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Some+of+my+favorite+quotations+on+Linux%2CUnix+and+Open+Source+philosophy+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F81" 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=Some+of+my+favorite+quotations+on+Linux%2CUnix+and+Open+Source+philosophy+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F81" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/04/some-of-my-favorite-quotations-on-linuxunix-and-open-source-philosophy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why are you getting 500 internal server error on your php pages</title>
		<link>http://www.supportsages.com/blog/2009/04/why-are-you-getting-500-internal-server-error-on-your-php-pages/</link>
		<comments>http://www.supportsages.com/blog/2009/04/why-are-you-getting-500-internal-server-error-on-your-php-pages/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 14:39:23 +0000</pubDate>
		<dc:creator>George</dc:creator>
				<category><![CDATA[cPanel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Plesk]]></category>
		<category><![CDATA[500 ISE]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[suPHP]]></category>

		<guid isPermaLink="false">http://www.supportsages.com/blog/?p=85</guid>
		<description><![CDATA[Usually this happens in a suPHP environment. There could be few reasons why this could happen. We list here a few. The solution is intended for those with shell access.
<ul>
	<li><strong>Ownership issues</strong>
In a suPHP environment, depending on the mode of suPHP enabled on the VPS or server, there is a min_uid setting, which is configurable in suPHP.conf under /etc or /usr/local/etc or /opt/suphp/etc . By default the setting is 100, which means if the file is owned by a UID less than that value (100), it shouldn't parse the php code and will result in 500 Internal Server Error. In a ...]]></description>
			<content:encoded><![CDATA[<p>Usually this happens in a suPHP environment. There could be few reasons why this could happen. We list here a few. The solution is intended for those with shell access.</p>
<ul>
<li><strong>Ownership issues</strong><br />
In a suPHP environment, depending on the mode of suPHP enabled on the VPS or server, there is a min_uid setting, which is configurable in suPHP.conf under /etc or /usr/local/etc or /opt/suphp/etc . By default the setting is 100, which means if the file is owned by a UID less than that value (100), it shouldn&#8217;t parse the php code and will result in 500 Internal Server Error. In a cPanel server, the error will be shown @ /usr/local/apache/logs/suphp.log. This restriction would enable better security, since even if a php can do some privilege escalation, it wont affect the server. Solution would be</p>
<blockquote><p>chown your_username.your_username path_of_your_php_file</p></blockquote>
<p>If that fixes only that file and not your entire php files, use the below command to change all the php files.</p>
<blockquote><p>find . -type f -name &#8220;*.php&#8221; -exec chown username.username {} \;<br />
find . -type d -exec chown username.username {} \;</p></blockquote>
<p>Ignore &#8220;*.php&#8221; in the above command if it still errors out for a php file. If it still don&#8217;t fix, move on to other solutions below.</li>
<li><strong>Permission issues</strong><br />
It could be the world writable directories or files which is causing the issue. In a non-suphp environment, if a php script has to upload a file on a folder, (eg:  php based gallery script where customers are able to upload photos) inorder to get it uploaded to the folder, it needs to have world writable permissions. Or else apache can&#8217;t write to the folder. Here in suPHP, since the php is executed as the user itself who already have the permissions you don&#8217;t need to change it to 777 permissions and is happy with 755 (rwxr-xr-x) permissions. When a customer is moved from a non suPHP env to suPHP enabled server, we need to adjust the permissions then. Often a command like below should help</p>
<blockquote><p>find . -name &#8220;*.php&#8221; -type f -exec chmod 644 {} \;<br />
find . -type d -exec chmod 755 {} \;</p></blockquote>
<p>Often, you can do the above command without the -name &#8220;*.php&#8221; in the command.</li>
<li><strong>suphp.log exceeds 2GB size.</strong>If the entire servers&#8217; php application gives you internal server error, next chance is that the suPHP log has exceeded 2GB space. Just clear the file and you are on track again. To null it, execute the command below. Below command assumes you are having the issue in a cPanel server<br />
<blockquote><p>cat /dev/null &gt; /usr/local/apache/logs/error_log</p></blockquote>
</li>
<li><strong>suPHP log don&#8217;t exist </strong><br />
In a Plesk or Webmin or other servers, often the suPHP will be installed but /var/log/httpd or such folders where the suPHP.log can be created wont exist. suphp can understand and create a non-existent suphp.log, but you would need to manually create the folder /var/log/httpd. I hope you know how to create a folder though.</li>
<p>If you know any other cases which require another solution for this, please comment here or edit the blog.</ul>
<div class="tweetthis" style="text-align:left;"><p> <a  class="tt" href="http://twitter.com/home/?status=Why+are+you+getting+500+internal+server+error+on+your+php+pages+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F85" 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=Why+are+you+getting+500+internal+server+error+on+your+php+pages+http%3A%2F%2Fwww.supportsages.com%2Fblog%2F85" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.supportsages.com/blog/2009/04/why-are-you-getting-500-internal-server-error-on-your-php-pages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

