<?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>david winter &#187; source</title>
	<atom:link href="http://davidwinter.me.uk/articles/tag/source/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidwinter.me.uk</link>
	<description>you were expecting someone else?</description>
	<lastBuildDate>Mon, 28 Jun 2010 20:37:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Subversion 1.4.0 from source via Apache 2.2 on Ubuntu Dapper</title>
		<link>http://davidwinter.me.uk/articles/2006/10/17/subversion-140-from-source-over-apache-22-on-ubuntu-dapper/</link>
		<comments>http://davidwinter.me.uk/articles/2006/10/17/subversion-140-from-source-over-apache-22-on-ubuntu-dapper/#comments</comments>
		<pubDate>Tue, 17 Oct 2006 12:39:42 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[dapper]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://davidwinter.me.uk/articles/2006/10/17/subversion-140-from-source-over-apache-22-on-ubuntu-dapper/</guid>
		<description><![CDATA[This howto assumes you&#8217;ve already followed my Building Apache 2.2 from source article. Now we&#8217;re going to install Subversion 1.4.0 from source so that it can be access via Apache with authentication. Installing Subversion As we&#8217;ve built Apache from source, we&#8217;ll need to do the same for Subversion in order to get the Apache 2 [...]]]></description>
			<content:encoded><![CDATA[<p>This howto assumes you&#8217;ve already followed my <a href="http://davidwinter.me.uk/articles/2006/10/17/building-apache-22-from-source-for-ubuntu-dapper/">Building Apache 2.2 from source</a>  article.</p>

<p>Now we&#8217;re going to install Subversion 1.4.0 from source so that it can be access via Apache with authentication.</p>

<p><span id="more-34"></span></p>

<h3>Installing Subversion</h3>

<p>As we&#8217;ve built Apache from source, we&#8217;ll need to do the same for Subversion in order to get the Apache 2 modules <code>mod_dav_svn</code> and <code>mod_authz_svn</code>.</p>

<pre><code>wget http://subversion.tigris.org/downloads/subversion-1.4.0.tar.gz
tar xvfz subversion-1.4.0.tar.gz
cd subversion-1.4.0/
./configure --prefix=/usr/local --with-apxs=/usr/local/apache2/bin/apxs
make
sudo make install
</code></pre>

<p>This will also add the relevant <code>LoadModule</code> directives into your Apache 2 configuration for you.</p>

<h3>Creating your repository</h3>

<p>Now, create your Subversion repository:</p>

<pre><code>svnadmin create /home/yourusername/subversion/repos
</code></pre>

<p>We have to make that repository owned by Apache so that it can be accessed via the web:</p>

<pre><code>sudo chown -R apache /home/yourusername/subversion/repos
</code></pre>

<h3>Authentication File</h3>

<p>Now create a user/password file for authentication:</p>

<pre><code>htpasswd -cm /home/yourusername/subversion/dav_svn.passwd davidwinter
</code></pre>

<p>When prompted, enter your password.</p>

<h3>Configuring Apache</h3>

<p>Edit your <code>/usr/local/apache2/conf/httpd.conf</code> file with the following placed at the end:</p>

<pre><code>&lt;Location /svn&gt;
  DAV svn
  SVNPath /home/yourusername/subversion/repos

  AuthType Basic
  AuthName "Subversion Repository"
  AuthUserFile /home/yourusername/subversion/dav_svn.passwd
  Require valid-user
&lt;/Location&gt;
</code></pre>

<p>If you want access control based on different users, add the following line after the <code>Require valid-user</code> line:</p>

<pre><code>AuthzSVNAccessFile /home/yourusername/subversion/svn_access_control
</code></pre>

<p>Save the file. Start Apache. To find out what you need to put in the <code>svn_access_control</code> file, read <a href="http://davidwinter.me.uk/articles/2006/03/03/access-control-for-subversion-with-apache2-and-authz/">my previous Subversion authentication article here</a>. for params.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidwinter.me.uk/articles/2006/10/17/subversion-140-from-source-over-apache-22-on-ubuntu-dapper/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Building Apache 2.2 from source for Ubuntu Dapper</title>
		<link>http://davidwinter.me.uk/articles/2006/10/17/building-apache-22-from-source-for-ubuntu-dapper/</link>
		<comments>http://davidwinter.me.uk/articles/2006/10/17/building-apache-22-from-source-for-ubuntu-dapper/#comments</comments>
		<pubDate>Tue, 17 Oct 2006 12:25:12 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[dapper]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://davidwinter.me.uk/articles/2006/10/17/building-apache-22-from-source-for-ubuntu-dapper/</guid>
		<description><![CDATA[Two reasons you might want to do this. You want to host a Rails application using Mongrel via Apache and mod_proxy_balancer. You&#8217;re studying in a Website administration module for your 3rd year Software Engineering degree :) Seriously though, if you don&#8217;t want to use mod_proxy_balancer, just do a normal apt-get install of Apache 2 and [...]]]></description>
			<content:encoded><![CDATA[<p>Two reasons you might want to do this.</p>

<ol>
<li>You want to host a Rails application using Mongrel via Apache and <code>mod_proxy_balancer</code>.</li>
<li>You&#8217;re studying in a Website administration module for your 3rd year Software Engineering degree :)</li>
</ol>

<p>Seriously though, if you don&#8217;t want to use <code>mod_proxy_balancer</code>, just do a normal <code>apt-get install</code> of Apache 2 and you&#8217;ll be fine. <code>mod_proxy_balancer</code> is only available for Apache 2.2, and currently, that&#8217;s not available from the Ubuntu repositories via <code>apt-get</code>.</p>

<p>This article only covers installing Apache 2.2 &#8211; I&#8217;ll write another one for getting Subversion and PHP working shortly afterwards.</p>

<p><span id="more-33"></span></p>

<h3>Workspace</h3>

<p>If you&#8217;ve not got the <code>build-essential</code> package installed yet:</p>

<pre><code>sudo apt-get install build-essential
</code></pre>

<p>It&#8217;s best to keep all of the source files in a seperate directory so they don&#8217;t mess up your home directory.</p>

<pre><code>cd
mkdir src
cd src
</code></pre>

<h3>Zlib</h3>

<p>So that Apache can compress output to browsers that support it, we&#8217;re going to install Zlib first of all:</p>

<pre><code>wget http://www.zlib.net/zlib-1.2.3.tar.gz
tar xvfz zlib-1.2.3.tar.gz
cd zlib-1.2.3/
./configure --prefix=/usr/local
make
sudo make install
</code></pre>

<h3>Apache 2.2</h3>

<p>Now download the Apache 2.2 source files:</p>

<pre><code>cd ..
wget http://apache.rmplc.co.uk/httpd/httpd-2.2.3.tar.gz
</code></pre>

<p>Extract and move into the directory:</p>

<pre><code>tar xvfz httpd-2.2.3.tar.gz
cd httpd-2.2.3/
</code></pre>

<p>Now to configure the build of Apache 2.2 that we want:</p>

<pre><code>./configure --prefix=/usr/local/apache2 --enable-mods-shared=all --enable-deflate --enable-proxy --enable-proxy-balancer --enable-proxy-http
</code></pre>

<p>Besides setting the modules we&#8217;d like installed, and the location of the install, this paramater <code>--enable-mods-shared=all</code> is telling Apache 2.2 to build modules so that they can be dynamically loaded when it is started. This means, we can add further modules to our Apache 2.2 install when we like &#8211; as we will do with the Subversion modules and PHP.</p>

<p>Once the configuration is complete:</p>

<pre><code>make
sudo make install
</code></pre>

<p>Let&#8217;s test that it&#8217;s working:</p>

<pre><code>sudo /usr/local/apache2/bin/apachectl start
</code></pre>

<p>Now navigate to <a href="http://localhost">http://localhost</a> and you should see a message saying &#8220;It works!&#8221;.</p>

<p>Stop Apache:</p>

<pre><code>sudo /usr/local/apache2/bin/apachectl stop
</code></pre>

<h3>Apache at start-up</h3>

<p>Now let&#8217;s get Apache to start at boot time automatically:</p>

<pre><code>sudo cp /usr/local/apache2/bin/apachectl /etc/init.d/apachectl
sudo chmod +x /etc/init.d/apachectl
</code></pre>

<p>What we&#8217;re doing here is copying the Apache Control script into the start-up directory.</p>

<p>We just need to add a few lines to the file for it to work nicely:</p>

<pre><code>sudo nano /etc/init.d/apachectl
</code></pre>

<p>Add the followinig, so the top of the file looks like:</p>

<pre><code>#!/bin/sh
#
# chkconfig: - 85 15
# description: Apache is a web server.
</code></pre>

<p>Save the file. </p>

<p>Now we need to register it with the start-up manager:</p>

<pre><code>sudo /usr/sbin/update-rc.d apachectl defaults
</code></pre>

<h3>Securing Apache</h3>

<p>It&#8217;s also a good idea to create a dedicate Apache system user account. It&#8217;ll make your install much more secure.</p>

<pre><code>sudo adduser --system apache
</code></pre>

<p>Now we just need to make sure that Apache runs under this user. We do that by editting the configuration file:</p>

<pre><code>sudo nano /usr/local/apache2/conf/httpd.conf
</code></pre>

<p>You need to find the lines that say:</p>

<pre><code>User daemon
Group daemon
</code></pre>

<p>And change them so they look like:</p>

<pre><code>User apache
Group nogroup
</code></pre>

<p>Save the file.</p>

<p>Now, let&#8217;s start Apache:</p>

<pre><code>sudo /usr/local/apache2/bin/apachectl start
</code></pre>

<p>Now to check it&#8217;s running under the new user, <code>apache</code>:</p>

<pre><code>ps -aux | grep httpd
</code></pre>

<p>If you see the word <code>apache</code> in there, it&#8217;s working.</p>

<h3>Check it&#8217;s all working</h3>

<p>Now just reboot the system and before logging in, check on another machine by visiting the servers IP in the web browser and you should see the &#8220;It works!&#8221; message. This means Apache started up correctly automatically.</p>

<p>Building Apache 2.2 from source. Done.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidwinter.me.uk/articles/2006/10/17/building-apache-22-from-source-for-ubuntu-dapper/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
	</channel>
</rss>
