<?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>underdevelopment &#187; apache2</title>
	<atom:link href="http://www.underdevelopment.eu/category/apache2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.underdevelopment.eu</link>
	<description>web development blog</description>
	<lastBuildDate>Fri, 12 Nov 2010 18:48:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>the incredibly lazy guide to installing mod_pagespeed</title>
		<link>http://www.underdevelopment.eu/2010/11/12/the-incredibly-lazy-guide-to-installing-mod_pagespeed/</link>
		<comments>http://www.underdevelopment.eu/2010/11/12/the-incredibly-lazy-guide-to-installing-mod_pagespeed/#comments</comments>
		<pubDate>Fri, 12 Nov 2010 18:48:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[apache2]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[mod_pagespeed]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.underdevelopment.eu/?p=280</guid>
		<description><![CDATA[You hate reading? you want to try out mod_pagespeed? you run a ubuntu or other debian based server? Well then just follow the following steps. get the binary package based on your architecture. (to check which one run &#8220;uname -m&#8221;. If it says x86_64, they you have a 64bit server) 64 bit. wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_amd64.deb 32 [...]]]></description>
			<content:encoded><![CDATA[<p>You hate reading? you want to try out mod_pagespeed? you run a ubuntu or other debian based server? Well then just follow the following steps.</p>
<ol>
<li>get the binary package based on your architecture. (to check which one run &#8220;uname -m&#8221;. If it says x86_64, they you have a 64bit server)
<ul>
<li>64 bit.
<pre>wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_amd64.deb</pre>
</li>
<li>32 bit.
<pre>wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-beta_current_i386.deb</pre>
</li>
</ul>
</li>
<li>install the package (substitute am64.deb with i386.deb if you don&#8217;t have a 64bit version)
<pre>sudo dpkg -i mod-pagespeed-beta_current_amd64.deb</pre>
</li>
<li>open up the following file with your favorite editor
<pre>/etc/apache2/mods-available/pagespeed.conf</pre>
</li>
<li>add all the cool features you want, i currently run this. (line 47 in the file, but it doesn&#8217;t really matter)
<pre>ModPagespeedEnableFilters collapse_whitespace,elide_attributes
ModPagespeedEnableFilters combine_css,rewrite_css,move_css_to_head,inline_css
ModPagespeedEnableFilters rewrite_javascript,inline_javascript
ModPagespeedEnableFilters rewrite_images,insert_img_dimensions
ModPagespeedEnableFilters extend_cache
ModPagespeedEnableFilters remove_quotes,remove_comments</pre>
</li>
<li>restart apache
<pre>sudo service apache2 restart</pre>
</li>
<li>done.</li>
</ol>
<p>I haven&#8217;t fully looked into mod_pagespeed and all its filters and implications there of myself, but I always like following these kinds of lazy quick guides myself to start poking around instead of actually reading something for a change. So i figured I should just make one as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.underdevelopment.eu/2010/11/12/the-incredibly-lazy-guide-to-installing-mod_pagespeed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up simple but easy to work with LAMP development environment</title>
		<link>http://www.underdevelopment.eu/2009/08/13/setting-up-simple-but-easy-to-work-with-lamp-development-environment/</link>
		<comments>http://www.underdevelopment.eu/2009/08/13/setting-up-simple-but-easy-to-work-with-lamp-development-environment/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 21:35:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[apache2]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[pragmatic programmer]]></category>
		<category><![CDATA[sshfs]]></category>
		<category><![CDATA[subclipse]]></category>

		<guid isPermaLink="false">http://www.underdevelopment.eu/?p=103</guid>
		<description><![CDATA[I&#8217;ve recently changed the way I work so I figured I would detail it here. First off all let me describe the setup. Basically all my code resides in a subversion repository on server X. My development environment is a virtual server run on virtualbox, a default ubuntu server with a LAMP stack. On my [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently changed the way I work so I figured I would detail it here.</p>
<p>First off all let me describe the setup. Basically all my code resides in a subversion repository on server X.  My development environment is a virtual server run on virtualbox, a default ubuntu server with a LAMP stack. On my client I run the PDT edition of eclipse with subclips installed.</p>
<p><strong>The client side:</strong></p>
<ul>
<li>Install PDT eclipse, you can download it from <a href="http://www.eclipse.org/pdt/downloads/" >http://www.eclipse.org/pdt/downloads/</a>.</li>
<li>Go to <a href="http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA" />http://subclipse.tigris.org/</a> and follow the text to install it into your eclipse installation.</li>
<li>In your eclipse choose import from the file menu and select &#8220;checkout project from SVN&#8221;</li>
<li>You now should have a checkout on disk inside a project to work from in eclipse</li>
</ul>
<p><strong>Development environment side:</strong></p>
<ul>
<li>Create and setup a LAMP based virtual server.  (I&#8217;m going to assume ubuntu because that&#8217;s what I&#8217;ve used)</li>
<li>Create a virtual host for your project.</li>
</ul>
<p><strong>The actual interesting bit:</strong></p>
<p>Now the above is really standard stuff, so that&#8217;s why it&#8217;s a bit brief, but now comes the interesting bit.</p>
<p>What we want to do is mount the code checkout from your client machine as the serving directory of your development environment. Because I&#8217;m lazy I want to be able to do this with one click of the button, so we are going to break some security things to be able to do this via the browser.</p>
<p>We want the apache user (www-data in my case) to be able to mount via sshfs and unmount. This will enable it to mount the checkout from my client pc to the serving directory of apache on the virtual server.</p>
<p>First we want to add www-data to the fuse usergroup, we do this via the following command.</p>
<blockquote><p><code>sudo usermod -G fuse www-data</code></p></blockquote>
<p>Now the www-data user will be allowed to use sshfs.</p>
<p>Next we create the file <em>/var/www/index.php</em> and put some code into it. The following code is really simple and could probably be made more elegant but currently I don&#8217;t care <img src='http://www.underdevelopment.eu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<blockquote><p><code><br />
&lt;?</p>
<p>if ($_GET['mount']=='myproject' )<br />
&nbsp;&nbsp;`sshfs user@192.168.1.20:/home/demo/workspace/myproject /var/www/myproject`;</p>
<p>if ($_GET['umount']=='myproject')<br />
&nbsp;&nbsp;`sudo umount /var/www/myproject/`;</p>
<p>if (is_file('/var/www/myproject/index.php'))<br />
{<br />
?&gt;<br />
myproject is currently mounted -- &lt;a href="?umount=myproject" /&gt;umount&lt;/a&gt;<br />
&lt;?<br />
}else{<br />
?&gt;<br />
myproject is currently not mounted -- &lt;a href="?mount=myproject" /&gt;mount&lt;/a&gt;<br />
&lt;?<br />
}<br />
</code></p></blockquote>
<p>What this allows us to do is to go to the default hosts index.php and remotely tell the server to mount or unmount the environment. There are a few things we need to do to actually make the above code work though.</p>
<p>First the mounting.<br />
sshfs uses ssh, so since we want to use it without user interaction we need to create a private and public key for www-data. </p>
<blockquote><p><code><br />
sudo su - www-data<br />
/bin/bash<br />
ssh-keygen<br />
</code></p></blockquote>
<p>After that you should have a set of keys, then copy the public key to your client and add it in <em>~/.ssh/authorized_keys</em> of the user you need to log into.</p>
<p>Now the mounting of the repository should work. </p>
<p>However for the unmounting we need to use sudo to get the rights to do that. So for that we need to edit /etc/sudoers on the virtual server and add the following line somewhere.</p>
<blockquote><p><code>www-data ALL = NOPASSWD: ALL</code></p></blockquote>
<p>Yes, it would be much safer to not allow ALL, but only the umount, but for my virtual development box i&#8217;m really not concerned with security, I just want a trouble free and quick fix.</p>
<p>So now I created a simple script that will let me mount and unmount my working copy of the code on the virtual server.</p>
<p>I typed this all up rather quickly so if anyone wants some parts explained in some more detail just leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.underdevelopment.eu/2009/08/13/setting-up-simple-but-easy-to-work-with-lamp-development-environment/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Improving your websites performance</title>
		<link>http://www.underdevelopment.eu/2009/02/23/improving-your-websites-performance/</link>
		<comments>http://www.underdevelopment.eu/2009/02/23/improving-your-websites-performance/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 16:22:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[apache2]]></category>
		<category><![CDATA[mod_deflate]]></category>
		<category><![CDATA[mod_expires]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.underdevelopment.eu/?p=49</guid>
		<description><![CDATA[I recently switched hosting for my websites, and with that I of course made all those little changes again to fine tune my performance. This seemed like nice enough info to share with you. Most of the points are already widely known, but it never hurts to have them listed again. First up in the [...]]]></description>
			<content:encoded><![CDATA[<p>I recently switched hosting for my websites, and with that I of course made all those little changes again to fine tune my performance. This seemed like nice enough info to share with you. Most of the points are already widely known, but it never hurts to have them listed again.</p>
<p>First up in the list is gzip compression of text documents. It saves both time and preconscious bandwidth. For this you will need to enable a apache module that&#8217;s probably already available to you. <strong><a href="http://httpd.apache.org/docs/2.2/mod/mod_deflate.html" target="_blank" >mod_deflate</a></strong></p>
<p>Depending on your distro/installation you can either enable this by adding it to your apache config, or by using the following command.</p>
<blockquote><p><code>a2enmod deflate</code></p></blockquote>
<p>After having enabled this module you should check its configuration. The configuration should either be in your main apache2 conf file, or in a file that gets included. It should look something like this.</p>
<blockquote><p><code>AddOutputFilterByType DEFLATE text/html text/plain text/xml</code></p></blockquote>
<p>Now the default is nice, but there are more files that are only text like CSS files and javascript files. So we edit that line to read the following.</p>
<blockquote><p><code>AddOutputFilterByType&nbsp;DEFLATE&nbsp;text/html&nbsp;text/plain&nbsp;text/xml&nbsp;<strong>text/css&nbsp;application/javascript</strong></code></p></blockquote>
<p>Now all files with those mime types will be compressed, saving you precious bandwidth and transfer time.</p>
<p>Another tweak I made is the enabling of <strong><a href="http://httpd.apache.org/docs/2.2/mod/mod_expires.html" target="_blank">mod_expires</a></strong>. Add it just like you added mod_deflate. After adding this mod you should hunt around for default configuration options that will probably include &#8220;ExpiresDefault&#8221;. My ubuntu based installation didn&#8217;t have this, so I added it myself. You can just add this in the server configuration file if you want. Personally I created a /etc/apache2/conf.d/expires file, because that&#8217;s how my setup works.</p>
<blockquote><p><code>ExpiresActive on<br />
ExpiresDefault "now plus 1 months"<br />
ExpiresByType text/html "now plus 1 days"</code></p></blockquote>
<p>You will have to experiment with this to find the values that you are comfortable with, I prefer to set them pretty liberal. What this means is that the contents of the requested file will not be transferred to the client before that time has passed. Which again means less bandwidth and more speed.</p>
<p>In my case, all static resources like CSS, javascript and images will be cached for a month, and the document itself will be cached for a day.</p>
<p>There are many more performance tweaks to be made, but for now I&#8217;ll leave it at this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.underdevelopment.eu/2009/02/23/improving-your-websites-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

