<?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>Thijs Lensselink&#039;s Blog &#187; Apache</title>
	<atom:link href="http://lenss.nl/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://lenss.nl</link>
	<description>Webdevelopment and stuff...</description>
	<lastBuildDate>Thu, 26 Apr 2012 21:48:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Downtime</title>
		<link>http://lenss.nl/2011/05/downtime/</link>
		<comments>http://lenss.nl/2011/05/downtime/#comments</comments>
		<pubDate>Sat, 21 May 2011 09:06:40 +0000</pubDate>
		<dc:creator>Thijs Lensselink</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[dpc11]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[mod_pagespeed]]></category>

		<guid isPermaLink="false">http://lenss.nl/?p=1257</guid>
		<description><![CDATA[So lenss.nl was offline Thursday for about 5 hours. When i was getting ready for the DPC11 tutorial day i got a notification that one of my servers was down. So i quickly setup a ssh connection. And that still seemed to work. The only thing off was. Apache wasn&#8217;t running anymore. So tried a [...]]]></description>
			<content:encoded><![CDATA[<p>So lenss.nl was offline Thursday for about 5 hours. When i was getting ready for the <a href="http://www.phpconference.nl/">DPC11</a> tutorial day i got a notification that one of my servers was down. So i quickly setup a ssh connection. And that still seemed to work. The only thing off was. Apache wasn&#8217;t running anymore. So tried a restart. And was unpleasantly surprised by the result. Which looked something like this.</p>
<blockquote><p>/usr/sbin/apache2ctl line 82 (core dumped) $HTTPD ${APACHE_ARGUMENTS} -k $ARGV</p></blockquote>
<p>Googling didn&#8217;t provide any useful information about the issue. So i contacted support and asked them to take a look at it. So i could move in the direction of the DPC11. After some horrible traffic and a closed road due to an accident. I finally made it to the DPC 2 hours late. But when i plugged my laptop in i noticed apache was still not running. Contacted support again. They couldn&#8217;t find any serious issues. I already missed the first part of &#8220;<a href="http://www.phpconference.nl/tutorials#optimizing-mysql-essentials">Optimizing MySQL Essentials</a>&#8220;. So decided to do the tutorial first. </p>
<p>While i was sitting there i got the idea of disabling the apache modules. Which turned out to be a good idea. So after the tutorial session finished i logged in to the server. Disabled all apache modules and got apache working again. After some testing the cause of the problem seemed to be the Google <a href="http://code.google.com/p/modpagespeed/">mod_pagespeed</a> apache module. That&#8217;s the second time this happened after a upgrade. Will leave it disabled for now. </p>
<p>On a side note.. Where is all the direct traffic coming from all of the sudden?</p>
]]></content:encoded>
			<wfw:commentRss>http://lenss.nl/2011/05/downtime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google mod_pagespeed continued</title>
		<link>http://lenss.nl/2010/11/google-mod_pagespeed-continued/</link>
		<comments>http://lenss.nl/2010/11/google-mod_pagespeed-continued/#comments</comments>
		<pubDate>Thu, 11 Nov 2010 10:08:45 +0000</pubDate>
		<dc:creator>Thijs Lensselink</dc:creator>
				<category><![CDATA[/home]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[mod_pagespeed]]></category>
		<category><![CDATA[vhost]]></category>

		<guid isPermaLink="false">http://lenss.nl/?p=927</guid>
		<description><![CDATA[Last week i toyed with mod_pagespeed a bit. But just couldn&#8217;t get the hang of it. So the last two days permitted me to play some more with this great Apache module. Only this time i choose to build from source and ignore the binaries for a while. For me the main problem was. As [...]]]></description>
			<content:encoded><![CDATA[<p>Last week i <a href="http://lenss.nl/2010/11/google-mod_pagespeed/">toyed</a> with <a href="http://code.google.com/p/modpagespeed/">mod_pagespeed</a> a bit. But just couldn&#8217;t get the hang of it. So the last two days permitted me to play some more with this great Apache module. Only this time i choose to <a href="http://code.google.com/p/modpagespeed/wiki/HowToBuild">build from source</a> and ignore the binaries for a while. </p>
<p>For me the main problem was. As soon as i enabled the module. It was active for all sites running on this server. And that should not be a problem. But some of these sites are WordPress monsters. That are ready to take any server down with a bit of high load.</p>
<p>So after a bit of trail and error. I figured out i could just disable mod_pagespeed globally by altering the main config file. After Apache reloaded mod_pagespeed was not active for the running sites.</p>
<p>in /etc/apache2/mods-available/pagespeed.conf make sure ModPagespeed is set to &#8216;off&#8217;</p>
<blockquote><p>ModPagespeed off</p></blockquote>
<p>So now i can simply enable settings i need on a per vhost basis. For this site end some other sites i used the following config section in my vhost.</p>
<blockquote><p># MOD-pagespeed<br />
        <IfModule pagespeed_module><br />
            SetOutputFilter MOD_PAGESPEED_OUTPUT_FILTER<br />
            ModPagespeed on</p>
<p>            ModPagespeedUrlPrefix                &#8220;http://lenss.nl&#8221;</p>
<p>            ModPagespeedFileCachePath            &#8220;/var/mod_pagespeed/cache/&#8221;<br />
            ModPagespeedGeneratedFilePrefix      &#8220;/var/mod_pagespeed/files/&#8221;</p>
<p>            #ModPagespeedRewriteLevel CoreFilters<br />
            ModPagespeedRewriteLevel PassThrough</p>
<p>            ModPagespeedEnableFilters add_head<br />
            ModPagespeedEnableFilters collapse_whitespace<br />
            ModPagespeedEnableFilters elide_attributes<br />
            ModPagespeedEnableFilters remove_comments<br />
            ModPagespeedEnableFilters rewrite_css<br />
            ModPagespeedEnableFilters rewrite_javascript<br />
            ModPagespeedEnableFilters move_css_to_head<br />
        </IfModule></p></blockquote>
<p>First of we enable mod_pagespeed of course. And then we set the current domain for this instance. After that we set the file paths for the altered and cached files. And we use &#8216;PassThrough&#8217; instead of &#8216;CoreFilters&#8217;. So we can decide our self&#8217;s what filters we will be using.</p>
<p>This had a much better result then my previous attempts. The server was still happily serving pages. And the load was OK. So let&#8217;s check the sites if mod_pagespeed is actually running.</p>
<blockquote><p>$ wget -O /dev/null &#8211;server-response http://lenss.nl 2>&#038;1| grep -i &#8216;X-Mod-Pagespeed&#8217;<br />
  X-Mod-Pagespeed: 0.9.0.0-172</p></blockquote>
<p>Well that looks good. So now it&#8217;s time to do some testing. And this leaves me with a bit of a pickle. As i don&#8217;t have the required wget v 1.12 (i have a small patch for wget v1.11). Besides that i have some other problems running the tests</p>
<blockquote><p>TEST: 404s are served and properly recorded.<br />
      wget -O /dev/null http://lenss.nl/mod_pagespeed/ic.a.bad.css 2>&#038;1| grep -q &#8217;404 Not Found&#8217;<br />
      wget -q -O &#8211; &#8211;save-headers http://localhost:80/mod_pagespeed_statistics | grep -q &#8216;resource_404_count: 1&#8242;<br />
FAIL.</p></blockquote>
<p>This fails because the statistics page requested is not available because this site uses rewrites. And i haven&#8217;t found a way to go around this yet besides disabling them in .htaccess with mod_rewrite. So shortly disabling this made it possible to run the biggest part of the test suite without problems. </p>
<blockquote><p>resource_fetches: 2<br />
total_page_load_ms: 0<br />
page_load_count: 0<br />
cache_extensions: 0<br />
not_cacheable: 0<br />
css_file_count_reduction: 0<br />
css_filter_files_minified: 13<br />
css_filter_minified_bytes_saved: 5082<br />
css_filter_parse_failures: 0<br />
css_elements: 0<br />
image_inline: 0<br />
image_rewrite_saved_bytes: 0<br />
image_rewrites: 0<br />
javascript_blocks_minified: 15<br />
javascript_bytes_saved: 380<br />
javascript_minification_failures: 0<br />
javascript_total_blocks: 15<br />
resource_url_domain_rejections: 0<br />
url_trims: 0<br />
url_trim_saved_bytes: 0<br />
resource_404_count: 2<br />
slurp_404_count: 0<br />
serf_fetch_request_count: 0<br />
serf_fetch_bytes_count: 0<br />
serf_fetch_time_duration_ms: 0<br />
serf_fetch_cancel_count: 0</p></blockquote>
<p>It fails on the image compression part and that&#8217;s fine. Because i will leave that for later. So let&#8217;s run the site through the pagespeed browser extension with mod_pagespeed disabled:</p>
<blockquote><p>load time without : 2.193<br />
firebug/pagespeed score : 68</p></blockquote>
<p>Now the same thing but with mod_pagespeed enabled:</p>
<blockquote><p>Load time with : 1.284<br />
firebug/pagespeed score : 90</p></blockquote>
<p>That looks pretty good. And the other sites i have tested preform way better with the mod_pagespeed module enabled.</p>
<p>I still have some Javascript issues. Some things need further inspection because i have seen error like these coming along:</p>
<blockquote><p>Permission denied for <http://googleads.g.doubleclick.net> to call method Location.toString on <http://lenss.nl>.</p></blockquote>
<p>Besides that. This morning my site was down due to Apache spitting segfaults. I disabled the &#8216;rewrite_javascript&#8217; filter for now. And it seems to run a bit more stable.</p>
<blockquote><p>[Thu Nov 11 07:38:24 2010] [notice] child pid 23608 exit signal Segmentation fault (11)</p></blockquote>
<p>So besides it being a beta i am pretty impressed by the current state of this module. And after running it for a couple of weeks the statistics are pretty impressive.</p>
<p><img src="http://lenss.nl/wp-content/uploads/2010/12/page-speed.jpg" width="400" /></p>
<p>Manuel Lemos also wrote a nice article about <a href="http://www.phpclasses.org/blog/post/135-Accelerate-Web-Pages-Automatically-using-Google-ModPageSpeed-Unusual-Site-Speedup-Techniques-Part-4.html">mod_pagespeed</a> which is worth reading.</p>
]]></content:encoded>
			<wfw:commentRss>http://lenss.nl/2010/11/google-mod_pagespeed-continued/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google mod_pagespeed</title>
		<link>http://lenss.nl/2010/11/google-mod_pagespeed/</link>
		<comments>http://lenss.nl/2010/11/google-mod_pagespeed/#comments</comments>
		<pubDate>Thu, 04 Nov 2010 21:05:42 +0000</pubDate>
		<dc:creator>Thijs Lensselink</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[mod_pagespeed]]></category>
		<category><![CDATA[optimisation]]></category>

		<guid isPermaLink="false">http://lenss.nl/?p=898</guid>
		<description><![CDATA[Yesterday Google released a beta version of their upcoming Apache module mod_pagespeed. And this seems like a very promising project indeed. It mainly is a suite that provides web optimisation features to make your sites run faster. Right now 15 of such features are available. including optimising caching, minimising client-server round trips and minimising payload [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday Google <a href="http://googlewebmastercentral.blogspot.com/2010/11/make-your-websites-run-faster.html">released</a> a <strong>beta</strong> version of their upcoming Apache module <a href="http://code.google.com/speed/page-speed/docs/using_mod.html">mod_pagespeed</a>.</p>
<p>And this seems like a very promising project indeed. It mainly is a suite that provides web optimisation features to make your sites run faster. Right now 15 of such features are available.</p>
<blockquote><p>including optimising caching, minimising client-server round trips and minimising payload size.</p></blockquote>
<p>So no more manual image compressing and javascript, html and css minifying.</p>
<p>It uses the Apache <em>SetOutputFilter</em> to register the output filter. And from thereon you can use <em>ModPagespeedEnableFilters</em> to enable certain filters. </p>
<p>Filters like:</p>
<blockquote><p><strong>add_head</strong><br />
<em>Add the head section if missing</em></p>
<p><strong>move_css_to_head</strong><br />
<em>Moves CSS into the head of the page (needs add_head)</em></p>
<p><strong>combine_css</strong><br />
<em>Combine multiple CSS tags into one.</em></p>
<p><strong>rewrite_css,rewrite_javascript</strong><br />
<em>Remove comments and white spaces</em></p>
<p><strong>rewrite_images</strong><br />
<em>Compress / re encode images</em></p></blockquote>
<p>More info about the filters can be found <a href="http://code.google.com/speed/page-speed/docs/filters.html">here</a></p>
<p>So i went ahead and <a href="http://code.google.com/speed/page-speed/download.html">downloaded</a> the Debian version to give it a try. And as always it&#8217;s straight forward from here.</p>
<blockquote><p>dpkg -i mod-pagespeed-beta_current_i386.deb</p></blockquote>
<p>It hooks nicely into Apache and creates the .load and .conf files in <em>/etc/apache2/mods-available</em>. After a Apache restart everything looked fine. And the pages did seem to load faster. Google also offers a <a href="http://www.modpagespeed.com/">test suite</a> to see the result of this module in action.</p>
<p>Running the tests showed a small speed increase. But at the moment my daytime hours are spend behind a horrible firewall that really screws with web output. So i have to redo those for more accurate results. Never the less. This is a module to keep an eye on.</p>
<p>It&#8217;s still a very young project. And i did have some server issues today. So related or not. Be careful :)</p>
]]></content:encoded>
			<wfw:commentRss>http://lenss.nl/2010/11/google-mod_pagespeed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Speed up and save traffic with Apache and mod_deflate</title>
		<link>http://lenss.nl/2009/02/speed-up-and-save-traffic-with-apache-and-mod_deflate/</link>
		<comments>http://lenss.nl/2009/02/speed-up-and-save-traffic-with-apache-and-mod_deflate/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 08:59:53 +0000</pubDate>
		<dc:creator>Thijs Lensselink</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[mod-rewrite]]></category>
		<category><![CDATA[mod_deflate]]></category>

		<guid isPermaLink="false">http://lenss.nl/?p=271</guid>
		<description><![CDATA[One of our sites was loading pretty slow. This is mostly caused by a very heavy design. But i still wanted to speed things up a bit. The first step was compressing all JavaScript files with the Yahoo YUI compressor. The next step was to activate mod_deflate and compress all text, XML, and media files [...]]]></description>
			<content:encoded><![CDATA[<p>One of our sites was loading pretty slow. This is mostly caused by a very heavy design. But i still wanted to speed things up a bit.</p>
<p>The first step was compressing all JavaScript files with the <a href="http://developer.yahoo.com/yui/compressor/">Yahoo YUI compressor</a>. The next step was to activate mod_deflate and compress all text, XML, and media files (JavaScript, CSS).</p>
<p>When the mod_deflate module is loaded in apache this is a pretty easy thing to do. Just add the following lines to a .htaccess file in the root of the web site / application.</p>
<blockquote><p>AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css<br />
BrowserMatch ^Mozilla/4 gzip-only-text/html<br />
BrowserMatch ^Mozilla/4\.0[678] no-gzip<br />
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html</p></blockquote>
<p>The first line enables mod_deflate for the specified extensions. And the other three lines are there because of the way some older browsers handle gzipped data.</p>
<p>To test if the the content is transmitted over the line in gzipped format i used the <a href="https://addons.mozilla.org/en-US/firefox/addon/3829">Live HTTP Header</a> Firefox extensions. This let&#8217;s you watch the Live HTTP headers as the fly by. </p>
<p>Check the HTTP/ 1.x 200 OK response from the webserver for the following line</p>
<blockquote><p>
Content-Encoding: gzip
</p></blockquote>
<p>And to test what happens if a browser doesn&#8217;t support gzipped data. You can set a configuration parameter in Firefox <a href="http://kb.mozillazine.org/Firefox_:_FAQs_:_About:config_Entries">about:config</a>.</p>
<p>gzip, deflate enabled:</p>
<blockquote><p>
network.http.accept-encoding = gzip,deflate</p></blockquote>
<p>gzip, deflate disabled:</p>
<blockquote><p>
network.http.accept-encoding = </p></blockquote>
<p>References :<br />
<a href="http://www.howtoforge.com/apache2_mod_deflate">http://www.howtoforge.com/apache2_mod_deflate</a></p>
]]></content:encoded>
			<wfw:commentRss>http://lenss.nl/2009/02/speed-up-and-save-traffic-with-apache-and-mod_deflate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>301 Redirect losing POST data</title>
		<link>http://lenss.nl/2009/02/301-redirct-losing-post-data/</link>
		<comments>http://lenss.nl/2009/02/301-redirct-losing-post-data/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 13:47:23 +0000</pubDate>
		<dc:creator>Thijs Lensselink</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[POST]]></category>

		<guid isPermaLink="false">http://lenss.nl/?p=320</guid>
		<description><![CDATA[Earlier this week i implemented the forcing of trailing slashes for some websites. And this worked out great. But today one of the ladies here at the office noticed the contact form on one site wasn&#8217;t functioning properly anymore. So i did some debugging and quickly came to the conclusion the POST data array was [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier this week i implemented the forcing of trailing slashes for some websites. And this worked out great.<br />
But today one of the ladies here at the office noticed the contact form on one site wasn&#8217;t functioning properly anymore. </p>
<p>So i did some debugging and quickly came to the conclusion the POST data array was empty after a submit of the form. That&#8217;s weird i thought. And didn&#8217;t really have a clue where to start looking. The code wasn&#8217;t touched for a couple of weeks. Bu then i remembered adding the forcing of the trailing slash.</p>
<p>So i browsed to the contact form and did a view source. And there was the problem. The form submitted to </p>
<blockquote><p>/contact/verstuurd</p></blockquote>
<p>A URL without a trailing slash. This causes apache to rewrite the url to </p>
<blockquote><p>/contact/verstuurd/</p></blockquote>
<p>And this also seems to turn the POST into a GET request.</p>
<p>So to fix it just changed to URL in the form to reflect the correct end point. But i have to say i didn&#8217;t expect this to happen. I understand why it happens. And it&#8217;s pretty logical. But i wonder if there&#8217;s a way around this behavior?</p>
]]></content:encoded>
			<wfw:commentRss>http://lenss.nl/2009/02/301-redirct-losing-post-data/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Forcing a trailing slash with mod_rewrite</title>
		<link>http://lenss.nl/2009/02/forcing-a-trailing-slash-with-mod_rewrite/</link>
		<comments>http://lenss.nl/2009/02/forcing-a-trailing-slash-with-mod_rewrite/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 11:29:37 +0000</pubDate>
		<dc:creator>Thijs Lensselink</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[slash]]></category>
		<category><![CDATA[trailing]]></category>

		<guid isPermaLink="false">http://lenss.nl/?p=276</guid>
		<description><![CDATA[I&#8217;m doing some SEO optimization for a couple of websites. And one of the small steps is to force a trailing slash on all URL&#8217;s that do not point to a file on the server. The reason I&#8217;m doing this is to go around the duplicate content problem. /trip/80 /trip/80/ Both point to the same [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m doing some <a href="http://en.wikipedia.org/wiki/Search_engine_optimization">SEO</a> optimization for a couple of websites. And one of the small steps is to force a trailing slash on all URL&#8217;s that do not point to a file on the server. The reason I&#8217;m doing this is to go around the duplicate content problem.</p>
<blockquote><p>/trip/80<br />
/trip/80/</p></blockquote>
<p>Both point to the same content. But a <a href="http://en.wikipedia.org/wiki/Web_crawler">crawler</a> would see this as two different URL&#8217;s. Which off course is correct. But this can lead to duplicate content being indexed in search engines. Which could result in penalties for the site in question. So to fix this problem we add three simple lines to the main .htaccess file</p>
<blockquote><p># If a requested file does not exists<br />
RewriteCond %{REQUEST_FILENAME} !-f</p>
<p># If a requested directory does not exist<br />
RewriteCond %{REQUEST_FILENAME} !-d</p>
<p># Force a trailing slash to the request<br />
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://lenss.nl/2009/02/forcing-a-trailing-slash-with-mod_rewrite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
