<?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>Saiweb &#187; Apache</title>
	<atom:link href="http://www.saiweb.co.uk/category/apache/feed" rel="self" type="application/rss+xml" />
	<link>http://www.saiweb.co.uk</link>
	<description>Ramblings of a Sys admin</description>
	<lastBuildDate>Mon, 06 Feb 2012 14:57:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Optimizing Apache for high load sites &#8211; 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. [...]]]></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>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># 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 />
&lt;IfModule prefork.c&gt;<br />
StartServers &nbsp; &nbsp; &nbsp; 8<br />
MinSpareServers &nbsp; &nbsp;5<br />
MaxSpareServers &nbsp; 20<br />
ServerLimit &nbsp; &nbsp; &nbsp;256<br />
MaxClients &nbsp; &nbsp; &nbsp; 256<br />
MaxRequestsPerChild &nbsp;4000<br />
&lt;/IfModule&gt;<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 />
&lt;IfModule worker.c&gt;<br />
StartServers &nbsp; &nbsp; &nbsp; &nbsp; 2<br />
MaxClients &nbsp; &nbsp; &nbsp; &nbsp; 150<br />
MinSpareThreads &nbsp; &nbsp; 25<br />
MaxSpareThreads &nbsp; &nbsp; 75<br />
ThreadsPerChild &nbsp; &nbsp; 25<br />
MaxRequestsPerChild &nbsp;0<br />
&lt;/IfModule&gt;</div></td></tr></tbody></table></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[buzz@buzz_srv ~]httpd -l<br />
Compiled in modules:<br />
&nbsp; core.c<br />
&nbsp; prefork.c<br />
&nbsp; http_core.c<br />
&nbsp; mod_so.c</div></td></tr></tbody></table></div>
<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>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;IfModule prefork.c&gt;<br />
StartServers &nbsp; &nbsp; &nbsp; 8<br />
MinSpareServers &nbsp; &nbsp;5<br />
MaxSpareServers &nbsp; 20<br />
ServerLimit &nbsp; &nbsp; &nbsp;480<br />
MaxClients &nbsp; &nbsp; &nbsp; 480<br />
MaxRequestsPerChild &nbsp;4000<br />
&lt;/IfModule&gt;</div></td></tr></tbody></table></div>
<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.<span style="float: left;" ><a class="twitter-share-button"  data-via="Saiweb" data-count="horizontal" data-related="Saiweb:David Busby" data-lang="en" data-url="http://www.saiweb.co.uk/linux/optimizing-apache-for-high-load-sites-part-3" data-text="Optimizing Apache for high load sites &#8211; Part 3" href="http://twitter.com/share?via=Saiweb&#038;count=horizontal&#038;related=Saiweb%3ADavid%20Busby&#038;lang=en&#038;url=http%3A%2F%2Fwww.saiweb.co.uk%2Flinux%2Foptimizing-apache-for-high-load-sites-part-3&#038;text=Optimizing%20Apache%20for%20high%20load%20sites%20%26%238211%3B%20Part%203" >Tweet</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/linux/optimizing-apache-for-high-load-sites-part-3/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Optimizing Apache for high load sites &#8211; 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 &#8211; 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 &#8211; 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>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">----- 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</div></td></tr></tbody></table></div>
<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>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;----- 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</div></td></tr></tbody></table></div>
<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>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;----- 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</div></td></tr></tbody></table></div>
<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 &#8211; 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>
<p><span style="float: left;" ><a class="twitter-share-button"  data-via="Saiweb" data-count="horizontal" data-related="Saiweb:David Busby" data-lang="en" data-url="http://www.saiweb.co.uk/linux/optimizing-apache-for-high-load-sites-part-2" data-text="Optimizing Apache for high load sites &#8211; Part 2" href="http://twitter.com/share?via=Saiweb&#038;count=horizontal&#038;related=Saiweb%3ADavid%20Busby&#038;lang=en&#038;url=http%3A%2F%2Fwww.saiweb.co.uk%2Flinux%2Foptimizing-apache-for-high-load-sites-part-2&#038;text=Optimizing%20Apache%20for%20high%20load%20sites%20%26%238211%3B%20Part%202" >Tweet</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/linux/optimizing-apache-for-high-load-sites-part-2/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Optimizing apache for high load sites &#8211; 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; [...]]]></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>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br />134<br />135<br />136<br />137<br />138<br />139<br />140<br />141<br />142<br />143<br />144<br />145<br />146<br />147<br />148<br />149<br />150<br />151<br />152<br />153<br />154<br />155<br />156<br />157<br />158<br />159<br />160<br />161<br />162<br />163<br />164<br />165<br />166<br />167<br />168<br />169<br />170<br />171<br />172<br />173<br />174<br />175<br />176<br />177<br />178<br />179<br />180<br />181<br />182<br />183<br />184<br />185<br />186<br />187<br />188<br />189<br />190<br />191<br />192<br />193<br />194<br />195<br />196<br />197<br />198<br />199<br />200<br />201<br />202<br />203<br />204<br />205<br />206<br />207<br />208<br />209<br />210<br />211<br />212<br />213<br />214<br />215<br />216<br />217<br />218<br />219<br />220<br />221<br />222<br />223<br />224<br />225<br />226<br />227<br />228<br />229<br />230<br />231<br />232<br />233<br />234<br />235<br />236<br />237<br />238<br />239<br />240<br />241<br />242<br />243<br />244<br />245<br />246<br />247<br />248<br />249<br />250<br />251<br />252<br />253<br />254<br />255<br />256<br />257<br />258<br />259<br />260<br />261<br />262<br />263<br />264<br />265<br />266<br />267<br />268<br />269<br />270<br />271<br />272<br />273<br />274<br />275<br />276<br />277<br />278<br />279<br />280<br />281<br />282<br />283<br />284<br />285<br />286<br />287<br />288<br />289<br />290<br />291<br />292<br />293<br />294<br />295<br />296<br />297<br />298<br />299<br />300<br />301<br />302<br />303<br />304<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">----- 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-- httpd<br />
00002b777eb15000 100 - - - rw-s- zero (deleted)<br />
00002b777eb2e000 88 - - - rw-s- zero (deleted)<br />
00002b777ed14000 16 - - - rw--- httpd<br />
00002b777ed18000 12 - - - rw--- [ anon ]<br />
00002b777ed1b000 104 - - - r-x-- ld-2.5.so<br />
00002b777ed35000 4 - - - rw--- [ anon ]<br />
00002b777ed3f000 4 - - - rw--- [ anon ]<br />
00002b777ef35000 4 - - - r---- ld-2.5.so<br />
00002b777ef36000 4 - - - rw--- ld-2.5.so<br />
00002b777ef37000 520 - - - r-x-- libm-2.5.so<br />
00002b777efb9000 2044 - - - ----- libm-2.5.so<br />
00002b777f1b8000 4 - - - r---- libm-2.5.so<br />
00002b777f1b9000 4 - - - rw--- libm-2.5.so<br />
00002b777f1ba000 108 - - - r-x-- libpcre.so.0.0.1<br />
00002b777f1d5000 2048 - - - ----- libpcre.so.0.0.1<br />
00002b777f3d5000 4 - - - rw--- libpcre.so.0.0.1<br />
00002b777f3d6000 84 - - - r-x-- libselinux.so.1<br />
00002b777f3eb000 2048 - - - ----- libselinux.so.1<br />
00002b777f5eb000 8 - - - rw--- libselinux.so.1<br />
00002b777f5ed000 8 - - - rw--- [ anon ]<br />
00002b777f5ef000 112 - - - r-x-- libaprutil-1.so.0.2.7<br />
00002b777f60b000 2044 - - - ----- libaprutil-1.so.0.2.7<br />
00002b777f80a000 8 - - - rw--- libaprutil-1.so.0.2.7<br />
00002b777f80c000 36 - - - r-x-- libcrypt-2.5.so<br />
00002b777f815000 2044 - - - ----- libcrypt-2.5.so<br />
00002b777fa14000 4 - - - r---- libcrypt-2.5.so<br />
00002b777fa15000 4 - - - rw--- libcrypt-2.5.so<br />
00002b777fa16000 184 - - - rw--- [ anon ]<br />
00002b777fa44000 224 - - - r-x-- libldap-2.3.so.0.2.15<br />
00002b777fa7c000 2048 - - - ----- libldap-2.3.so.0.2.15<br />
00002b777fc7c000 8 - - - rw--- libldap-2.3.so.0.2.15<br />
00002b777fc7e000 4 - - - rw--- [ anon ]<br />
00002b777fc7f000 52 - - - r-x-- liblber-2.3.so.0.2.15<br />
00002b777fc8c000 2048 - - - ----- liblber-2.3.so.0.2.15<br />
00002b777fe8c000 4 - - - rw--- liblber-2.3.so.0.2.15<br />
00002b777fe8d000 964 - - - r-x-- libdb-4.3.so<br />
00002b777ff7e000 2044 - - - ----- libdb-4.3.so<br />
00002b778017d000 20 - - - rw--- libdb-4.3.so<br />
00002b7780182000 128 - - - r-x-- libexpat.so.0.5.0<br />
00002b77801a2000 2044 - - - ----- libexpat.so.0.5.0<br />
00002b77803a1000 12 - - - rw--- libexpat.so.0.5.0<br />
00002b77803a4000 4 - - - rw--- [ anon ]<br />
00002b77803a5000 152 - - - r-x-- libapr-1.so.0.2.7<br />
00002b77803cb000 2048 - - - ----- libapr-1.so.0.2.7<br />
00002b77805cb000 4 - - - rw--- libapr-1.so.0.2.7<br />
00002b77805cc000 84 - - - r-x-- libpthread-2.5.so<br />
00002b77805e1000 2044 - - - ----- libpthread-2.5.so<br />
00002b77807e0000 4 - - - r---- libpthread-2.5.so<br />
00002b77807e1000 4 - - - rw--- libpthread-2.5.so<br />
00002b77807e2000 16 - - - rw--- [ anon ]<br />
00002b77807e6000 8 - - - r-x-- libdl-2.5.so<br />
00002b77807e8000 2048 - - - ----- libdl-2.5.so<br />
00002b77809e8000 4 - - - r---- libdl-2.5.so<br />
00002b77809e9000 4 - - - rw--- libdl-2.5.so<br />
00002b77809ea000 4 - - - rw--- [ anon ]<br />
00002b77809eb000 1320 - - - r-x-- libc-2.5.so<br />
00002b7780b35000 2044 - - - ----- libc-2.5.so<br />
00002b7780d34000 16 - - - r---- libc-2.5.so<br />
00002b7780d38000 4 - - - rw--- libc-2.5.so<br />
00002b7780d39000 20 - - - rw--- [ anon ]<br />
00002b7780d3e000 236 - - - r-x-- libsepol.so.1<br />
00002b7780d79000 2048 - - - ----- libsepol.so.1<br />
00002b7780f79000 4 - - - rw--- libsepol.so.1<br />
00002b7780f7a000 40 - - - rw--- [ anon ]<br />
00002b7780f84000 12 - - - r-x-- libuuid.so.1.2<br />
00002b7780f87000 2048 - - - ----- libuuid.so.1.2<br />
00002b7781187000 4 - - - rw--- libuuid.so.1.2<br />
00002b7781188000 4 - - - rw--- [ anon ]<br />
00002b7781189000 128 - - - r-x-- libpq.so.4.1<br />
00002b77811a9000 2048 - - - ----- libpq.so.4.1<br />
00002b77813a9000 8 - - - rw--- libpq.so.4.1<br />
00002b77813ab000 352 - - - r-x-- libsqlite3.so.0.8.6<br />
00002b7781403000 2048 - - - ----- libsqlite3.so.0.8.6<br />
00002b7781603000 8 - - - rw--- libsqlite3.so.0.8.6<br />
00002b7781605000 68 - - - r-x-- libresolv-2.5.so<br />
00002b7781616000 2048 - - - ----- libresolv-2.5.so<br />
00002b7781816000 4 - - - r---- libresolv-2.5.so<br />
00002b7781817000 4 - - - rw--- libresolv-2.5.so<br />
00002b7781818000 12 - - - rw--- [ anon ]<br />
00002b778181b000 96 - - - r-x-- libsasl2.so.2.0.22<br />
00002b7781833000 2048 - - - ----- libsasl2.so.2.0.22<br />
00002b7781a33000 4 - - - rw--- libsasl2.so.2.0.22<br />
00002b7781a34000 268 - - - r-x-- libssl.so.0.9.8b<br />
00002b7781a77000 2048 - - - ----- libssl.so.0.9.8b<br />
00002b7781c77000 24 - - - rw--- libssl.so.0.9.8b<br />
00002b7781c7d000 1172 - - - r-x-- libcrypto.so.0.9.8b<br />
00002b7781da2000 2048 - - - ----- libcrypto.so.0.9.8b<br />
00002b7781fa2000 124 - - - rw--- libcrypto.so.0.9.8b<br />
00002b7781fc1000 20 - - - rw--- [ anon ]<br />
00002b7781fc6000 572 - - - r-x-- libkrb5.so.3.3<br />
00002b7782055000 2048 - - - ----- libkrb5.so.3.3<br />
00002b7782255000 16 - - - rw--- libkrb5.so.3.3<br />
00002b7782259000 84 - - - r-x-- libnsl-2.5.so<br />
00002b778226e000 2044 - - - ----- libnsl-2.5.so<br />
00002b778246d000 4 - - - r---- libnsl-2.5.so<br />
00002b778246e000 4 - - - rw--- libnsl-2.5.so<br />
00002b778246f000 12 - - - rw--- [ anon ]<br />
00002b7782472000 176 - - - r-x-- libgssapi_krb5.so.2.2<br />
00002b778249e000 2048 - - - ----- libgssapi_krb5.so.2.2<br />
00002b778269e000 8 - - - rw--- libgssapi_krb5.so.2.2<br />
00002b77826a0000 8 - - - r-x-- libcom_err.so.2.1<br />
00002b77826a2000 2044 - - - ----- libcom_err.so.2.1<br />
00002b77828a1000 4 - - - rw--- libcom_err.so.2.1<br />
00002b77828a2000 144 - - - r-x-- libk5crypto.so.3.1<br />
00002b77828c6000 2044 - - - ----- libk5crypto.so.3.1<br />
00002b7782ac5000 8 - - - rw--- libk5crypto.so.3.1<br />
00002b7782ac7000 4 - - - rw--- [ anon ]<br />
00002b7782ac8000 80 - - - r-x-- libz.so.1.2.3<br />
00002b7782adc000 2044 - - - ----- libz.so.1.2.3<br />
00002b7782cdb000 4 - - - rw--- libz.so.1.2.3<br />
00002b7782cdc000 32 - - - r-x-- libkrb5support.so.0.1<br />
00002b7782ce4000 2044 - - - ----- libkrb5support.so.0.1<br />
00002b7782ee3000 4 - - - rw--- libkrb5support.so.0.1<br />
00002b7782ee4000 8 - - - r-x-- libkeyutils-1.2.so<br />
00002b7782ee6000 2044 - - - ----- libkeyutils-1.2.so<br />
00002b77830e5000 4 - - - rw--- libkeyutils-1.2.so<br />
00002b77830e6000 12 - - - rw--- [ anon ]<br />
00002b77830e9000 8 - - - r-x-- mod_auth_basic.so<br />
00002b77830eb000 2044 - - - ----- mod_auth_basic.so<br />
00002b77832ea000 8 - - - rw--- mod_auth_basic.so<br />
00002b77832ec000 24 - - - r-x-- mod_auth_digest.so<br />
00002b77832f2000 2044 - - - ----- mod_auth_digest.so<br />
00002b77834f1000 8 - - - rw--- mod_auth_digest.so<br />
00002b77834f3000 8 - - - r-x-- mod_authn_file.so<br />
00002b77834f5000 2044 - - - ----- mod_authn_file.so<br />
00002b77836f4000 8 - - - rw--- mod_authn_file.so<br />
00002b77836f6000 8 - - - r-x-- mod_authn_alias.so<br />
00002b77836f8000 2044 - - - ----- mod_authn_alias.so<br />
00002b77838f7000 8 - - - rw--- mod_authn_alias.so<br />
00002b77838f9000 4 - - - r-x-- mod_authn_anon.so<br />
00002b77838fa000 2048 - - - ----- mod_authn_anon.so<br />
00002b7783afa000 8 - - - rw--- mod_authn_anon.so<br />
00002b7783afc000 4 - - - r-x-- mod_authn_dbm.so<br />
00002b7783afd000 2048 - - - ----- mod_authn_dbm.so<br />
00002b7783cfd000 8 - - - rw--- mod_authn_dbm.so<br />
00002b7783cff000 4 - - - r-x-- mod_authn_default.so<br />
00002b7783d00000 2044 - - - ----- mod_authn_default.so<br />
00002b7783eff000 8 - - - rw--- mod_authn_default.so<br />
00002b7783f01000 8 - - - r-x-- mod_authz_host.so<br />
00002b7783f03000 2044 - - - ----- mod_authz_host.so<br />
00002b7784102000 8 - - - rw--- mod_authz_host.so<br />
00002b7784104000 4 - - - r-x-- mod_authz_user.so<br />
00002b7784105000 2044 - - - ----- mod_authz_user.so<br />
00002b7784304000 8 - - - rw--- mod_authz_user.so<br />
00002b7784306000 8 - - - r-x-- mod_authz_owner.so<br />
00002b7784308000 2044 - - - ----- mod_authz_owner.so<br />
00002b7784507000 8 - - - rw--- mod_authz_owner.so<br />
00002b7784509000 8 - - - r-x-- mod_authz_groupfile.so<br />
00002b778450b000 2044 - - - ----- mod_authz_groupfile.so<br />
00002b778470a000 8 - - - rw--- mod_authz_groupfile.so<br />
00002b778470c000 8 - - - r-x-- mod_authz_dbm.so<br />
00002b778470e000 2044 - - - ----- mod_authz_dbm.so<br />
00002b778490d000 8 - - - rw--- mod_authz_dbm.so<br />
00002b778490f000 4 - - - r-x-- mod_authz_default.so<br />
00002b7784910000 2044 - - - ----- mod_authz_default.so<br />
00002b7784b0f000 8 - - - rw--- mod_authz_default.so<br />
00002b7784b11000 44 - - - r-x-- mod_ldap.so<br />
00002b7784b1c000 2044 - - - ----- mod_ldap.so<br />
00002b7784d1b000 8 - - - rw--- mod_ldap.so<br />
00002b7784d1d000 24 - - - r-x-- mod_authnz_ldap.so<br />
00002b7784d23000 2044 - - - ----- mod_authnz_ldap.so<br />
00002b7784f22000 8 - - - rw--- mod_authnz_ldap.so<br />
00002b7784f24000 36 - - - r-x-- mod_include.so<br />
00002b7784f2d000 2048 - - - ----- mod_include.so<br />
00002b778512d000 8 - - - rw--- mod_include.so<br />
00002b778512f000 20 - - - r-x-- mod_log_config.so<br />
00002b7785134000 2044 - - - ----- mod_log_config.so<br />
00002b7785333000 8 - - - rw--- mod_log_config.so<br />
00002b7785335000 8 - - - r-x-- mod_logio.so<br />
00002b7785337000 2044 - - - ----- mod_logio.so<br />
00002b7785536000 8 - - - rw--- mod_logio.so<br />
00002b7785538000 4 - - - r-x-- mod_env.so<br />
00002b7785539000 2048 - - - ----- mod_env.so<br />
00002b7785739000 8 - - - rw--- mod_env.so<br />
00002b778573b000 16 - - - r-x-- mod_ext_filter.so<br />
00002b778573f000 2044 - - - ----- mod_ext_filter.so<br />
00002b778593e000 8 - - - rw--- mod_ext_filter.so<br />
00002b7785940000 20 - - - r-x-- mod_mime_magic.so<br />
00002b7785945000 2044 - - - ----- mod_mime_magic.so<br />
00002b7785b44000 8 - - - rw--- mod_mime_magic.so<br />
00002b7785b46000 8 - - - r-x-- mod_expires.so<br />
00002b7785b48000 2044 - - - ----- mod_expires.so<br />
00002b7785d47000 8 - - - rw--- mod_expires.so<br />
00002b7785d49000 16 - - - r-x-- mod_deflate.so<br />
00002b7785d4d000 2044 - - - ----- mod_deflate.so<br />
00002b7785f4c000 8 - - - rw--- mod_deflate.so<br />
00002b7785f4e000 12 - - - r-x-- mod_headers.so<br />
00002b7785f51000 2044 - - - ----- mod_headers.so<br />
00002b7786150000 8 - - - rw--- mod_headers.so<br />
00002b7786152000 8 - - - r-x-- mod_usertrack.so<br />
00002b7786154000 2048 - - - ----- mod_usertrack.so<br />
00002b7786354000 8 - - - rw--- mod_usertrack.so<br />
00002b7786356000 8 - - - r-x-- mod_setenvif.so<br />
00002b7786358000 2048 - - - ----- mod_setenvif.so<br />
00002b7786558000 8 - - - rw--- mod_setenvif.so<br />
00002b778655a000 16 - - - r-x-- mod_mime.so<br />
00002b778655e000 2044 - - - ----- mod_mime.so<br />
00002b778675d000 8 - - - rw--- mod_mime.so<br />
00002b778675f000 84 - - - r-x-- mod_dav.so<br />
00002b7786774000 2044 - - - ----- mod_dav.so<br />
00002b7786973000 8 - - - rw--- mod_dav.so<br />
00002b7786975000 16 - - - r-x-- mod_status.so<br />
00002b7786979000 2044 - - - ----- mod_status.so<br />
00002b7786b78000 8 - - - rw--- mod_status.so<br />
00002b7786b7a000 32 - - - r-x-- mod_autoindex.so<br />
00002b7786b82000 2044 - - - ----- mod_autoindex.so<br />
00002b7786d81000 8 - - - rw--- mod_autoindex.so<br />
00002b7786d83000 16 - - - r-x-- mod_info.so<br />
00002b7786d87000 2044 - - - ----- mod_info.so<br />
00002b7786f86000 8 - - - rw--- mod_info.so<br />
00002b7786f88000 44 - - - r-x-- mod_dav_fs.so<br />
00002b7786f93000 2044 - - - ----- mod_dav_fs.so<br />
00002b7787192000 8 - - - rw--- mod_dav_fs.so<br />
00002b7787194000 8 - - - r-x-- mod_vhost_alias.so<br />
00002b7787196000 2044 - - - ----- mod_vhost_alias.so<br />
00002b7787395000 8 - - - rw--- mod_vhost_alias.so<br />
00002b7787397000 28 - - - r-x-- mod_negotiation.so<br />
00002b778739e000 2044 - - - ----- mod_negotiation.so<br />
00002b778759d000 8 - - - rw--- mod_negotiation.so<br />
00002b778759f000 8 - - - r-x-- mod_dir.so<br />
00002b77875a1000 2044 - - - ----- mod_dir.so<br />
00002b77877a0000 8 - - - rw--- mod_dir.so<br />
00002b77877a2000 8 - - - r-x-- mod_actions.so<br />
00002b77877a4000 2044 - - - ----- mod_actions.so<br />
00002b77879a3000 8 - - - rw--- mod_actions.so<br />
00002b77879a5000 8 - - - r-x-- mod_speling.so<br />
00002b77879a7000 2048 - - - ----- mod_speling.so<br />
00002b7787ba7000 8 - - - rw--- mod_speling.so<br />
00002b7787ba9000 8 - - - r-x-- mod_userdir.so<br />
00002b7787bab000 2044 - - - ----- mod_userdir.so<br />
00002b7787daa000 8 - - - rw--- mod_userdir.so<br />
00002b7787dac000 12 - - - r-x-- mod_alias.so<br />
00002b7787daf000 2044 - - - ----- mod_alias.so<br />
00002b7787fae000 8 - - - rw--- mod_alias.so<br />
00002b7787fb0000 56 - - - r-x-- mod_rewrite.so<br />
00002b7787fbe000 2044 - - - ----- mod_rewrite.so<br />
00002b77881bd000 8 - - - rw--- mod_rewrite.so<br />
00002b77881bf000 64 - - - r-x-- mod_proxy.so<br />
00002b77881cf000 2044 - - - ----- mod_proxy.so<br />
00002b77883ce000 8 - - - rw--- mod_proxy.so<br />
00002b77883d0000 20 - - - r-x-- mod_proxy_balancer.so<br />
00002b77883d5000 2044 - - - ----- mod_proxy_balancer.so<br />
00002b77885d4000 8 - - - rw--- mod_proxy_balancer.so<br />
00002b77885d6000 28 - - - r-x-- mod_proxy_ftp.so<br />
00002b77885dd000 2044 - - - ----- mod_proxy_ftp.so<br />
00002b77887dc000 8 - - - rw--- mod_proxy_ftp.so<br />
00002b77887de000 24 - - - r-x-- mod_proxy_http.so<br />
00002b77887e4000 2044 - - - ----- mod_proxy_http.so<br />
00002b77889e3000 8 - - - rw--- mod_proxy_http.so<br />
00002b77889e5000 8 - - - r-x-- mod_proxy_connect.so<br />
00002b77889e7000 2044 - - - ----- mod_proxy_connect.so<br />
00002b7788be6000 8 - - - rw--- mod_proxy_connect.so<br />
00002b7788be8000 28 - - - r-x-- mod_cache.so<br />
00002b7788bef000 2044 - - - ----- mod_cache.so<br />
00002b7788dee000 8 - - - rw--- mod_cache.so<br />
00002b7788df0000 4 - - - r-x-- mod_suexec.so<br />
00002b7788df1000 2048 - - - ----- mod_suexec.so<br />
00002b7788ff1000 8 - - - rw--- mod_suexec.so<br />
00002b7788ff3000 16 - - - r-x-- mod_disk_cache.so<br />
00002b7788ff7000 2048 - - - ----- mod_disk_cache.so<br />
00002b77891f7000 8 - - - rw--- mod_disk_cache.so<br />
00002b77891f9000 8 - - - r-x-- mod_file_cache.so<br />
00002b77891fb000 2044 - - - ----- mod_file_cache.so<br />
00002b77893fa000 8 - - - rw--- mod_file_cache.so<br />
00002b77893fc000 24 - - - r-x-- mod_mem_cache.so<br />
00002b7789402000 2044 - - - ----- mod_mem_cache.so<br />
00002b7789601000 8 - - - rw--- mod_mem_cache.so<br />
00002b7789603000 20 - - - r-x-- mod_cgi.so<br />
00002b7789608000 2048 - - - ----- mod_cgi.so<br />
00002b7789808000 8 - - - rw--- mod_cgi.so<br />
00002b778980a000 8 - - - r-x-- mod_version.so<br />
00002b778980c000 2044 - - - ----- mod_version.so<br />
00002b7789a0b000 8 - - - rw--- mod_version.so<br />
00002b7789a0d000 28 - - - r-x-- mod_proxy_ajp.so<br />
00002b7789a14000 2044 - - - ----- mod_proxy_ajp.so<br />
00002b7789c13000 8 - - - rw--- mod_proxy_ajp.so<br />
00002b7789c15000 16 - - - r-x-- mod_suphp.so<br />
00002b7789c19000 2044 - - - ----- mod_suphp.so<br />
00002b7789e18000 4 - - - rw--- mod_suphp.so<br />
00002b7789e22000 40 - - - r-x-- libnss_files-2.5.so<br />
00002b7789e2c000 2044 - - - ----- libnss_files-2.5.so<br />
00002b778a02b000 4 - - - r---- libnss_files-2.5.so<br />
00002b778a02c000 4 - - - rw--- libnss_files-2.5.so<br />
00002b778a02d000 16 - - - r-x-- libnss_dns-2.5.so<br />
00002b778a031000 2044 - - - ----- libnss_dns-2.5.so<br />
00002b778a230000 4 - - - r---- libnss_dns-2.5.so<br />
00002b778a231000 4 - - - rw--- libnss_dns-2.5.so<br />
00002b778b815000 1476 - - - rw--- [ anon ]<br />
00007fff2bfcd000 84 - - - rw--- [ stack ]<br />
ffffffffff600000 8192 - - - ----- [ anon ]<br />
---------------- ------ ------ ------ ------<br />
total kB 193636 - - -<br />
<br />
-----</div></td></tr></tbody></table></div>
<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&#8242;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://cdn.saiweb.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> <span style="float: left;" ><a class="twitter-share-button"  data-via="Saiweb" data-count="horizontal" data-related="Saiweb:David Busby" data-lang="en" data-url="http://www.saiweb.co.uk/linux/optimizing-apache-for-high-load-sites-part-1" data-text="Optimizing apache for high load sites &#8211; Part 1" href="http://twitter.com/share?via=Saiweb&#038;count=horizontal&#038;related=Saiweb%3ADavid%20Busby&#038;lang=en&#038;url=http%3A%2F%2Fwww.saiweb.co.uk%2Flinux%2Foptimizing-apache-for-high-load-sites-part-1&#038;text=Optimizing%20apache%20for%20high%20load%20sites%20%26%238211%3B%20Part%201" >Tweet</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/linux/optimizing-apache-for-high-load-sites-part-1/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux &#8211; The Sysadmin script &#8211; 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 [...]]]></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>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">function appmem {<br />
if [ -z &quot;$1&quot; ]; then<br />
echo &quot;Usage: sysadmin appmem app_name i.e. (sysadmin appmem apache)&quot;;<br />
else<br />
if [ -x '/usr/bin/pmap' ]; then<br />
APID=(`ps aux | grep &quot;$1&quot; | grep -v 'grep' | grep -v &quot;$0&quot; | awk '{print $2}'`);<br />
COUNT=0;<br />
AMEM=0<br />
for PID in ${APID[@]}<br />
do<br />
TMP=$((`pmap -x $PID | grep &quot;total&quot; | awk '{print $3}'`));<br />
AMEM=$(($AMEM+$TMP));<br />
COUNT=$(($COUNT+1));<br />
done<br />
AMEM=$(($AMEM/1024));<br />
echo -e &quot;$YELLOW ----- MEMORY USAGE REPORT FOR '$1' ----- $CLEAR&quot;;<br />
echo &quot;PID Count: $COUNT&quot;;<br />
echo &quot;Mem usage: $AMEM MB&quot;;<br />
echo &quot;Mem/PID: $(($AMEM/$COUNT)) MB&quot;;<br />
echo -e &quot;$RED&quot;<br />
echo -e &quot;For more information run: pmap -x $PID $CLEAR&quot;;<br />
else<br />
echo 'Could not execute /usr/bin/pmap ... aborting';<br />
exit;<br />
fi<br />
fi<br />
}</div></td></tr></tbody></table></div>
<p>Sample output:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;span style=&quot;color: #ffcc00;&quot;&gt;----- MEMORY USAGE REPORT FOR 'apache' -----&lt;/span&gt;<br />
PID Count: 6<br />
Mem usage: 1134 MB<br />
Mem/PID: 189 MB<br />
&lt;span style=&quot;color: #ff0000;&quot;&gt;<br />
For more information run: pmap -x 123456&lt;/span&gt;</div></td></tr></tbody></table></div>
<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><span style="float: left;" ><a class="twitter-share-button"  data-via="Saiweb" data-count="horizontal" data-related="Saiweb:David Busby" data-lang="en" data-url="http://www.saiweb.co.uk/linux/linux-the-sysadmin-script-part-3" data-text="Linux &#8211; The Sysadmin script &#8211; Part 3" href="http://twitter.com/share?via=Saiweb&#038;count=horizontal&#038;related=Saiweb%3ADavid%20Busby&#038;lang=en&#038;url=http%3A%2F%2Fwww.saiweb.co.uk%2Flinux%2Flinux-the-sysadmin-script-part-3&#038;text=Linux%20%26%238211%3B%20The%20Sysadmin%20script%20%26%238211%3B%20Part%203" >Tweet</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/linux/linux-the-sysadmin-script-part-3/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</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[hacking]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Linux]]></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 [...]]]></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 &#8216;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><span style="float: left;" ><a class="twitter-share-button"  data-via="Saiweb" data-count="horizontal" data-related="Saiweb:David Busby" data-lang="en" data-url="http://www.saiweb.co.uk/security/the-zen-of-secured-shared-hosting-part-1" data-text="The zen of secured shared hosting part 1" href="http://twitter.com/share?via=Saiweb&#038;count=horizontal&#038;related=Saiweb%3ADavid%20Busby&#038;lang=en&#038;url=http%3A%2F%2Fwww.saiweb.co.uk%2Fsecurity%2Fthe-zen-of-secured-shared-hosting-part-1&#038;text=The%20zen%20of%20secured%20shared%20hosting%20part%201" >Tweet</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/security/the-zen-of-secured-shared-hosting-part-1/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>no-www.org should you participate?</title>
		<link>http://www.saiweb.co.uk/general/no-wwworg-should-you-participate</link>
		<comments>http://www.saiweb.co.uk/general/no-wwworg-should-you-participate#comments</comments>
		<pubDate>Thu, 11 Sep 2008 15:27:57 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[no-www]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/general/no-wwworg-should-you-participate</guid>
		<description><![CDATA[This question has arrived at my feet a few times now. Sould I participate with http://no-www.org/ and remove support for www. on my sites? The answer is no you shouldn&#8217;t whilst I appreciate and do belive www. has become deprecated, a LOT of end users still use www. So by removing support for this you [...]]]></description>
			<content:encoded><![CDATA[<p>This question has arrived at my feet a few times now.</p>
<p>Sould I participate with http://no-www.org/ and remove support for www. on my sites?</p>
<p>The answer is <b>no you shouldn&#8217;t</b> whilst I appreciate and do belive www. has become deprecated, a LOT of end users still use www. So by removing support for this you are excludinga potentialy large user base from reaching your website, can you as a business afford to do that &#8230; of course not!</p>
<p>So what _should_ you do?</p>
<p>In my opinion, add support for both.</p>
<p>You will see that http://saiweb.co.uk and http://www.saiweb.co.uk BOTH work, this allows both &#8220;classes&#8221; of end users to reach my website, and I have applied this principle to all sites I have recently worked on.</p>
<p>Example httpd.conf entry</p>
<p>ServerName saiweb.co.uk<br />
ServerAlias www.saiweb.co.uk</p>
<p>DNS for saiweb.co.uk is an A record to the IP of my webhost and www.saiweb.co.uk is a CNAME of saiweb.co.uk</p>
<p>This method however does not http://no-www.org/ validate as www. subdomain still exists, so don&#8217;t expect a &#8220;no-www&#8221; validated image to appear on my blog anytime soon.</p>
<p>www. may be depreciated, but businesses can not afford to exclude any potential customers, so don&#8217;t expect this no-www to become standard anytime either.</p>
<p>&#8220;July 2, 2008</p>
<p>Today we passed 38,000 domains validated through no-www. This is a nice round number so it seems worthy of tooting our horn over. &#8221;</p>
<p>As I write this there are 77,343,623 active domains (source: <a href="http://www.domaintools.com/internet-statistics/">http://www.domaintools.com/internet-statistics/</a>) making the no-www support less than 0.05% of active domains.</p>
<p>I would be intrested to know how many of this 38k domains are actual businesses, and how support no-www has affected thier online sales.</p>
<p>I can tell you however of the 300 or so domains I currently controll, non would no-www validate as they are all configured using the method above.</p>
<p>Thoughts?<span style="float: left;" ><a class="twitter-share-button"  data-via="Saiweb" data-count="horizontal" data-related="Saiweb:David Busby" data-lang="en" data-url="http://www.saiweb.co.uk/general/no-wwworg-should-you-participate" data-text="no-www.org should you participate?" href="http://twitter.com/share?via=Saiweb&#038;count=horizontal&#038;related=Saiweb%3ADavid%20Busby&#038;lang=en&#038;url=http%3A%2F%2Fwww.saiweb.co.uk%2Fgeneral%2Fno-wwworg-should-you-participate&#038;text=no-www.org%20should%20you%20participate%3F" >Tweet</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/general/no-wwworg-should-you-participate/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New host</title>
		<link>http://www.saiweb.co.uk/general/new-host</link>
		<comments>http://www.saiweb.co.uk/general/new-host#comments</comments>
		<pubDate>Thu, 20 Mar 2008 14:35:56 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mySQL]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web hosting]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/general/new-host</guid>
		<description><![CDATA[Due to latency issues, and the lack of multi site support I have ditched my old web-host.  In favour of an all singing all dancing NEW ONE! nativespace thus-far I have had excellent ticket turn around (all in 30 mins or less), and my initial sales enquiry (consisting of a lot of lengthy questions)  responded to [...]]]></description>
			<content:encoded><![CDATA[<p>Due to latency issues, and the lack of multi site support I have ditched my old web-host.</p>
<p> In favour of an all singing all dancing NEW ONE! <a href="http://my.nativespace.co.uk/aff.php?aff=044" title="nativespace advanced afordable hosting">nativespace</a> thus-far I have had excellent ticket turn around (all in 30 mins or less), and my initial sales enquiry (consisting of a lot of lengthy questions)  responded to in &#8230;. 6 minutes!</p>
<p>So thus far definitely on my recommended list<span style="float: left;" ><a class="twitter-share-button"  data-via="Saiweb" data-count="horizontal" data-related="Saiweb:David Busby" data-lang="en" data-url="http://www.saiweb.co.uk/general/new-host" data-text="New host" href="http://twitter.com/share?via=Saiweb&#038;count=horizontal&#038;related=Saiweb%3ADavid%20Busby&#038;lang=en&#038;url=http%3A%2F%2Fwww.saiweb.co.uk%2Fgeneral%2Fnew-host&#038;text=New%20host" >Tweet</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/general/new-host/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Apache, PHP Frameworks, and multi site .htaccess</title>
		<link>http://www.saiweb.co.uk/linux/apache-php-frameworks-and-multi-site-htaccess</link>
		<comments>http://www.saiweb.co.uk/linux/apache-php-frameworks-and-multi-site-htaccess#comments</comments>
		<pubDate>Mon, 17 Mar 2008 11:26:09 +0000</pubDate>
		<dc:creator>Buzz</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[AccessFileName]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[multi site]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.saiweb.co.uk/linux/apache-php-frameworks-and-multi-site-htaccess</guid>
		<description><![CDATA[If like me you have a PHP framework, that runs multiple sites, you no doubt have thought at some point in time &#8230;  &#8221;Hey I realy could do with this re-write rule on that site, but I don&#8217;t want it applying to all sites running on the same framework&#8221; Well fear not, after much head [...]]]></description>
			<content:encoded><![CDATA[<p>If like me you have a PHP framework, that runs multiple sites, you no doubt have thought at some point in time &#8230;</p>
<p><em> &#8221;Hey I realy could do with this re-write rule on that site, but I don&#8217;t want it applying to all sites running on the same framework&#8221;</em></p>
<p>Well fear not, after much head scratching, AccessFileName directive to the rescue! i.e.</p>
<p> Using the above method you can specify bespoke htaccess files on a per VirtualHost basis.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&amp;lt;VirtualHost xxx.xxx.xxx.xxx:80&amp;gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; DocumentRoot /path/to/framework<br />
&nbsp; &nbsp; &nbsp; &nbsp; ServerName buzz.saiweb.co.uk<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;strong&gt;AccessFileName .buzz_htaccess&lt;/strong&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; CustomLog logs/buzz_access_log combined<br />
&nbsp; &nbsp; &nbsp; &nbsp; ErrorLog logs/buzz_error_log<br />
&amp;lt;/VirtualHost&amp;gt;</div></td></tr></tbody></table></div>
<p> Enjoy!<span style="float: left;" ><a class="twitter-share-button"  data-via="Saiweb" data-count="horizontal" data-related="Saiweb:David Busby" data-lang="en" data-url="http://www.saiweb.co.uk/linux/apache-php-frameworks-and-multi-site-htaccess" data-text="Apache, PHP Frameworks, and multi site .htaccess" href="http://twitter.com/share?via=Saiweb&#038;count=horizontal&#038;related=Saiweb%3ADavid%20Busby&#038;lang=en&#038;url=http%3A%2F%2Fwww.saiweb.co.uk%2Flinux%2Fapache-php-frameworks-and-multi-site-htaccess&#038;text=Apache%2C%20PHP%20Frameworks%2C%20and%20multi%20site%20.htaccess" >Tweet</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.saiweb.co.uk/linux/apache-php-frameworks-and-multi-site-htaccess/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc
Database Caching 18/57 queries in 0.121 seconds using apc
Object Caching 1455/1548 objects using apc
Content Delivery Network via Rackspace Cloud Files: cdn.saiweb.co.uk

Served from: www.saiweb.co.uk @ 2012-02-08 16:14:16 -->
