<?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>Bluehorn's Blog &#187; How-To</title>
	<atom:link href="http://www.landschoff.net/blog/category/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.landschoff.net/blog</link>
	<description>Ramblings of Torsten Landschoff</description>
	<lastBuildDate>Sat, 20 Feb 2010 22:25:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>trac served by lighttpd on Debian lenny</title>
		<link>http://www.landschoff.net/blog/2009/01/trac-hosted-on-debian-unstable-lighty/</link>
		<comments>http://www.landschoff.net/blog/2009/01/trac-hosted-on-debian-unstable-lighty/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 18:08:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[How-To]]></category>

		<guid isPermaLink="false">http://www.landschoff.net/blog/?p=19</guid>
		<description><![CDATA[Software installation
All required packages are installed by the following command:
apt-get install lighttpd trac subversion apache2-utils
We install lighttpd together with trac, as otherwise the trac package will pull in an installation of apache2, which is a bit more heavyweight than what I wanted.
Setting up the directory tree
Let&#8217;s set up a directory tree for trac:
for p in [...]]]></description>
			<content:encoded><![CDATA[<h2>Software installation</h2>
<p>All required packages are installed by the following command:</p>
<pre>apt-get install lighttpd trac subversion apache2-utils</pre>
<p>We install lighttpd together with trac, as otherwise the trac package will pull in an installation of apache2, which is a bit more heavyweight than what I wanted.</p>
<h2>Setting up the directory tree</h2>
<p>Let&#8217;s set up a directory tree for trac:</p>
<pre>for p in env svn auth; do mkdir -p /srv/trac/$p/demo; done</pre>
<p>One directory for the trac environment data, another for the subversion repository and the third for authentication data. Putting all environments into a single directory (<tt>/srv/trac/env</tt>) would allow to run a single trac server for all environments using the <var>TRAC_ENV_PARENT_DIR</var> configuration variable.</p>
<h2>Creating a trac environment</h2>
<p>The trac environment is created using
<pre>trac-admin /srv/trac/env/demo initenv</pre>
<p>The command will ask interactively for the following settings:</p>
<ul>
<li>Project name: Enter a name as you like (&#8221;Demo&#8221;). Note that you can change this later.</li>
<li>Database connection string: You can accept the default sqlite database.</li>
<li>Repository type: I used the default &#8220;svn&#8221; selection.</li>
<li>Path to repository: <tt>/srv/trac/svn/demo</tt></li>
</ul>
<p>From now on, we can access the (empty) trac instance by running <code>tracd --port 8000 /srv/trac/env/demo</code> and accessing the trac-integrated web server at port 8000 of the server. Hit Ctrl-C to kill the tracd after you don&#8217;t need it any longer.</p>
<h2>Creating an initial user</h2>
<p>By default, trac creates no users. Only anonymous access is allowed, which by default is read-only. Therefore, we have to create a user to add content. Let&#8217;s use digest authentication:</p>
<pre>htdigest -c /srv/trac/auth/demo/users "trac demo realm" admin
trac-admin /srv/trac/env/demo permission add admin TRAC_ADMIN</pre>
<p>You can now start tracd with authentication:</p>
<pre>tracd --port 8000 \
    --auth=demo,/srv/trac/auth/demo/users,"trac demo realm" \
    /srv/trac/env/demo</pre>
<h2>Configure lighttpd</h2>
<p>To use lighttpd to serve the trac environment, we first need to fix the permissions:</p>
<pre>chown -R www-data /srv/trac/env
chmod +x /usr/share/pyshared/trac/web/fcgi_frontend.py</pre>
<p>I think, the second command should not be required and filed <a href="http://bugs.debian.org/510441">Debian bug #510441</a> because of this.</p>
<p>Next, we need a configuration file. It delegates the trac path to a FastCGI handler and contains the location of the authentication data. Copy the <a href="http://landschoff.net/trac/stuff/browser/misc/50-trac-demo.conf?rev=4">configuration file</a> to <tt>/etc/lighttpd/conf-available/</tt> and enable the configuration:</p>
<pre>lighty-enable-mod auth trac-demo
/etc/init.d/lighttpd force-reload</pre>
<p>The trac instance should be available at <tt>http://HOSTNAME/trac</tt>. Have fun!</p>
<h2>Automatic setup</h2>
<p>For my own tests I wrote a <a href="http://landschoff.net/trac/stuff/browser/misc/setup-trac-demo?rev=4">script</a> which does most of this automatically. Use at your own risk!</p>
<p>BTW: All of this was tested against Debian lenny (not released at time of writing).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.landschoff.net/blog/2009/01/trac-hosted-on-debian-unstable-lighty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
