<?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"
	>

<channel>
	<title>Saiweb</title>
	<atom:link href="http://www.saiweb.co.uk/feed" rel="self" type="application/rss+xml" />
	<link>http://www.saiweb.co.uk</link>
	<description>Ramblings of a Sys admin</description>
	<pubDate>Mon, 17 Nov 2008 11:02:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Saiweb Update - What do you want to see?</title>
		<link>http://www.saiweb.co.uk/general/saiweb-update-what-do-you-want-to-see</link>
		<comments>http://www.saiweb.co.uk/general/saiweb-update-what-do-you-want-to-see#comments</comments>
		<pubDate>Mon, 17 Nov 2008 10:08:20 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[saiweb]]></category>

		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/general/saiweb-update-what-do-you-want-to-see</guid>
		<description><![CDATA[Well the giant banner at the top of the blog can&#8217;t of escaped your attention, and I still need your votes! so please check out the blog entry for IT Super Hero 2008
For those awaiting the &#8216;Build your own HD youtube&#8217; series completion, I have a dedi server en route, to allow completion of this [...]]]></description>
			<content:encoded><![CDATA[<p>Well the giant banner at the top of the blog can&#8217;t of escaped your attention, and I still need your votes! so please check out the blog entry for <a href="http://www.saiweb.co.uk/general/vote-buzz-for-it-superhero-2008">IT Super Hero 2008</a></p>
<p>For those awaiting the &#8216;Build your own HD youtube&#8217; series completion, I have a dedi server en route, to allow completion of this series.</p>
<p>&#8220;Dell Core 330 v2 - Core2Duo E4600 (2&#215;2.4GHz) 1GB RAM 160GB HDD&#8221;</p>
<p>CentOS 64bit, from what I have read the cpu uses Intels EMT, which is realy only about 48bits &#8230; but neither here or there at the moment, this is coming from the guy&#8217;s at <a href="http://www.ukfast.co.uk/">UkFast</a>.</p>
<p>So with the new dev server on the way the question is &#8230; what do you want to see?</p>
<p>What tutorials / videos would you be of intrest to you?</p>
<p>Post a comment with suggestions, and just so you are aware comments are on moderation due to the couple of thousand spam comments posted every day <img src='http://www.saiweb.co.uk/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> &#8230; so don&#8217;t worry if your comment doesn&#8217;t appear right away it&#8217;s just waiting for me to review it.</p>
<p>Cheers</p>
<p>Buzz</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.saiweb.co.uk%2Fgeneral%2Fsaiweb-update-what-do-you-want-to-see';
  addthis_title  = 'Saiweb+Update+-+What+do+you+want+to+see%3F';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/general/saiweb-update-what-do-you-want-to-see/feed</wfw:commentRss>
		</item>
		<item>
		<title>Optimizing Apache for high load sites - Part 3</title>
		<link>http://www.saiweb.co.uk/linux/optimizing-apache-for-high-load-sites-part-3</link>
		<comments>http://www.saiweb.co.uk/linux/optimizing-apache-for-high-load-sites-part-3#comments</comments>
		<pubDate>Fri, 14 Nov 2008 11:11:03 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[optimize]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/linux/optimizing-apache-for-high-load-sites-part-3</guid>
		<description><![CDATA[Pulling it all together.
In Part 1
I covered the use of pmap to provide an insight into the memory footprint of the apache service.
In Part 2
I covered a list modules that are typically enabled in a standard httpd/apache setup, and listed which modules I was disabling to reduce the memory foot print.
After improving the appmem script [...]]]></description>
			<content:encoded><![CDATA[<p><b>Pulling it all together.</b></p>
<p>In <a href="http://www.saiweb.co.uk/linux/optimizing-apache-for-high-load-sites-part-1">Part 1</a></p>
<p>I covered the use of pmap to provide an insight into the memory footprint of the apache service.</p>
<p>In <a href="http://www.saiweb.co.uk/linux/optimizing-apache-for-high-load-sites-part-2">Part 2</a></p>
<p>I covered a list modules that are typically enabled in a standard httpd/apache setup, and listed which modules I was disabling to reduce the memory foot print.</p>
<p>After improving the appmem script in <a href="http://www.saiweb.co.uk/uncategorized/linux-the-sysadmin-script-part-4">Part 4 of the linux sysadmin script</a> I updated part 3 of this series with the new memory foot print figures.</p>
<p>Summary aside, now we have reduced the memory footprint of your apache installation lets go onto actually making the most of your new found memory excess ..&#8217;potential&#8217; max clients.</p>
<p>As stated in part 3 of this series, I am assuming the server you are making these configuration changes is a dedicated apache server.</p>
<p>However you also need to be aware of your CGI programs such as PHP, if you are to configure PHP with a maximum memory of 32MB, you must be aware that there is the potential for PHP to try to use this much memory on each allocation, this is where &#8220;optimizing PHP gor high load sites&#8221; comes into play, a furture series I plan to write, for the time being however I am only covering the configuration of apache.</p>
<p>Your httpd.conf should have the following entries (or similar).</p>
<p><code><br />
# prefork MPM<br />
# StartServers: number of server processes to start<br />
# MinSpareServers: minimum number of server processes which are kept spare<br />
# MaxSpareServers: maximum number of server processes which are kept spare<br />
# ServerLimit: maximum value for MaxClients for the lifetime of the server<br />
# MaxClients: maximum number of server processes allowed to start<br />
# MaxRequestsPerChild: maximum number of requests a server process serves<br />
<IfModule prefork.c><br />
StartServers       8<br />
MinSpareServers    5<br />
MaxSpareServers   20<br />
ServerLimit      256<br />
MaxClients       256<br />
MaxRequestsPerChild  4000<br />
</IfModule><br />
# worker MPM<br />
# StartServers: initial number of server processes to start<br />
# MaxClients: maximum number of simultaneous client connections<br />
# MinSpareThreads: minimum number of worker threads which are kept spare<br />
# MaxSpareThreads: maximum number of worker threads which are kept spare<br />
# ThreadsPerChild: constant number of worker threads in each server process<br />
# MaxRequestsPerChild: maximum number of requests a server process serves<br />
<IfModule worker.c><br />
StartServers         2<br />
MaxClients         150<br />
MinSpareThreads     25<br />
MaxSpareThreads     75<br />
ThreadsPerChild     25<br />
MaxRequestsPerChild  0<br />
</IfModule><br />
</code></p>
<p><code><br />
[buzz@buzz_srv ~]httpd -l<br />
Compiled in modules:<br />
  core.c<br />
  prefork.c<br />
  http_core.c<br />
  mod_so.c<br />
</code></p>
<p>As can be seen above in my installation the part of the config I am interested in is prefork.c.</p>
<p>Now with my theorehtical max clients in part 3 hitting 800.5, lets first go for a safer figure, say 60% </p>
<p><code><br />
<IfModule prefork.c><br />
StartServers       8<br />
MinSpareServers    5<br />
MaxSpareServers   20<br />
ServerLimit      480<br />
MaxClients       480<br />
MaxRequestsPerChild  4000<br />
</IfModule><br />
</code></p>
<p>From here use the script in <a href="http://www.saiweb.co.uk/linux/linux-the-sysadmin-script-part-1">part 1 of the Linux sysadmin script</a>, to monitor your active http connections, and &#8216;tweak&#8217; your configuration accordingly.</p>
<p>Remember you must only set the MaxClients and ServerLimit to a value you can safely contain in ram, swapping out to disk will cause a major slow down.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.saiweb.co.uk%2Flinux%2Foptimizing-apache-for-high-load-sites-part-3';
  addthis_title  = 'Optimizing+Apache+for+high+load+sites+-+Part+3';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/linux/optimizing-apache-for-high-load-sites-part-3/feed</wfw:commentRss>
		</item>
		<item>
		<title>Linux - The Sysadmin Script - Part 4</title>
		<link>http://www.saiweb.co.uk/linux/linux-the-sysadmin-script-part-4</link>
		<comments>http://www.saiweb.co.uk/linux/linux-the-sysadmin-script-part-4#comments</comments>
		<pubDate>Fri, 14 Nov 2008 09:31:23 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
		
		<category><![CDATA[Bash Script]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/uncategorized/linux-the-sysadmin-script-part-4</guid>
		<description><![CDATA[In part 4, I am going to cover more of an improvement than anything else to part 3
Part 3 itself is not incorrect, it correctly takes a memory footprint for each process running, the same as VIRT in top &#8230;
However in processes such as APACHE the VIRT memory is the size of all shared libraries, [...]]]></description>
			<content:encoded><![CDATA[<p>In part 4, I am going to cover more of an improvement than anything else to <a href="http://www.saiweb.co.uk/linux/linux-the-sysadmin-script-part-3">part 3</a></p>
<p>Part 3 itself is not incorrect, it correctly takes a memory footprint for each process running, the same as VIRT in top &#8230;</p>
<p>However in processes such as APACHE the VIRT memory is the size of all shared libraries, as correctly shown by pmap &#8230;</p>
<p>So what does this mean realy?</p>
<p>The memory usage is infact the following VIRT + RSS, where RSS is the resident set size, the RSS is a representation of the memory in use by the PID, and VIRT is shared between the child processes.</p>
<p><code><br />
[buzz@buzz_srv ~]# ps aux | grep httpd | grep -v &#8216;grep&#8217;<br />
root     16378  0.0  0.1 148640  3024 ?        Ss   Nov13   0:00 /usr/sbin/httpd<br />
apache   20088  0.0  0.1 148640  3304 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
apache   20101  0.0  0.1 148640  3304 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
apache   20756  0.0  0.1 148640  3312 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
apache   20759  0.0  0.1 148640  3300 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
apache   20790  0.0  0.1 148640  3284 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
apache   20792  0.0  0.1 148640  3312 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
apache   20798  0.0  0.1 148640  3308 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
apache   20804  0.0  0.1 148640  3308 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
apache   20886  0.0  0.1 148640  3304 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
apache   20906  0.0  0.1 148640  3300 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
apache   20907  0.0  0.1 148640  3308 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
apache   20912  0.0  0.1 148640  3304 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
apache   20915  0.0  0.1 148640  3312 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
apache   20959  0.0  0.1 148640  3304 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
apache   20969  0.0  0.1 148640  3300 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
apache   20994  0.0  0.1 148640  3320 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
apache   20995  0.0  0.1 148640  3288 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
apache   20996  0.0  0.1 148640  3320 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
apache   20997  0.0  0.1 148640  3320 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
apache   20999  0.0  0.1 148640  3296 ?        S    Nov13   0:00 /usr/sbin/httpd<br />
</code></p>
<p>As can be seen above the &#8216;VIRT&#8217; does not change between the child processes, where as the RSS does dependant on what the thread is doing at that time.</p>
<p>So below is an improved appmem function to allow for this:</p>
<p><code><br />
function appmem {<br />
        if [ -z "$1" ]; then<br />
                echo &#8220;Usage: sysadmin appmem app_name i.e. (sysadmin appmem apache)&#8221;;<br />
        else<br />
                RRES=(`ps aux | grep &#8220;$1&#8243; | grep -v &#8216;grep&#8217; | grep -v &#8220;$0&#8243; | awk &#8216;{print $6}&#8217;`);<br />
                VRES=(`ps aux | grep &#8220;$1&#8243; | grep -v &#8216;grep&#8217; | grep -v &#8220;$0&#8243; | awk &#8216;{print $5}&#8217;`);<br />
                COUNT=0;<br />
                VMEM=0;<br />
                RMEM=0;<br />
                for RSS in ${RRES[@]}<br />
                do<br />
                        RMEM=$(($RSS+$RMEM));<br />
                done;<br />
                for VIRT in ${VRES[@]}<br />
                do<br />
                        VMEM=$(($VIRT+$VMEM));<br />
                        COUNT=$(($COUNT+1));<br />
                done;<br />
                VMEM=$(($VMEM/$COUNT));<br />
                VMEM=$(($VMEM/1024));<br />
                RMEM=$(($RMEM/1024));<br />
                echo -e &#8220;$YELLOW &#8212;&#8211; MEMORY USAGE REPORT FOR &#8216;$1&#8242; &#8212;&#8211; $CLEAR&#8221;;<br />
                echo &#8220;PID Count: $COUNT&#8221;;<br />
                echo &#8220;Shared Mem usage: $VMEM MB&#8221;;<br />
                echo &#8220;Total Resident Set Size: $RMEM MB&#8221;;<br />
                echo &#8220;Mem/PID: $(($RMEM/$COUNT)) MB&#8221;;<br />
        fi<br />
}<br />
</code></p>
<p>Example output:</p>
<p><code><br />
 ----- MEMORY USAGE REPORT FOR 'httpd' -----<br />
PID Count: 41<br />
Shared Mem usage: 140 MB<br />
Total Resident Set Site: 95 MB<br />
Mem/PID: 2 MB<br />
</code></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.saiweb.co.uk%2Flinux%2Flinux-the-sysadmin-script-part-4';
  addthis_title  = 'Linux+-+The+Sysadmin+Script+-+Part+4';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/linux/linux-the-sysadmin-script-part-4/feed</wfw:commentRss>
		</item>
		<item>
		<title>Optimizing Apache for high load sites - Part 2</title>
		<link>http://www.saiweb.co.uk/linux/optimizing-apache-for-high-load-sites-part-2</link>
		<comments>http://www.saiweb.co.uk/linux/optimizing-apache-for-high-load-sites-part-2#comments</comments>
		<pubDate>Thu, 13 Nov 2008 15:38:45 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[optimize]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/?p=274</guid>
		<description><![CDATA[This is going to be quite an extension from what I had planned, instead of providing just a list of results post optimization I am going to provide a basic list of modules loaded as part of a basic apache install, and provide a description for each, the ones I have disabled are mods I [...]]]></description>
			<content:encoded><![CDATA[<p>This is going to be quite an extension from what I had planned, instead of providing just a list of results post optimization I am going to provide a basic list of modules loaded as part of a basic apache install, and provide a description for each, the ones I have disabled are mods I have deemed not required for my purposes, use your own best judgment before switching things off&#8230;</p>
<ul>
<li>LoadModule auth_basic_module modules/mod_auth_basic.so</li>
</ul>
<p>ENABLED: User authentication for access control using 	    HTTP basic authentication (.htaccess and .htpasswd)</p>
<ul>
<li> LoadModule auth_digest_module modules/mod_auth_digest.so</li>
</ul>
<p>ENABLED: Similar to <span class="systemitem">auth_basic_module</span> but instead 	    of using a plain text authentication scheme, it uses a 	    cryptographic one. (MD5 etc &#8230;)</p>
<ul>
<li> LoadModule authn_file_module modules/mod_authn_file.so</li>
</ul>
<p>ENABLED: Allows authentication front-ends such as 	    auth_digest_module and auth_basic_module to authenticate 	    users by looking up users in plain text password 	    files. This function was previously part of <span class="systemitem">auth_module</span> and <span class="systemitem">auth_digest_module</span>.</p>
<ul>
<li> LoadModule authn_alias_module modules/mod_authn_alias.so</li>
</ul>
<p>DISABLED: Allows extended authentication providers to 	    be created within the configuration file and assigned an 	    alias name.</p>
<ul>
<li> LoadModule authn_anon_module modules/mod_authn_anon.so</li>
</ul>
<p>DISABLED: Allows anonymous user access and logs the 	    password given. Previously known as<span class="systemitem">auth_anon_module</span>.</p>
<ul>
<li> LoadModule authn_dbm_module modules/mod_authn_dbm.so</li>
</ul>
<p>DISABLED: Allows authentication front-ends such as 	    auth_digest_module and auth_basic_module to authenticate 	    users by looking up users in dbm password 	    files. Previously known as<span class="systemitem">auth_dbm_module</span>.</p>
<ul>
<li> LoadModule authn_default_module modules/mod_authn_default.so</li>
</ul>
<p>DISABLED: Fallback authentication module - it simply 	    rejects any credentials supplied by the 	    user</p>
<ul>
<li>LoadModule authz_host_module modules/mod_authz_host.so</li>
</ul>
<p>ENABLED: Access control by browser 	    hostname. Previously known as<span class="systemitem">access_module</span>.</p>
<ul>
<li>LoadModule authz_user_module modules/mod_authz_user.so</li>
</ul>
<p>DISABLED: Provides authorization capabilities so that 	    authenticated users can be allowed or denied access to 	    portions of the web site.  This function was previously 	    part of <span class="systemitem">auth_module</span>.</p>
<ul>
<li> LoadModule authz_owner_module modules/mod_authz_owner.so</li>
</ul>
<p>DISABLED: Authorization based on file 	    ownership.</p>
<ul>
<li> LoadModule authz_groupfile_module modules/mod_authz_groupfile.so</li>
</ul>
<p>DISABLED: Group authorization using plaintext 	    files. This function was previously part of <span class="systemitem">auth_module</span>.</p>
<ul>
<li> LoadModule authz_dbm_module modules/mod_authz_dbm.so</li>
</ul>
<p>DISABLED: Group authorization using DBM 	    files. This function was previously part of <span class="systemitem">auth_dbm_module</span>.</p>
<ul>
<li> LoadModule authz_default_module modules/mod_authz_default.so</li>
</ul>
<p>DISABLED: Fallback authorisation module - it simply 	    rejects any authorization request.</p>
<ul>
<li> LoadModule ldap_module modules/mod_ldap.so</li>
</ul>
<p>DISABLED: LDAP connection pooling and result caching 	    services for use by other LDAP modules.</p>
<p>(I don&#8217;t use LDAP, if you use apache interaction with ldap keep this module, if you use LDAP within PHP you can turn this mod off!)</p>
<ul>
<li> LoadModule authnz_ldap_module modules/mod_authnz_ldap.so</li>
</ul>
<p>DISABLED: Allows authentication front-ends such as 	    auth_basic_module to authenticate users through an ldap 	    directory. Previously known as<span class="systemitem">auth_ldap_module</span>. (same as above)</p>
<ul>
<li> LoadModule include_module modules/mod_include.so</li>
</ul>
<p>DISABLED: Server-side includes.</p>
<ul>
<li> LoadModule log_config_module modules/mod_log_config.so</li>
</ul>
<p>ENABLED: Configurable logging of requests and 	    reponses.</p>
<ul>
<li> LoadModule logio_module modules/mod_logio.so</li>
</ul>
<p>ENABLED: Logging of input and output bytes per 	    request.</p>
<ul>
<li> LoadModule env_module modules/mod_env.so</li>
</ul>
<p>DISABLED: Changes the environment that CGI program are 	    run in.</p>
<ul>
<li> LoadModule ext_filter_module modules/mod_ext_filter.so</li>
</ul>
<p>ENABLED: Pass the response body through an external 	    program before delivery to the client (i&#8217;m using mods like gzip compression, disalbe this if you don&#8217;t need it).</p>
<ul>
<li> LoadModule mime_magic_module modules/mod_mime_magic.so</li>
</ul>
<p>ENABLED: Determines MIME types based on file 	    contents. (Great for directly serving download easily).</p>
<ul>
<li> LoadModule expires_module modules/mod_expires.so</li>
</ul>
<p>ENABLED: Autogenerates the <span class="systemitem">Expires:</span> header according to 	    user rules.</p>
<ul>
<li> LoadModule deflate_module modules/mod_deflate.so</li>
</ul>
<p>ENABLED: Compress content prior to serving 	    it. (If you don&#8217;t have compression configured for your websites disable this mod).</p>
<ul>
<li> LoadModule headers_module modules/mod_headers.so</li>
</ul>
<p>ENABLED: More general control of HTTP 	    headers. (You can disable this if you do not want to handle bespoke HTTP headers)</p>
<ul>
<li> LoadModule usertrack_module modules/mod_usertrack.so</li>
</ul>
<p>DISABLED: Provision of cookies. (I am using PHP to handle cookies).</p>
<ul>
<li>LoadModule setenvif_module modules/mod_setenvif.so</li>
</ul>
<p>ENABLED: Sets the environment for CGI programs based 	    on properties of the request.</p>
<ul>
<li> LoadModule mime_module modules/mod_mime.so</li>
</ul>
<p>ENABLED: Determines MIME types based on file 	    names.</p>
<ul>
<li> LoadModule dav_module modules/mod_dav.so</li>
</ul>
<p>DISABLED: Distributed Authoring and Versioning 	    functionality. (This is a webserver not serving a versioning system).</p>
<ul>
<li> LoadModule status_module modules/mod_status.so</li>
</ul>
<p>ENABLED: Provides information about the server&#8217;s 	    current status via a web request. (If you don&#8217;t have this set in your httpd.conf then disable the mod, I use this for apache monitoring).</p>
<ul>
<li> LoadModule autoindex_module modules/mod_autoindex.so</li>
</ul>
<p>ENADLED: Automatically picks the index file when browsing to a folder, (index.html, index.php etc ..)</p>
<ul>
<li> LoadModule info_module modules/mod_info.so</li>
</ul>
<p>DISABLED: Similar to a php info call, provides running configuration information about the apache server.</p>
<ul>
<li> LoadModule dav_fs_module modules/mod_dav_fs.so</li>
</ul>
<p>DISABLED: More no required D.A.V</p>
<ul>
<li> LoadModule vhost_alias_module modules/mod_vhost_alias.so</li>
</ul>
<p>ENABLED: Allows for handling enormous numbers of 	    virtual hosts without having to change the configuration 	    each time.</p>
<ul>
<li> LoadModule negotiation_module modules/mod_negotiation.so</li>
</ul>
<p>ENABLED: Provides for content negotiation between 	    server and client. (Accept encoding etc&#8230;)</p>
<ul>
<li> LoadModule dir_module modules/mod_dir.so</li>
</ul>
<p>ENABLED: Supports the use of 	    <tt class="filename">index.html</tt> files for directory 	    lookups.</p>
<ul>
<li> LoadModule actions_module modules/mod_actions.so</li>
</ul>
<p>ENABLED: Run specific CGI programs according to the 	    MIME content type of the object served.</p>
<ul>
<li> LoadModule speling_module modules/mod_speling.so</li>
</ul>
<p>ENABLED: Attempts to correct misspelled 	    URLs. (Ignores case etc..)</p>
<ul>
<li> LoadModule userdir_module modules/mod_userdir.so</li>
</ul>
<p>ENABLED: Allow public_html userdir and use of http://servername/~username, I have disabled this as can be used to verify the presence of a valid username to be used in a brute force attack</p>
<ul>
<li> LoadModule alias_module modules/mod_alias.so</li>
</ul>
<p>ENABLED: Override the <strong class="command">DocumentRoot</strong> directive for specific URLs.</p>
<ul>
<li> LoadModule rewrite_module modules/mod_rewrite.so</li>
</ul>
<p>ENABLED: Allows the use of the Rewriteengine to provide SEO friends URL&#8217;s amoungst other things.</p>
<ul>
<li> LoadModule proxy_module modules/mod_proxy.so</li>
</ul>
<p>ENABLED: Lets your web server be a proxy.  Typically 	    it needs additional modules for specific 	    protocols.</p>
<ul>
<li> LoadModule proxy_balancer_module modules/mod_proxy_balancer.so</li>
<li> LoadModule proxy_ftp_module modules/mod_proxy_ftp.so</li>
<li> LoadModule proxy_http_module modules/mod_proxy_http.so</li>
<li> LoadModule proxy_connect_module modules/mod_proxy_connect.so</li>
</ul>
<p>ENABLED: As above, I have need to have apache act as a proxy, in the future</p>
<ul>
<li> LoadModule cache_module modules/mod_cache.so</li>
</ul>
<p>ENABLED: Implements an RFC 2616 compliant HTTP content             cache that can be used to cache either local or proxied             content.</p>
<ul>
<li> LoadModule suexec_module modules/mod_suexec.so</li>
</ul>
<p>ENABLED: Allows CGI scripts to run as a user other 	    than <span class="systemitem">wwwrun</span>.</p>
<ul>
<li> LoadModule disk_cache_module modules/mod_disk_cache.so</li>
<li> LoadModule file_cache_module modules/mod_file_cache.so</li>
<li> LoadModule mem_cache_module modules/mod_mem_cache.so</li>
</ul>
<p>ENABLED: More cache-ing functions (reduces need for disk read time).</p>
<ul>
<li> LoadModule cgi_module modules/mod_cgi.so</li>
</ul>
<p>ENABLED: Run CGI programs</p>
<ul>
<li> LoadModule version_module modules/mod_version.so</li>
</ul>
<p>ENABLED: Version dependent configuration (Can be handy when writing configs to have this enabled).</p>
<p>Source&#8217;s used:</p>
<p>Module information can be found HERE: <a href="http://www-uxsup.csx.cam.ac.uk/~jw35/courses/apache/html/a2617.htm">http://www-uxsup.csx.cam.ac.uk/~jw35/courses/apache/html/a2617.htm</a></p>
<p><code><br />
----- MEMORY USAGE REPORT FOR 'apache' -----<br />
PID Count: 32<br />
Mem usage: 4594 MB<br />
Mem/PID: 143 MB<br />
For more information run: pmap -x 12345<br />
</code></p>
<p><del datetime="2008-11-14T09:34:03+00:00">So 143mb down from 189mb, saving 46mb/thread.</p>
<p>Not much of a saving right? &#8230; well actually wrong.</p>
<p>Take for example a webserver with 2048MB Avail system ram, lets allocate 15% of that for the OS use.</p>
<p>So we have 1741MB to play with, with the original setup of 189mb 9.21 concurrent connections could be active an any one given time.</p>
<p>now however 12.71 concurrent connections can be in memory at any given time (28% increase).</p>
<p>Still a long way to go to bring the memory foot print down to a minimal level, but as you can see spending 5 minutes disabling mod&#8217;s in the config yields a quick win 28% increase in capacity.</del></p>
<p><strong>UPDATE</strong></p>
<p>Following the improvements to the appmem script in <a href="http://www.saiweb.co.uk/uncategorized/linux-the-sysadmin-script-part-4">part 4</a> here are the new figures.</p>
<p>With all mods enabled:</p>
<p><code><br />
 ----- MEMORY USAGE REPORT FOR 'httpd' -----<br />
PID Count: 37<br />
Shared Mem usage: 176 MB<br />
Total Resident Set Size: 112 MB<br />
Mem/PID: 3 MB<br />
</code></p>
<p>Results attained running &#8220;ab -n 1000 -c 100 http://xxx.xxx.xxx.xxx/&#8221;.</p>
<p>Results with disabled mods (listed above):</p>
<p><code><br />
 ----- MEMORY USAGE REPORT FOR 'httpd' -----<br />
PID Count: 41<br />
Shared Mem usage: 140 MB<br />
Total Resident Set Size: 95 MB<br />
Mem/PID: 2 MB<br />
</code></p>
<p>Shared mem down 36MB (20.45% improvement), RSS/PID down 1mb (33% improvement)</p>
<p>Allowing for 1741MB availble ram, means 1601mb (1741MB -140MB shared) is available for apache threads, allowing for 800.5 concurrent connections with the improved config and by comparison</p>
<p>1565 MB Avail for threads (1741MB - 176MB), allowing 521.66 concurrent connections.</p>
<p>So with the improvements outlined above in theory the Apache server can now handle ~280 more concurrent connections.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.saiweb.co.uk%2Flinux%2Foptimizing-apache-for-high-load-sites-part-2';
  addthis_title  = 'Optimizing+Apache+for+high+load+sites+-+Part+2';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/linux/optimizing-apache-for-high-load-sites-part-2/feed</wfw:commentRss>
		</item>
		<item>
		<title>Optimizing apache for high load sites - Part 1</title>
		<link>http://www.saiweb.co.uk/linux/optimizing-apache-for-high-load-sites-part-1</link>
		<comments>http://www.saiweb.co.uk/linux/optimizing-apache-for-high-load-sites-part-1#comments</comments>
		<pubDate>Thu, 13 Nov 2008 12:33:35 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[memory]]></category>

		<category><![CDATA[optimize]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/linux/optimizing-apache-for-high-load-sites-part-1</guid>
		<description><![CDATA[Following on from linux-the-sysadmin-script-part-3 I am now going to cover how to reduce the memory footprint of apache.
So why would you want to reduce the memory footprint?
Simple really so you can have more concurrent connections to the apache server without having to constantly keep adding more memory to your web server.
This &#8216;tutorial&#8217; does assume the [...]]]></description>
			<content:encoded><![CDATA[<p>Following on from <a href="http://www.saiweb.co.uk/linux/linux-the-sysadmin-script-part-3">linux-the-sysadmin-script-part-3</a> I am now going to cover how to reduce the memory footprint of apache.</p>
<p>So why would you want to reduce the memory footprint?</p>
<p>Simple really so you can have more concurrent connections to the apache server without having to constantly keep adding more memory to your web server.</p>
<p>This &#8216;tutorial&#8217; does assume the following:</p>
<ul>
<li>You are running apache on a server dedicated to doing so.</li>
<li>You have a basic understanding of how to install and configure apache.</li>
<li>You have a basic understanding of bash scripting.</li>
<li>You have the pmap package installed on your server.</li>
</ul>
<p>As was introduced in <a href="http://www.saiweb.co.uk/linux/linux-the-sysadmin-script-part-3">part-3</a> the function appmem will report the memory usage of all current running threads of an application name, report the average memory usage, and an example pmap command using the last PID in the list.</p>
<p>This is where this entry will pick up, once pmap is run you will see the following example output:</p>
<p><code><br />
----- MEMORY USAGE REPORT FOR 'apache' -----<br />
PID Count: 6<br />
Mem usage: 1135 MB<br />
Mem/PID: 189 MB<br />
For more information run: pmap -x 25883<br />
------<br />
[buzz@buzz_srv .sysadmin]# pmap -x 25883<br />
25883: /usr/sbin/httpd<br />
Address Kbytes RSS Anon Locked Mode Mapping<br />
00002b777eac8000 308 - - - r-x&#8211; httpd<br />
00002b777eb15000 100 - - - rw-s- zero (deleted)<br />
00002b777eb2e000 88 - - - rw-s- zero (deleted)<br />
00002b777ed14000 16 - - - rw&#8212; httpd<br />
00002b777ed18000 12 - - - rw&#8212; [ anon ]<br />
00002b777ed1b000 104 - - - r-x&#8211; ld-2.5.so<br />
00002b777ed35000 4 - - - rw&#8212; [ anon ]<br />
00002b777ed3f000 4 - - - rw&#8212; [ anon ]<br />
00002b777ef35000 4 - - - r&#8212;- ld-2.5.so<br />
00002b777ef36000 4 - - - rw&#8212; ld-2.5.so<br />
00002b777ef37000 520 - - - r-x&#8211; libm-2.5.so<br />
00002b777efb9000 2044 - - - &#8212;&#8211; libm-2.5.so<br />
00002b777f1b8000 4 - - - r&#8212;- libm-2.5.so<br />
00002b777f1b9000 4 - - - rw&#8212; libm-2.5.so<br />
00002b777f1ba000 108 - - - r-x&#8211; libpcre.so.0.0.1<br />
00002b777f1d5000 2048 - - - &#8212;&#8211; libpcre.so.0.0.1<br />
00002b777f3d5000 4 - - - rw&#8212; libpcre.so.0.0.1<br />
00002b777f3d6000 84 - - - r-x&#8211; libselinux.so.1<br />
00002b777f3eb000 2048 - - - &#8212;&#8211; libselinux.so.1<br />
00002b777f5eb000 8 - - - rw&#8212; libselinux.so.1<br />
00002b777f5ed000 8 - - - rw&#8212; [ anon ]<br />
00002b777f5ef000 112 - - - r-x&#8211; libaprutil-1.so.0.2.7<br />
00002b777f60b000 2044 - - - &#8212;&#8211; libaprutil-1.so.0.2.7<br />
00002b777f80a000 8 - - - rw&#8212; libaprutil-1.so.0.2.7<br />
00002b777f80c000 36 - - - r-x&#8211; libcrypt-2.5.so<br />
00002b777f815000 2044 - - - &#8212;&#8211; libcrypt-2.5.so<br />
00002b777fa14000 4 - - - r&#8212;- libcrypt-2.5.so<br />
00002b777fa15000 4 - - - rw&#8212; libcrypt-2.5.so<br />
00002b777fa16000 184 - - - rw&#8212; [ anon ]<br />
00002b777fa44000 224 - - - r-x&#8211; libldap-2.3.so.0.2.15<br />
00002b777fa7c000 2048 - - - &#8212;&#8211; libldap-2.3.so.0.2.15<br />
00002b777fc7c000 8 - - - rw&#8212; libldap-2.3.so.0.2.15<br />
00002b777fc7e000 4 - - - rw&#8212; [ anon ]<br />
00002b777fc7f000 52 - - - r-x&#8211; liblber-2.3.so.0.2.15<br />
00002b777fc8c000 2048 - - - &#8212;&#8211; liblber-2.3.so.0.2.15<br />
00002b777fe8c000 4 - - - rw&#8212; liblber-2.3.so.0.2.15<br />
00002b777fe8d000 964 - - - r-x&#8211; libdb-4.3.so<br />
00002b777ff7e000 2044 - - - &#8212;&#8211; libdb-4.3.so<br />
00002b778017d000 20 - - - rw&#8212; libdb-4.3.so<br />
00002b7780182000 128 - - - r-x&#8211; libexpat.so.0.5.0<br />
00002b77801a2000 2044 - - - &#8212;&#8211; libexpat.so.0.5.0<br />
00002b77803a1000 12 - - - rw&#8212; libexpat.so.0.5.0<br />
00002b77803a4000 4 - - - rw&#8212; [ anon ]<br />
00002b77803a5000 152 - - - r-x&#8211; libapr-1.so.0.2.7<br />
00002b77803cb000 2048 - - - &#8212;&#8211; libapr-1.so.0.2.7<br />
00002b77805cb000 4 - - - rw&#8212; libapr-1.so.0.2.7<br />
00002b77805cc000 84 - - - r-x&#8211; libpthread-2.5.so<br />
00002b77805e1000 2044 - - - &#8212;&#8211; libpthread-2.5.so<br />
00002b77807e0000 4 - - - r&#8212;- libpthread-2.5.so<br />
00002b77807e1000 4 - - - rw&#8212; libpthread-2.5.so<br />
00002b77807e2000 16 - - - rw&#8212; [ anon ]<br />
00002b77807e6000 8 - - - r-x&#8211; libdl-2.5.so<br />
00002b77807e8000 2048 - - - &#8212;&#8211; libdl-2.5.so<br />
00002b77809e8000 4 - - - r&#8212;- libdl-2.5.so<br />
00002b77809e9000 4 - - - rw&#8212; libdl-2.5.so<br />
00002b77809ea000 4 - - - rw&#8212; [ anon ]<br />
00002b77809eb000 1320 - - - r-x&#8211; libc-2.5.so<br />
00002b7780b35000 2044 - - - &#8212;&#8211; libc-2.5.so<br />
00002b7780d34000 16 - - - r&#8212;- libc-2.5.so<br />
00002b7780d38000 4 - - - rw&#8212; libc-2.5.so<br />
00002b7780d39000 20 - - - rw&#8212; [ anon ]<br />
00002b7780d3e000 236 - - - r-x&#8211; libsepol.so.1<br />
00002b7780d79000 2048 - - - &#8212;&#8211; libsepol.so.1<br />
00002b7780f79000 4 - - - rw&#8212; libsepol.so.1<br />
00002b7780f7a000 40 - - - rw&#8212; [ anon ]<br />
00002b7780f84000 12 - - - r-x&#8211; libuuid.so.1.2<br />
00002b7780f87000 2048 - - - &#8212;&#8211; libuuid.so.1.2<br />
00002b7781187000 4 - - - rw&#8212; libuuid.so.1.2<br />
00002b7781188000 4 - - - rw&#8212; [ anon ]<br />
00002b7781189000 128 - - - r-x&#8211; libpq.so.4.1<br />
00002b77811a9000 2048 - - - &#8212;&#8211; libpq.so.4.1<br />
00002b77813a9000 8 - - - rw&#8212; libpq.so.4.1<br />
00002b77813ab000 352 - - - r-x&#8211; libsqlite3.so.0.8.6<br />
00002b7781403000 2048 - - - &#8212;&#8211; libsqlite3.so.0.8.6<br />
00002b7781603000 8 - - - rw&#8212; libsqlite3.so.0.8.6<br />
00002b7781605000 68 - - - r-x&#8211; libresolv-2.5.so<br />
00002b7781616000 2048 - - - &#8212;&#8211; libresolv-2.5.so<br />
00002b7781816000 4 - - - r&#8212;- libresolv-2.5.so<br />
00002b7781817000 4 - - - rw&#8212; libresolv-2.5.so<br />
00002b7781818000 12 - - - rw&#8212; [ anon ]<br />
00002b778181b000 96 - - - r-x&#8211; libsasl2.so.2.0.22<br />
00002b7781833000 2048 - - - &#8212;&#8211; libsasl2.so.2.0.22<br />
00002b7781a33000 4 - - - rw&#8212; libsasl2.so.2.0.22<br />
00002b7781a34000 268 - - - r-x&#8211; libssl.so.0.9.8b<br />
00002b7781a77000 2048 - - - &#8212;&#8211; libssl.so.0.9.8b<br />
00002b7781c77000 24 - - - rw&#8212; libssl.so.0.9.8b<br />
00002b7781c7d000 1172 - - - r-x&#8211; libcrypto.so.0.9.8b<br />
00002b7781da2000 2048 - - - &#8212;&#8211; libcrypto.so.0.9.8b<br />
00002b7781fa2000 124 - - - rw&#8212; libcrypto.so.0.9.8b<br />
00002b7781fc1000 20 - - - rw&#8212; [ anon ]<br />
00002b7781fc6000 572 - - - r-x&#8211; libkrb5.so.3.3<br />
00002b7782055000 2048 - - - &#8212;&#8211; libkrb5.so.3.3<br />
00002b7782255000 16 - - - rw&#8212; libkrb5.so.3.3<br />
00002b7782259000 84 - - - r-x&#8211; libnsl-2.5.so<br />
00002b778226e000 2044 - - - &#8212;&#8211; libnsl-2.5.so<br />
00002b778246d000 4 - - - r&#8212;- libnsl-2.5.so<br />
00002b778246e000 4 - - - rw&#8212; libnsl-2.5.so<br />
00002b778246f000 12 - - - rw&#8212; [ anon ]<br />
00002b7782472000 176 - - - r-x&#8211; libgssapi_krb5.so.2.2<br />
00002b778249e000 2048 - - - &#8212;&#8211; libgssapi_krb5.so.2.2<br />
00002b778269e000 8 - - - rw&#8212; libgssapi_krb5.so.2.2<br />
00002b77826a0000 8 - - - r-x&#8211; libcom_err.so.2.1<br />
00002b77826a2000 2044 - - - &#8212;&#8211; libcom_err.so.2.1<br />
00002b77828a1000 4 - - - rw&#8212; libcom_err.so.2.1<br />
00002b77828a2000 144 - - - r-x&#8211; libk5crypto.so.3.1<br />
00002b77828c6000 2044 - - - &#8212;&#8211; libk5crypto.so.3.1<br />
00002b7782ac5000 8 - - - rw&#8212; libk5crypto.so.3.1<br />
00002b7782ac7000 4 - - - rw&#8212; [ anon ]<br />
00002b7782ac8000 80 - - - r-x&#8211; libz.so.1.2.3<br />
00002b7782adc000 2044 - - - &#8212;&#8211; libz.so.1.2.3<br />
00002b7782cdb000 4 - - - rw&#8212; libz.so.1.2.3<br />
00002b7782cdc000 32 - - - r-x&#8211; libkrb5support.so.0.1<br />
00002b7782ce4000 2044 - - - &#8212;&#8211; libkrb5support.so.0.1<br />
00002b7782ee3000 4 - - - rw&#8212; libkrb5support.so.0.1<br />
00002b7782ee4000 8 - - - r-x&#8211; libkeyutils-1.2.so<br />
00002b7782ee6000 2044 - - - &#8212;&#8211; libkeyutils-1.2.so<br />
00002b77830e5000 4 - - - rw&#8212; libkeyutils-1.2.so<br />
00002b77830e6000 12 - - - rw&#8212; [ anon ]<br />
00002b77830e9000 8 - - - r-x&#8211; mod_auth_basic.so<br />
00002b77830eb000 2044 - - - &#8212;&#8211; mod_auth_basic.so<br />
00002b77832ea000 8 - - - rw&#8212; mod_auth_basic.so<br />
00002b77832ec000 24 - - - r-x&#8211; mod_auth_digest.so<br />
00002b77832f2000 2044 - - - &#8212;&#8211; mod_auth_digest.so<br />
00002b77834f1000 8 - - - rw&#8212; mod_auth_digest.so<br />
00002b77834f3000 8 - - - r-x&#8211; mod_authn_file.so<br />
00002b77834f5000 2044 - - - &#8212;&#8211; mod_authn_file.so<br />
00002b77836f4000 8 - - - rw&#8212; mod_authn_file.so<br />
00002b77836f6000 8 - - - r-x&#8211; mod_authn_alias.so<br />
00002b77836f8000 2044 - - - &#8212;&#8211; mod_authn_alias.so<br />
00002b77838f7000 8 - - - rw&#8212; mod_authn_alias.so<br />
00002b77838f9000 4 - - - r-x&#8211; mod_authn_anon.so<br />
00002b77838fa000 2048 - - - &#8212;&#8211; mod_authn_anon.so<br />
00002b7783afa000 8 - - - rw&#8212; mod_authn_anon.so<br />
00002b7783afc000 4 - - - r-x&#8211; mod_authn_dbm.so<br />
00002b7783afd000 2048 - - - &#8212;&#8211; mod_authn_dbm.so<br />
00002b7783cfd000 8 - - - rw&#8212; mod_authn_dbm.so<br />
00002b7783cff000 4 - - - r-x&#8211; mod_authn_default.so<br />
00002b7783d00000 2044 - - - &#8212;&#8211; mod_authn_default.so<br />
00002b7783eff000 8 - - - rw&#8212; mod_authn_default.so<br />
00002b7783f01000 8 - - - r-x&#8211; mod_authz_host.so<br />
00002b7783f03000 2044 - - - &#8212;&#8211; mod_authz_host.so<br />
00002b7784102000 8 - - - rw&#8212; mod_authz_host.so<br />
00002b7784104000 4 - - - r-x&#8211; mod_authz_user.so<br />
00002b7784105000 2044 - - - &#8212;&#8211; mod_authz_user.so<br />
00002b7784304000 8 - - - rw&#8212; mod_authz_user.so<br />
00002b7784306000 8 - - - r-x&#8211; mod_authz_owner.so<br />
00002b7784308000 2044 - - - &#8212;&#8211; mod_authz_owner.so<br />
00002b7784507000 8 - - - rw&#8212; mod_authz_owner.so<br />
00002b7784509000 8 - - - r-x&#8211; mod_authz_groupfile.so<br />
00002b778450b000 2044 - - - &#8212;&#8211; mod_authz_groupfile.so<br />
00002b778470a000 8 - - - rw&#8212; mod_authz_groupfile.so<br />
00002b778470c000 8 - - - r-x&#8211; mod_authz_dbm.so<br />
00002b778470e000 2044 - - - &#8212;&#8211; mod_authz_dbm.so<br />
00002b778490d000 8 - - - rw&#8212; mod_authz_dbm.so<br />
00002b778490f000 4 - - - r-x&#8211; mod_authz_default.so<br />
00002b7784910000 2044 - - - &#8212;&#8211; mod_authz_default.so<br />
00002b7784b0f000 8 - - - rw&#8212; mod_authz_default.so<br />
00002b7784b11000 44 - - - r-x&#8211; mod_ldap.so<br />
00002b7784b1c000 2044 - - - &#8212;&#8211; mod_ldap.so<br />
00002b7784d1b000 8 - - - rw&#8212; mod_ldap.so<br />
00002b7784d1d000 24 - - - r-x&#8211; mod_authnz_ldap.so<br />
00002b7784d23000 2044 - - - &#8212;&#8211; mod_authnz_ldap.so<br />
00002b7784f22000 8 - - - rw&#8212; mod_authnz_ldap.so<br />
00002b7784f24000 36 - - - r-x&#8211; mod_include.so<br />
00002b7784f2d000 2048 - - - &#8212;&#8211; mod_include.so<br />
00002b778512d000 8 - - - rw&#8212; mod_include.so<br />
00002b778512f000 20 - - - r-x&#8211; mod_log_config.so<br />
00002b7785134000 2044 - - - &#8212;&#8211; mod_log_config.so<br />
00002b7785333000 8 - - - rw&#8212; mod_log_config.so<br />
00002b7785335000 8 - - - r-x&#8211; mod_logio.so<br />
00002b7785337000 2044 - - - &#8212;&#8211; mod_logio.so<br />
00002b7785536000 8 - - - rw&#8212; mod_logio.so<br />
00002b7785538000 4 - - - r-x&#8211; mod_env.so<br />
00002b7785539000 2048 - - - &#8212;&#8211; mod_env.so<br />
00002b7785739000 8 - - - rw&#8212; mod_env.so<br />
00002b778573b000 16 - - - r-x&#8211; mod_ext_filter.so<br />
00002b778573f000 2044 - - - &#8212;&#8211; mod_ext_filter.so<br />
00002b778593e000 8 - - - rw&#8212; mod_ext_filter.so<br />
00002b7785940000 20 - - - r-x&#8211; mod_mime_magic.so<br />
00002b7785945000 2044 - - - &#8212;&#8211; mod_mime_magic.so<br />
00002b7785b44000 8 - - - rw&#8212; mod_mime_magic.so<br />
00002b7785b46000 8 - - - r-x&#8211; mod_expires.so<br />
00002b7785b48000 2044 - - - &#8212;&#8211; mod_expires.so<br />
00002b7785d47000 8 - - - rw&#8212; mod_expires.so<br />
00002b7785d49000 16 - - - r-x&#8211; mod_deflate.so<br />
00002b7785d4d000 2044 - - - &#8212;&#8211; mod_deflate.so<br />
00002b7785f4c000 8 - - - rw&#8212; mod_deflate.so<br />
00002b7785f4e000 12 - - - r-x&#8211; mod_headers.so<br />
00002b7785f51000 2044 - - - &#8212;&#8211; mod_headers.so<br />
00002b7786150000 8 - - - rw&#8212; mod_headers.so<br />
00002b7786152000 8 - - - r-x&#8211; mod_usertrack.so<br />
00002b7786154000 2048 - - - &#8212;&#8211; mod_usertrack.so<br />
00002b7786354000 8 - - - rw&#8212; mod_usertrack.so<br />
00002b7786356000 8 - - - r-x&#8211; mod_setenvif.so<br />
00002b7786358000 2048 - - - &#8212;&#8211; mod_setenvif.so<br />
00002b7786558000 8 - - - rw&#8212; mod_setenvif.so<br />
00002b778655a000 16 - - - r-x&#8211; mod_mime.so<br />
00002b778655e000 2044 - - - &#8212;&#8211; mod_mime.so<br />
00002b778675d000 8 - - - rw&#8212; mod_mime.so<br />
00002b778675f000 84 - - - r-x&#8211; mod_dav.so<br />
00002b7786774000 2044 - - - &#8212;&#8211; mod_dav.so<br />
00002b7786973000 8 - - - rw&#8212; mod_dav.so<br />
00002b7786975000 16 - - - r-x&#8211; mod_status.so<br />
00002b7786979000 2044 - - - &#8212;&#8211; mod_status.so<br />
00002b7786b78000 8 - - - rw&#8212; mod_status.so<br />
00002b7786b7a000 32 - - - r-x&#8211; mod_autoindex.so<br />
00002b7786b82000 2044 - - - &#8212;&#8211; mod_autoindex.so<br />
00002b7786d81000 8 - - - rw&#8212; mod_autoindex.so<br />
00002b7786d83000 16 - - - r-x&#8211; mod_info.so<br />
00002b7786d87000 2044 - - - &#8212;&#8211; mod_info.so<br />
00002b7786f86000 8 - - - rw&#8212; mod_info.so<br />
00002b7786f88000 44 - - - r-x&#8211; mod_dav_fs.so<br />
00002b7786f93000 2044 - - - &#8212;&#8211; mod_dav_fs.so<br />
00002b7787192000 8 - - - rw&#8212; mod_dav_fs.so<br />
00002b7787194000 8 - - - r-x&#8211; mod_vhost_alias.so<br />
00002b7787196000 2044 - - - &#8212;&#8211; mod_vhost_alias.so<br />
00002b7787395000 8 - - - rw&#8212; mod_vhost_alias.so<br />
00002b7787397000 28 - - - r-x&#8211; mod_negotiation.so<br />
00002b778739e000 2044 - - - &#8212;&#8211; mod_negotiation.so<br />
00002b778759d000 8 - - - rw&#8212; mod_negotiation.so<br />
00002b778759f000 8 - - - r-x&#8211; mod_dir.so<br />
00002b77875a1000 2044 - - - &#8212;&#8211; mod_dir.so<br />
00002b77877a0000 8 - - - rw&#8212; mod_dir.so<br />
00002b77877a2000 8 - - - r-x&#8211; mod_actions.so<br />
00002b77877a4000 2044 - - - &#8212;&#8211; mod_actions.so<br />
00002b77879a3000 8 - - - rw&#8212; mod_actions.so<br />
00002b77879a5000 8 - - - r-x&#8211; mod_speling.so<br />
00002b77879a7000 2048 - - - &#8212;&#8211; mod_speling.so<br />
00002b7787ba7000 8 - - - rw&#8212; mod_speling.so<br />
00002b7787ba9000 8 - - - r-x&#8211; mod_userdir.so<br />
00002b7787bab000 2044 - - - &#8212;&#8211; mod_userdir.so<br />
00002b7787daa000 8 - - - rw&#8212; mod_userdir.so<br />
00002b7787dac000 12 - - - r-x&#8211; mod_alias.so<br />
00002b7787daf000 2044 - - - &#8212;&#8211; mod_alias.so<br />
00002b7787fae000 8 - - - rw&#8212; mod_alias.so<br />
00002b7787fb0000 56 - - - r-x&#8211; mod_rewrite.so<br />
00002b7787fbe000 2044 - - - &#8212;&#8211; mod_rewrite.so<br />
00002b77881bd000 8 - - - rw&#8212; mod_rewrite.so<br />
00002b77881bf000 64 - - - r-x&#8211; mod_proxy.so<br />
00002b77881cf000 2044 - - - &#8212;&#8211; mod_proxy.so<br />
00002b77883ce000 8 - - - rw&#8212; mod_proxy.so<br />
00002b77883d0000 20 - - - r-x&#8211; mod_proxy_balancer.so<br />
00002b77883d5000 2044 - - - &#8212;&#8211; mod_proxy_balancer.so<br />
00002b77885d4000 8 - - - rw&#8212; mod_proxy_balancer.so<br />
00002b77885d6000 28 - - - r-x&#8211; mod_proxy_ftp.so<br />
00002b77885dd000 2044 - - - &#8212;&#8211; mod_proxy_ftp.so<br />
00002b77887dc000 8 - - - rw&#8212; mod_proxy_ftp.so<br />
00002b77887de000 24 - - - r-x&#8211; mod_proxy_http.so<br />
00002b77887e4000 2044 - - - &#8212;&#8211; mod_proxy_http.so<br />
00002b77889e3000 8 - - - rw&#8212; mod_proxy_http.so<br />
00002b77889e5000 8 - - - r-x&#8211; mod_proxy_connect.so<br />
00002b77889e7000 2044 - - - &#8212;&#8211; mod_proxy_connect.so<br />
00002b7788be6000 8 - - - rw&#8212; mod_proxy_connect.so<br />
00002b7788be8000 28 - - - r-x&#8211; mod_cache.so<br />
00002b7788bef000 2044 - - - &#8212;&#8211; mod_cache.so<br />
00002b7788dee000 8 - - - rw&#8212; mod_cache.so<br />
00002b7788df0000 4 - - - r-x&#8211; mod_suexec.so<br />
00002b7788df1000 2048 - - - &#8212;&#8211; mod_suexec.so<br />
00002b7788ff1000 8 - - - rw&#8212; mod_suexec.so<br />
00002b7788ff3000 16 - - - r-x&#8211; mod_disk_cache.so<br />
00002b7788ff7000 2048 - - - &#8212;&#8211; mod_disk_cache.so<br />
00002b77891f7000 8 - - - rw&#8212; mod_disk_cache.so<br />
00002b77891f9000 8 - - - r-x&#8211; mod_file_cache.so<br />
00002b77891fb000 2044 - - - &#8212;&#8211; mod_file_cache.so<br />
00002b77893fa000 8 - - - rw&#8212; mod_file_cache.so<br />
00002b77893fc000 24 - - - r-x&#8211; mod_mem_cache.so<br />
00002b7789402000 2044 - - - &#8212;&#8211; mod_mem_cache.so<br />
00002b7789601000 8 - - - rw&#8212; mod_mem_cache.so<br />
00002b7789603000 20 - - - r-x&#8211; mod_cgi.so<br />
00002b7789608000 2048 - - - &#8212;&#8211; mod_cgi.so<br />
00002b7789808000 8 - - - rw&#8212; mod_cgi.so<br />
00002b778980a000 8 - - - r-x&#8211; mod_version.so<br />
00002b778980c000 2044 - - - &#8212;&#8211; mod_version.so<br />
00002b7789a0b000 8 - - - rw&#8212; mod_version.so<br />
00002b7789a0d000 28 - - - r-x&#8211; mod_proxy_ajp.so<br />
00002b7789a14000 2044 - - - &#8212;&#8211; mod_proxy_ajp.so<br />
00002b7789c13000 8 - - - rw&#8212; mod_proxy_ajp.so<br />
00002b7789c15000 16 - - - r-x&#8211; mod_suphp.so<br />
00002b7789c19000 2044 - - - &#8212;&#8211; mod_suphp.so<br />
00002b7789e18000 4 - - - rw&#8212; mod_suphp.so<br />
00002b7789e22000 40 - - - r-x&#8211; libnss_files-2.5.so<br />
00002b7789e2c000 2044 - - - &#8212;&#8211; libnss_files-2.5.so<br />
00002b778a02b000 4 - - - r&#8212;- libnss_files-2.5.so<br />
00002b778a02c000 4 - - - rw&#8212; libnss_files-2.5.so<br />
00002b778a02d000 16 - - - r-x&#8211; libnss_dns-2.5.so<br />
00002b778a031000 2044 - - - &#8212;&#8211; libnss_dns-2.5.so<br />
00002b778a230000 4 - - - r&#8212;- libnss_dns-2.5.so<br />
00002b778a231000 4 - - - rw&#8212; libnss_dns-2.5.so<br />
00002b778b815000 1476 - - - rw&#8212; [ anon ]<br />
00007fff2bfcd000 84 - - - rw&#8212; [ stack ]<br />
ffffffffff600000 8192 - - - &#8212;&#8211; [ anon ]<br />
&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212;<br />
total kB 193636 - - -</p>
<p>&#8212;&#8211;<br />
</code></p>
<p>As can be seen above via the script and pmap output, the majority of apache&#8217;s memory footprint is taken up by dynamicaly loaded libraries or &#8216;mods&#8217;.</p>
<p>Take for example mod_authz_ldap, this module itself on each thread spawn (new connection) is taking up ~2mb of physical memory space, now this may not seem like much until you are serving 100&#8217;s of concurrent connections, at which point this becomes a very real problem.</p>
<p>mod_authz_ldap I have used as an example because it is an authentication module for use with the Lightweight Directory Access Protocol, something not commonly used in a generic LAMP setup.</p>
<p>By going through your httpd.conf and disabling modules you know you do not require (such as the example above), you can substantially reduce the memory footprint of apache, and therefor increase the number of concurrent connections apache can serve with the available memory.</p>
<p>In part 2 I will provide a new ouput of the script and pmap post optimization &#8230; stay tuned <img src='http://www.saiweb.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.saiweb.co.uk%2Flinux%2Foptimizing-apache-for-high-load-sites-part-1';
  addthis_title  = 'Optimizing+apache+for+high+load+sites+-+Part+1';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/linux/optimizing-apache-for-high-load-sites-part-1/feed</wfw:commentRss>
		</item>
		<item>
		<title>Vote Buzz for IT Superhero 2008!</title>
		<link>http://www.saiweb.co.uk/general/vote-buzz-for-it-superhero-2008</link>
		<comments>http://www.saiweb.co.uk/general/vote-buzz-for-it-superhero-2008#comments</comments>
		<pubDate>Thu, 13 Nov 2008 11:46:59 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[buzz]]></category>

		<category><![CDATA[it superheroes]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/general/vote-buzz-for-it-superhero-2008</guid>
		<description><![CDATA[Basically I have actually been shortlisted &#8220;woo&#8221;
So if you have found anything usefull on this blog please vote for me here
&#8220;David Busby&#8221;

http://www.firebrandtraining.co.uk/itsuperheroes/

  addthis_url    = 'http%3A%2F%2Fwww.saiweb.co.uk%2Fgeneral%2Fvote-buzz-for-it-superhero-2008';
  addthis_title  = 'Vote+Buzz+for+IT+Superhero+2008%21';
  addthis_pub    = '';

]]></description>
			<content:encoded><![CDATA[<p>Basically I have actually been shortlisted &#8220;woo&#8221;</p>
<p>So if you have found anything usefull on this blog please vote for me here</p>
<p>&#8220;David Busby&#8221;<br />
<a href="http://www.saiweb.co.uk/wp-content/uploads/2008/11/3026557703_3b65162b6e.jpg"><img src="http://www.saiweb.co.uk/wp-content/uploads/2008/11/3026557703_3b65162b6e-139x300.jpg" alt="" title="3026557703_3b65162b6e" width="139" height="300" class="alignnone size-medium wp-image-269" /></a></p>
<p><a href="http://www.firebrandtraining.co.uk/itsuperheroes/"><br />http://www.firebrandtraining.co.uk/itsuperheroes/</a></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.saiweb.co.uk%2Fgeneral%2Fvote-buzz-for-it-superhero-2008';
  addthis_title  = 'Vote+Buzz+for+IT+Superhero+2008%21';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/general/vote-buzz-for-it-superhero-2008/feed</wfw:commentRss>
		</item>
		<item>
		<title>Linux - The Sysadmin script - Part 3</title>
		<link>http://www.saiweb.co.uk/linux/linux-the-sysadmin-script-part-3</link>
		<comments>http://www.saiweb.co.uk/linux/linux-the-sysadmin-script-part-3#comments</comments>
		<pubDate>Wed, 12 Nov 2008 12:25:22 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[Bash Script]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/linux/linux-the-sysadmin-script-part-3</guid>
		<description><![CDATA[PART 3 IS INACCURATE, THE BELOW SCRIPT IS FOR REFERENCE ONLY, IT HAS BEEN REPLACED IN PART 4
In part 3, I am going to cover a bash function that will allow you to profile the memory usage of any application by name.
By adding the function below into your script you can execute a command such [...]]]></description>
			<content:encoded><![CDATA[<p><strong>PART 3 IS INACCURATE, THE BELOW SCRIPT IS FOR REFERENCE ONLY, IT HAS BEEN REPLACED IN <a href="http://www.saiweb.co.uk/uncategorized/linux-the-sysadmin-script-part-4">PART 4</a></strong></p>
<p>In part 3, I am going to cover a bash function that will allow you to profile the memory usage of any application by name.</p>
<p>By adding the function below into your script you can execute a command such as: sysadmin appmem apache</p>
<p><code><br />
function appmem {<br />
if [ -z "$1" ]; then<br />
echo &#8220;Usage: sysadmin appmem app_name i.e. (sysadmin appmem apache)&#8221;;<br />
else<br />
if [ -x '/usr/bin/pmap' ]; then<br />
APID=(`ps aux | grep &#8220;$1&#8243; | grep -v &#8216;grep&#8217; | grep -v &#8220;$0&#8243; | awk &#8216;{print $2}&#8217;`);<br />
COUNT=0;<br />
AMEM=0<br />
for PID in ${APID[@]}<br />
do<br />
TMP=$((`pmap -x $PID | grep &#8220;total&#8221; | awk &#8216;{print $3}&#8217;`));<br />
AMEM=$(($AMEM+$TMP));<br />
COUNT=$(($COUNT+1));<br />
done<br />
AMEM=$(($AMEM/1024));<br />
echo -e &#8220;$YELLOW &#8212;&#8211; MEMORY USAGE REPORT FOR &#8216;$1&#8242; &#8212;&#8211; $CLEAR&#8221;;<br />
echo &#8220;PID Count: $COUNT&#8221;;<br />
echo &#8220;Mem usage: $AMEM MB&#8221;;<br />
echo &#8220;Mem/PID: $(($AMEM/$COUNT)) MB&#8221;;<br />
echo -e &#8220;$RED&#8221;<br />
echo -e &#8220;For more information run: pmap -x $PID $CLEAR&#8221;;<br />
else<br />
echo &#8216;Could not execute /usr/bin/pmap &#8230; aborting&#8217;;<br />
exit;<br />
fi<br />
fi<br />
}<br />
</code><br />
Sample output:</p>
<p><code><br />
<span style="color: #ffcc00;">&#8212;&#8211; MEMORY USAGE REPORT FOR &#8216;apache&#8217; &#8212;&#8211;</span><br />
PID Count: 6<br />
Mem usage: 1134 MB<br />
Mem/PID: 189 MB<br />
<span style="color: #ff0000;"><br />
For more information run: pmap -x 123456</span><br />
</code></p>
<p>You can of course replace &#8216;apache&#8217; with the application or daemon name you want to profile the memory usage of.</p>
<p>This script does require that pmap is installed, if the script can not find it, it will abort.</p>
<p>As always any problems, post a comment.</p>
<p>UPDATE: Apparently I need to point out that if you haven&#8217;t read <a href="http://www.saiweb.co.uk/linux/linux-the-sysadmin-script-part-2">PART 2</a>! then the colored output will not work &#8230; That&#8217;s why this entry is titled part 3, it does assume a degree of competence on your part in realizing part&#8217;s 1 and 2 may just be required reading &#8230;</p>
<p><strong>NOTE: The above provides a complete memory footprint of the indvidual PID, the same as VIRT in top.</strong></p>
<p><strong> VIRT &#8212; Virtual Image (kb)<br />
* The total amount of virtual memory used by the task. It includes all code, data and shared libraries plus pages that have been swapped out.<br />
* VIRT = SWAP + RES </strong></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.saiweb.co.uk%2Flinux%2Flinux-the-sysadmin-script-part-3';
  addthis_title  = 'Linux+-+The+Sysadmin+script+-+Part+3';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/linux/linux-the-sysadmin-script-part-3/feed</wfw:commentRss>
		</item>
		<item>
		<title>mySQL forcing utf-8 compliance for all connections.</title>
		<link>http://www.saiweb.co.uk/mysql/mysql-forcing-utf-8-compliance-for-all-connections</link>
		<comments>http://www.saiweb.co.uk/mysql/mysql-forcing-utf-8-compliance-for-all-connections#comments</comments>
		<pubDate>Wed, 12 Nov 2008 10:05:45 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
		
		<category><![CDATA[mySQL]]></category>

		<category><![CDATA[c++]]></category>

		<category><![CDATA[init_connect]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[utf-8]]></category>

		<category><![CDATA[utf8]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/mysql/mysql-forcing-utf-8-compliance-for-all-connections</guid>
		<description><![CDATA[The problem that most people face when setting up a UTF-8 database in mySQL is that without calling &#8216;SET NAMES&#8217; in the mySQL client prior to issuing any queries (PHP, C++ etc &#8230;) that the client connection will actually in most cases default to&#160; latin-1.
However as of mySQL 5.x or higher you can issue a [...]]]></description>
			<content:encoded><![CDATA[<p>The problem that most people face when setting up a UTF-8 database in mySQL is that without calling &#8216;SET NAMES&#8217; in the mySQL client prior to issuing any queries (PHP, C++ etc &#8230;) that the client connection will actually in most cases default to&nbsp; latin-1.</p>
<p>However as of mySQL 5.x or higher you can issue a statement in the my.cnf file calling init_connect.</p>
<p>This will trigger a series of defined commands / queries every time a non super user connects (So if you are using root to connect to your mySQL database, stop reading now and slap yourself HARD).</p>
<p>i.e.</p>
<p>[mysqld]<br />init_connect=&#8217;SET collation_connection = utf8_general_ci&#8217;<br />init_connect=&#8217;SET NAMES utf8&#8242;<br />default-character-set=utf8<br />character-set-server=utf8<br />collation-server=utf8_general_ci </p>
<p>Restart mySQL and check the mysqld.log has not returned any errors (Or your event viewer if you are using windows).</p>
<p>Every client connection will now default to utf-8 encoding and not latin-1, removing the need to add a SET NAMES call on every connection.</p>
<p>This will work for PHP, C++, ruby etc&#8230; as the client encoding is now handeled server side, rather that waiting on the client to issue a SET NAMES command.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.saiweb.co.uk%2Fmysql%2Fmysql-forcing-utf-8-compliance-for-all-connections';
  addthis_title  = 'mySQL+forcing+utf-8+compliance+for+all+connections.';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/mysql/mysql-forcing-utf-8-compliance-for-all-connections/feed</wfw:commentRss>
		</item>
		<item>
		<title>One eclipse to rule them all, One eclipse to find them, One eclipse to bring them all, and in dev joy bind them &#8230;</title>
		<link>http://www.saiweb.co.uk/uncategorized/one-eclipse-to-rule-them-all-one-eclipse-to-find-them-one-eclipse-to-bring-them-all-and-in-dev-joy-bind-them</link>
		<comments>http://www.saiweb.co.uk/uncategorized/one-eclipse-to-rule-them-all-one-eclipse-to-find-them-one-eclipse-to-bring-them-all-and-in-dev-joy-bind-them#comments</comments>
		<pubDate>Fri, 31 Oct 2008 10:04:30 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/uncategorized/one-eclipse-to-rule-them-all-one-eclipse-to-find-them-one-eclipse-to-bring-them-all-and-in-dev-joy-bind-them</guid>
		<description><![CDATA[So &#8230; LoTR was obviously on TV a few days ago &#8230;
Onto the point, at the moment I am maintaining 2 different installations of eclipse &#8230; one for PHP, C++.
Wouldn&#8217;t it be great if I could have both of these in one happy installation? &#8230; Yeh it would however getting all the dependencies is an [...]]]></description>
			<content:encoded><![CDATA[<p>So &#8230; LoTR was obviously on TV a few days ago &#8230;</p>
<p>Onto the point, at the moment I am maintaining 2 different installations of eclipse &#8230; one for PHP, C++.</p>
<p>Wouldn&#8217;t it be great if I could have both of these in one happy installation? &#8230; Yeh it would however getting all the dependencies is an utter nightmare &#8230; unless you have a program do it for you.</p>
<p>Long story short: http://ondemand.yoxos.com/geteclipse/start</p>
<p>Customize your eclipse before you download it.</p>
<p>(Thanks Austin!)</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.saiweb.co.uk%2Funcategorized%2Fone-eclipse-to-rule-them-all-one-eclipse-to-find-them-one-eclipse-to-bring-them-all-and-in-dev-joy-bind-them';
  addthis_title  = 'One+eclipse+to+rule+them+all%2C+One+eclipse+to+find+them%2C+One+eclipse+to+bring+them+all%2C+and+in+dev+joy+bind+them+%26%238230%3B';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/uncategorized/one-eclipse-to-rule-them-all-one-eclipse-to-find-them-one-eclipse-to-bring-them-all-and-in-dev-joy-bind-them/feed</wfw:commentRss>
		</item>
		<item>
		<title>The zen of secured shared hosting part 1</title>
		<link>http://www.saiweb.co.uk/security/the-zen-of-secured-shared-hosting-part-1</link>
		<comments>http://www.saiweb.co.uk/security/the-zen-of-secured-shared-hosting-part-1#comments</comments>
		<pubDate>Fri, 24 Oct 2008 08:20:02 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
		
		<category><![CDATA[Apache]]></category>

		<category><![CDATA[Hosting]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[hacking]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[security]]></category>

		<category><![CDATA[suPHP]]></category>

		<category><![CDATA[zen]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/security/the-zen-of-secured-shared-hosting-part-1</guid>
		<description><![CDATA[Welcome to part one of the &#8216;zen of secured shared hosting&#8217; series.
In this part I will be covering the concepts of secured shared hosting, and why you as a shared hosting provider should be taking steps to ensure this is how you deploy your hosting environments.
Let&#8217;s first take a typical L.A.M.P setup:
PHP Compiled from source [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to part one of the &#8216;zen of secured shared hosting&#8217; series.</p>
<p>In this part I will be covering the concepts of secured shared hosting, and why you as a shared hosting provider should be taking steps to ensure this is how you deploy your hosting environments.</p>
<p>Let&#8217;s first take a typical L.A.M.P setup:</p>
<p>PHP Compiled from source as apache module.<br />mySQL installed from RPM or update package (yum / up2date).<br />HTTPD installed as RPM or update package (yum / up2date).</p>
<p>Please note at the time of writing if you yum / apt-get / up2date install your PHP package you will have varying results when attempting to compile and install suPHP, as such grab the source code from php.net, and follow this series.</p>
<p>As a shared hosting provider lets say you have 5 clients all hosted from the one server, each client using vsftpd is chrooted() into their home directory, and their ssh access disabled, supposedly secure enough.</p>
<p>Unfortunatly not so, due to the L.A.M.P configuration the &#8216;apache&#8217; user needs a minimum of read and execute permissions over all the PHP files on the system, why is this a problem?</p>
<p>This is a problem largely due to human nature of the client, your &#8216;joe bloggs&#8217; client doesn&#8217;t care about the technical aspects of web hosting or websites, they just want an easy pretty interface to get their corner of the internet online, downloading something like drupal or joomla.</p>
<p>Now this isn&#8217;t a dig at open source CMS, this is an insight into human nature, look at the changelog for any open CMS and you will see &#8217;security fixes&#8217;, unfortunatly all &#8216;joe bloggs&#8217; cares about is that their website is working, and this is wher things take a turn for the worse.</p>
<p>Joe Bloggs never updates his open CMS platform, meaning any vulnerabilities patched in subsequent releases are still exploitable on his website, worst case scenario that this is an XSSI (Cross Server Script Includes) vulnerbility.</p>
<p>An attacker finds this website and idetifies the security hole, using XSSI to install a PHP interactive shell, giving the attacker SSH like access to the hosting environment, most people at this point think so the attacker has compromise one site &#8230; so what we can restore that site from backups and it&#8217;s only one site that&#8217;s affected, the other 4 users either do not use open CMS or are up to date with all the security patches.</p>
<p>Well that&#8217;s where you would be wrong, with the hosting setup outlined above the SSH like PHP shell is now running as the apache user, meaning the attacker can go anywhere and read anything apache can, and with the hosting setup oulined above that mean reading things like datbase connection files, suddenly all the clients on the hosting environment have their websites compromised as the attacker gains mySQL access and starts changing content on thewebsites, despite the fact that the other 4 sites themselves were never exploited.</p>
<p>One clients error just became a cascading exploit on your hosting platform, now make that a more realistic platform say 30 clients on the box, some are online shops, the issue just became a whole lot bigger there is lost revenue due to downtime of the shop sites, and worse still the attacker now has access to any customer details those shops were storing! but it&#8217;s not Joe Bloggs that&#8217;s accountable it&#8217;s YOU as the hosting provider, you can take steps to prevent one exploited site becoming 30, and this web series will tell you host to do it.</p>
<p>coming in part 2:</p>
<p>an introduction to suPHP<br />compiling php as a cgi binary, and why you need to do so</p>
<p></p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fwww.saiweb.co.uk%2Fsecurity%2Fthe-zen-of-secured-shared-hosting-part-1';
  addthis_title  = 'The+zen+of+secured+shared+hosting+part+1';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/security/the-zen-of-secured-shared-hosting-part-1/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
