<?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; dapper</title>
	<atom:link href="http://davidwinter.me.uk/articles/tag/dapper/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>Unix Disk Usage</title>
		<link>http://davidwinter.me.uk/articles/2007/01/21/unix-disk-usage/</link>
		<comments>http://davidwinter.me.uk/articles/2007/01/21/unix-disk-usage/#comments</comments>
		<pubDate>Sun, 21 Jan 2007 12:28:36 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[command line]]></category>
		<category><![CDATA[dapper]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://davidwinter.me.uk/articles/2007/01/21/unix-disk-usage/</guid>
		<description><![CDATA[A very handy command to see the total size of a directory on a Unix-based computer. du -sh * This will show the total size of files and directories in your current working directory. The s flag means to show a summary&#8211;which basically just shows the top level directory only, instead of the contents of [...]]]></description>
			<content:encoded><![CDATA[<p>A very handy command to see the total size of a directory on a Unix-based computer.</p>

<pre><code>du -sh *
</code></pre>

<p>This will show the total size of files and directories in your current working directory. The <code>s</code> flag means to show a summary&#8211;which basically just shows the top level directory only, instead of the contents of each and every folder down the file system hierarchy. The <code>h</code> flag shows a human readable file size.</p>

<p>For my home directory, I get the following output:</p>

<pre><code>404M    Desktop
 30G    Documents
6.0G    Library
 32G    Movies
 18G    Music
 11G    Pictures
2.7G    Projects
 16K    Public
166M    Sites
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://davidwinter.me.uk/articles/2007/01/21/unix-disk-usage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Ubuntu Dapper to dance with ATI X800 GTO</title>
		<link>http://davidwinter.me.uk/articles/2006/10/25/getting-ubuntu-dapper-to-dance-with-ati-x800-gto/</link>
		<comments>http://davidwinter.me.uk/articles/2006/10/25/getting-ubuntu-dapper-to-dance-with-ati-x800-gto/#comments</comments>
		<pubDate>Wed, 25 Oct 2006 18:54:07 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[dapper]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://davidwinter.me.uk/articles/2006/10/25/getting-ubuntu-dapper-to-dance-with-ati-x800-gto/</guid>
		<description><![CDATA[I&#8217;ve made a brand new spare PC that I&#8217;m hoping my parents can use in their spare room/study. I refuse to install Windows, but as everyone knows, I&#8217;m a keen Ubuntu fan. My younger brother donated me his &#8220;old&#8221; ATI Radeon X800 GTO graphics card to use in it (I want to eventually get XGL [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve made a brand new spare PC that I&#8217;m hoping my parents can use in their spare room/study. I refuse to install Windows, but as everyone knows, I&#8217;m a keen Ubuntu fan.</p>

<p>My younger brother donated me his &#8220;old&#8221; ATI Radeon X800 GTO graphics card to use in it (I want to eventually get XGL + Compiz set-up on it for all the neat eye candy). Thing is, Ubuntu and the card don&#8217;t play nice straight away. Here&#8217;s how I got them to dance.</p>

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

<p><strong>Note:</strong> This was from a fresh install of Ubuntu Dapper.</p>

<p>Boot from the Ubuntu install CD and when you&#8217;re presented with the install options, select &#8220;Safe Graphics Mode&#8221;. This will let Ubuntu run using your ATI card and some safe graphics drivers &#8211; you only need this so that you can complete the installation.</p>

<p>When the live CD environment has loaded and you see the desktop, run the &#8216;Install&#8217; program from the desktop as-per-normal. Once it&#8217;s completed it&#8217;s best to upgrade Dapper to the latest version. You can either do this from the Terminal or via the notification bubble that pops up in the menu bar:</p>

<pre><code>sudo apt-get update
</code></pre>

<p>You&#8217;ll probably need to reboot once that&#8217;s done because a new kernel (I&#8217;m guessing) has been installed. Once you&#8217;ve rebooted, type in a Terminal window:</p>

<pre><code>sudo apt-get install xorg-driver-fglrx
sudo aticonfig --initial
sudo aticonfig --overlay-type=Xv
</code></pre>

<p>This downloads and sets up the ATI proprietary drivers for you.</p>

<p>Now just restart the window environment by hitting CTRL + ALT + BACKSPACE on your keyboard. The screen will go to a normal command line login type screen for about 30 seconds or less. Then the desktop will appear again. You&#8217;re now running Ubuntu with the ATI drivers. Bravo!</p>

<p>This was a must for me as I have bought a a nice 19&#8243; widescreen flatscreen monitor &#8211; and unless I installed the drivers, I couldn&#8217;t get the nice big resolutions. Now I have a lovely 1440 x 900 res. Lovely jubbly.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidwinter.me.uk/articles/2006/10/25/getting-ubuntu-dapper-to-dance-with-ati-x800-gto/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<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>
		<item>
		<title>Ubuntu Dapper Web Server How-to</title>
		<link>http://davidwinter.me.uk/articles/2006/08/09/ubuntu-dapper-web-server-how-to/</link>
		<comments>http://davidwinter.me.uk/articles/2006/08/09/ubuntu-dapper-web-server-how-to/#comments</comments>
		<pubDate>Wed, 09 Aug 2006 09:11:32 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[dapper]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://davidwinter.me.uk/articles/2006/10/13/ubuntu-dapper-web-server-how-to/</guid>
		<description><![CDATA[It&#8217;s finally here, my updated how-to on how to get Ubuntu Dapper up and running as a home web server. Perfect for hosting those small web sites and blogs. My original Ubuntu 5.10 web server how-to is still available. This updated version is very similar to the 5.10 how-to, however, there are a few changes [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s finally here, my updated how-to on how to get Ubuntu Dapper up and running as a home web server. Perfect for hosting those small web sites and blogs. My original <a href="http://davidwinter.me.uk/articles/2006/02/05/ubuntu-5-10-web-server-howto">Ubuntu 5.10 web server how-to</a> is still available.</p>

<p>This updated version is very similar to the 5.10 how-to, however, there are a few changes required. The following changes have been made:</p>

<ul>
<li>Setting up the Multiverse and Universe repositories</li>
<li>The packages to install Ruby</li>
<li>Setting a symbolic link for Ruby</li>
<li>Updating rubygems</li>
<li>Clearing the rubygems cache</li>
</ul>

<p>Other than those, the rest of the how-to is the same as the Breezy how-to. </p>

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

<p>This how-to assumes that you have a clean install of Ubuntu Dapper (I&#8217;m not currently using Ubuntu Dapper Server, just the <strong>basic desktop install</strong>).</p>

<p>The first thing to do, is get <code>ssh</code> installed so that if you like, you can connect and do all of this remotely.</p>

<pre><code>sudo apt-get install ssh
</code></pre>

<p>There are some packages that are needed that aren&#8217;t in the default repositories for <code>apt</code>, so you have to enable them manually. Universe and Multiverse are needed.</p>

<p>To enable them, open up the Synaptic Package Manager</p>

<ol>
<li>Settings</li>
<li>Repositories</li>
<li>Add</li>
<li>Ensure that &#8216;Ubuntu 6.06 LTS&#8217; is the selected &#8216;Channel&#8217;</li>
<li>Check &#8216;Community maintained (Universe)&#8217;</li>
<li>Check &#8216;Non-free (Multiverse)</li>
<li>Click OK and let it rescan the servers.</li>
</ol>

<p>You can then close Synaptic. <code>apt</code> is now all set up ready for installing the packages we need.</p>

<p>Before we start installing the packages we want, do a system update:</p>

<pre><code>sudo apt-get update
</code></pre>

<h3>Ruby</h3>

<p>All on one line:</p>

<pre><code>sudo apt-get install irb libdbm-ruby libfcgi-ruby1.8 libgdbm-ruby libmysql-ruby libopenssl-ruby libruby1.8-dbg ri ruby1.8-dev
</code></pre>

<p>In order for Ruby to work ok, do the following:</p>

<pre><code>sudo ln -s /usr/bin/ruby1.8 /usr/bin/ruby
</code></pre>

<p>This will add a symbolic link into your <code>/usr/bin</code> directory so that the command <code>ruby</code> works, as opposed to <code>ruby1.8</code>.</p>

<h3>MySQL Server</h3>

<pre><code>sudo apt-get install mysql-server
</code></pre>

<p>During this install, a Postfix config screen will appear. Select OK and then &#8220;No configuration&#8221;.</p>

<h3>Ruby Gems &amp; Rails</h3>

<p>This is the standard way of installing ruby applications.</p>

<p>Need to download it directly from its web site:</p>

<pre><code>wget http://rubyforge.org/frs/download.php/5207/rubygems-0.8.11.tgz
</code></pre>

<p>Then extract it:</p>

<pre><code>tar xvfz rubygems-0.8.11.tgz
</code></pre>

<p>Move into the extracted directory:</p>

<pre><code>cd rubygems-0.8.11
</code></pre>

<p>Run the setu-p program:</p>

<pre><code>sudo ruby1.8 setup.rb
</code></pre>

<p>Update all installed gems on the system:</p>

<pre><code>sudo gem update --system
</code></pre>

<p>Take note that there are two dashes preceding <code>system</code>.</p>

<p>Now that Ruby Gems is installed, we can install Rails. However, I encountered problems with this and had to clear my rubygems cache first. Do the following:</p>

<pre><code>gem env gemdir
</code></pre>

<p>This will output a path location which you&#8217;ll need to use for the next command. For me, it was and probably is the same for you, <code>/usr/lib/ruby/gems/1.8</code></p>

<pre><code>sudo rm ABOVE_PATH/source_cache
</code></pre>

<p>This will clear your rubygems cache. Now you shouldn&#8217;t have any problems with installing rails.</p>

<pre><code>sudo gem install rails -y
</code></pre>

<h3>Apache 2</h3>

<p>Next is the web server I&#8217;m using. Apache 2. The following command will install Apache 2, FastCGI, FCGI, PHP 5 with MySQL functionality. PHP isn&#8217;t needed for Ruby or Rails, but I&#8217;m including it so that I can run PHP apps&#8230;</p>

<pre><code>sudo apt-get install apache2 libapache2-mod-fcgid libapache2-mod-fastcgi libapache2-mod-php5 php5-mysql
</code></pre>

<p>Once that&#8217;s done, we&#8217;ll need to enable the Apache mods we&#8217;ll be using:</p>

<pre><code>sudo a2enmod fcgid
sudo a2enmod fastcgi
sudo a2enmod rewrite
</code></pre>

<p>You&#8217;ll notice I&#8217;ve installed two different types of Fast CGI. That&#8217;s because at some point I want to try them both out. However, at the moment, I&#8217;ve only had success with getting FastCGI working decently.</p>

<p>Restart Apache to make sure all is well.</p>

<pre><code>sudo /etc/init.d/apache2 restart
</code></pre>

<h3>FastCGI</h3>

<p>I thought FastCGI would have been installed after doing the libapache2-mod-fastcgi &#8211; but for some reason, you have to install it manually.</p>

<p>In order to configure and build from the source files, you need to download some basic files:</p>

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

<p>Then, grab the FastCGI files from the web site:</p>

<pre><code>wget http://fastcgi.com/dist/fcgi-2.4.0.tar.gz
</code></pre>

<p>Extract:</p>

<pre><code>tar xvfz fcgi-2.4.0.tar.gz
</code></pre>

<p>Move into the directory:</p>

<pre><code>cd fcgi-2.4.0
</code></pre>

<p>Configure the installer:</p>

<pre><code>./configure
</code></pre>

<p>Install:</p>

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

<p>Now, that is all of the Apache and FastCGI files installed. Later, we&#8217;ll need to configure it all.</p>

<h3>Webmin</h3>

<p>Webmin is ugly, but it works, and it lets us configure Apache and the Nameserver easily.</p>

<p>Go to http://www.webmin.com/ and download the latest version of webmin in tar.gz format.</p>

<p>Once downloaded, extract it (filename may vary depending on the version you download):</p>

<pre><code>tar xvfz webmin-1.260.tar.gz
</code></pre>

<p>Move into the directory:</p>

<pre><code>cd webmin-1.260
</code></pre>

<p>Run the set-up program:</p>

<pre><code>sudo ./setup.sh /usr/local/webmin
</code></pre>

<p>You can use the default settings for this, or change them if you know what you&#8217;re doing. Be sure to set a password you can remember.</p>

<p>At the end of the set-up you&#8217;ll be given an address to use to connect to webmin. Remember this! and go to it straight away and login.</p>

<p>Do the following to configure Webmin to work with Apache:
1. At the top, click on the &#8220;Servers&#8221; link.
2. Select Apache Webserver.
3. Select Module Config.
4. Set the following values:
    * Apache Server Root &#8211; /etc/apache2
    * Path to httpd executable &#8211; /usr/sbin/apache2
    * Path to httpd.conf &#8211; /etc/apache2/httpd.conf
    * Command to start Apache &#8211; /etc/init.d/apache2 start
    * Command to stop Apache &#8211; /etc/init.d/apache2 stop</p>

<p>Save these settings.</p>

<h3>Nameserver</h3>

<p>I&#8217;m no DNS expert, so this is very vague and I suggest you go read a howto on DNS&#8230; <a href="http://rimuhosting.com/support/bindviawebmin.jsp">here&#8217;s one</a> I used to complete this part.</p>

<p>This will be different depending on your set-ups. For me, I have my domain name pointing to my web server in America that hosts http://commanderbond.net </p>

<p>On the server, there, I have the DNS pointing to my Internet IP at home, here in the UK.</p>

<p>The nameserver I&#8217;m using is Bind.</p>

<pre><code>sudo apt-get install bind9
</code></pre>

<p>Once that&#8217;s installed, we need to configure it in Webmin.
1. Click the &#8220;Servers&#8221; link.
2. Select BIND DNS Server.
3. A message will appear about a configuration file. Select the 3rd option &#8220;Setup as an internet name server, but use Webmin&#8217;s older root server information&#8221;
4. Create a Master Zone and enter the following details:
    * Domain Name &#8211; yourdomain.com
    * Email &#8211; you@anemail.com
5. Click on &#8220;Create&#8221;.
6. Click on the &#8220;Address&#8221; link.
7. Create a new Address record using the following:
    * Name &#8211; yourdomain.com. (including the trailing dot)
    * Address &#8211; your Internet IP address
8. Click on &#8220;Create&#8221;.
9. Go to the Module Index.
10. Click on &#8220;Apply Changes&#8221;.</p>

<h3>Set-up your web site</h3>

<p>You&#8217;ll need somewhere to store your web site files, so I suggest to first of all create a <code>public_html</code> directory in your user directory.</p>

<pre><code>mkdir ~/public_html
</code></pre>

<p>Now we&#8217;ll create a test HTML file to check all is working so far.</p>

<pre><code>nano ~/public_html/index.html
</code></pre>

<p>Inside it put the following:</p>

<pre><code>&lt;p&gt;Hopefully you can see this...&lt;/p&gt;
</code></pre>

<p>Save the file using Control O and then Control X to quit Nano.</p>

<p>Now, set the permissions of the file so it&#8217;s visible to the world:</p>

<pre><code>chmod 644 ~/public_html/index.html
</code></pre>

<p>In Webmin, go to the Apache configuration.</p>

<p>Create a new Virtual Server with the following:
* Document Root &#8211; home/yourusername/public_html
* Server Name &#8211; yourdomain.com</p>

<p>Save the settings. Now restart Apache:</p>

<pre><code>sudo /etc/init.d/apache2 restart
</code></pre>

<p>Now visit http://yourdomain.com/~yourusername/ and you should see:</p>

<blockquote>
  <p>Hopefully you can see this&#8230;</p>
</blockquote>

<p>If so, excellent! If not, hmmm&#8230; maybe you didn&#8217;t follow everything? or I made a mistake somewhere&#8230; leave a comment below.</p>

<p>Take a 5 minute break!</p>

<p>Refreshed? Right. Moving on&#8230;</p>

<h3>phpMyAdmin for MySQL management</h3>

<p>Go to http://www.phpmyadmin.net/home_page/index.php and download the latest stable release of phpMyAdmin in tar.gz format.</p>

<p>Extract:</p>

<pre><code>tar xvfz phpMyAdmin-2.7.0-pl2.tar.gz
</code></pre>

<p>Move the directory to some place helpful:</p>

<pre><code>mv phpMyAdmin-2.7.0-pl2 ~/phpmyadmin
</code></pre>

<p>Move into that directory:</p>

<pre><code>cd ~/phpmyadmin/
</code></pre>

<p>Create a new configuration file:</p>

<pre><code>cp config.default.php config.inc.php
</code></pre>

<p>Change the authentication mode to http</p>

<pre><code>gedit config.inc.php
</code></pre>

<p>Change this line:</p>

<pre><code>$cfg['Servers'][$i]['auth_type'] = 'config';
</code></pre>

<p>&#8230;to this line:</p>

<pre><code>$cfg['Servers'][$i]['auth_type'] = 'http';
</code></pre>

<p>Save the file.</p>

<p>Back in the command line, we need to set the root password, because by default, there isn&#8217;t one! </p>

<pre><code>mysql -u root
</code></pre>

<p>You&#8217;ll then enter the MySQL console. Enter the following:</p>

<pre><code>UPDATE mysql.user SET Password=PASSWORD('newpasswordhere') WHERE User='root';
</code></pre>

<p>This will set the root password. Now flush the privileges:</p>

<pre><code>FLUSH PRIVILEGES;
</code></pre>

<p>Now exit:</p>

<pre><code>exit
</code></pre>

<p>Now, we want phpMyAdmin accessible on the server &#8216;globally&#8217;. So that it doesn&#8217;t matter what address we&#8217;re using, we&#8217;ll still be able to access it.</p>

<p>In Webmin, under Apache Webserver:
1. Select &#8220;Default Server&#8221;
2. Aliases and Redirects
3. Under &#8220;Document directory aliases&#8221; enter <code>/phpmyadmin/</code> into the first text box, and <code>/home/davidwinter/phpmyadmin/</code> into the box to the right of that one.</p>

<p>Save, and in the Terminal restart apache:</p>

<pre><code>sudo /etc/init.d/apache2 restart
</code></pre>

<p>Go to http://yourdomain.com/phpmyadmin/</p>

<p>Login in using &#8220;root&#8221; and the password you set in the MySQL console.</p>

<p>You can do any MySQL configuration here. For me, I restored my Typo database for this blog from a backup.</p>

<h3>FastCGI configuration with a Rails application</h3>

<p>This part is what gets a Rails app running really fast.</p>

<p>You&#8217;ll need to configure the FastCGI config file:</p>

<pre><code>sudo nano /etc/apache2/mods-enabled/fastcgi.conf
</code></pre>

<p>Here is my config file:</p>

<pre><code>&lt;IfModule mod_fastcgi.c&gt;
  #FastCgiWrapper /usr/lib/apache2/suexec2
  FastCgiIpcDir /var/lib/apache2/fastcgi
  FastCgiConfig -maxClassProcesses 2 -maxProcesses 2 -minProcesses 2 -processSlack 2
  FastCgiServer /home/davidwinter/typo/public/dispatch.fcgi -idle-timeout 120 -processes 2 -initial-env RAILS_ENV=production
&lt;/IfModule&gt;
</code></pre>

<p>The following line of the above:</p>

<pre><code>FastCgiServer /home/davidwinter/typo/public/dispatch.fcgi -idle-timeout 120 -processes 2 -initial-env RAILS_ENV=production
</code></pre>

<p>Is important. You need to specifiy a line like this for each Rails app you&#8217;ll be using under FastCGI.</p>

<p>Now, in your Rails application directory check that in <code>public/.htaccess</code> has this line:</p>

<pre><code>AddHandler fastcgi-script .fcgi
</code></pre>

<p>And, that in the rewrite rules section, it has this:</p>

<pre><code>RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
</code></pre>

<p>&#8230;instead of:</p>

<pre><code>RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
</code></pre>

<p>Notice <code>.fcgi</code> instead of <code>.cgi</code></p>

<p>And that&#8217;s about it!</p>

<p>Give Apache one final restart:</p>

<pre><code>sudo /etc/init.d/apache2 restart
</code></pre>

<p>And you should now have everything working.</p>

<p>As I said, any problems, leave a comment and I&#8217;ll try and help.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidwinter.me.uk/articles/2006/08/09/ubuntu-dapper-web-server-how-to/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
