<?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>The Rambling Chronicles: Notes &#187; trac</title>
	<atom:link href="http://notes.theramblingchronicles.co.uk/tags/trac/feed/" rel="self" type="application/rss+xml" />
	<link>http://notes.theramblingchronicles.co.uk</link>
	<description>Making sense is optional</description>
	<lastBuildDate>Thu, 26 Aug 2010 10:09:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>64bit, virtual-python.py and anoyances caused</title>
		<link>http://notes.theramblingchronicles.co.uk/2009/12/08/64bit-virtual-python-py-and-anoyances-caused/</link>
		<comments>http://notes.theramblingchronicles.co.uk/2009/12/08/64bit-virtual-python-py-and-anoyances-caused/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 11:12:55 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[stuff]]></category>
		<category><![CDATA[64bit]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[shared host]]></category>
		<category><![CDATA[shared server]]></category>
		<category><![CDATA[trac]]></category>
		<category><![CDATA[virtual-python]]></category>

		<guid isPermaLink="false">http://theramblingchronicles.co.uk/2009/12/08/64bit-virtual-python-py-and-anoyances-caused/</guid>
		<description><![CDATA[Host broke, gave us a new server. This however was 64bit and broke Trac. To get it working again: Modify the virtual-python file line stdlib_dir = join&#40;prefix, 'lib', py_version&#41; to stdlib_dir = join&#40;prefix, 'lib64', py_version&#41; and run. Then re-follow the first few steps in guide on installing Trac, up to and including the easy_install of [...]]]></description>
			<content:encoded><![CDATA[<p>Host broke, gave us a new server. This however was 64bit and broke Trac. To get it working again:</p>


<ul>
<li>Modify the virtual-python file line</li>
</ul>




<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">stdlib_dir = join<span style="color: black;">&#40;</span>prefix, <span style="color: #483d8b;">'lib'</span>, py_version<span style="color: black;">&#41;</span></pre></div></div>



<p>to</p>


<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">stdlib_dir = join<span style="color: black;">&#40;</span>prefix, <span style="color: #483d8b;">'lib64'</span>, py_version<span style="color: black;">&#41;</span></pre></div></div>



<p>and run.</p>


<ul>
<li>Then re-follow the first few steps in guide on installing Trac, up to and including the easy_install of Trac, <a href="http://theramblingchronicles.co.uk/2009/10/23/python-trac-and-shared-hosting/">found here</a></li>
</ul>




<ul>
<li>Now rename the library in the home folder from lib to lib64</li>
</ul>



<p>All should now be working!</p>]]></content:encoded>
			<wfw:commentRss>http://notes.theramblingchronicles.co.uk/2009/12/08/64bit-virtual-python-py-and-anoyances-caused/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python, Trac and shared hosting</title>
		<link>http://notes.theramblingchronicles.co.uk/2009/10/23/python-trac-and-shared-hosting/</link>
		<comments>http://notes.theramblingchronicles.co.uk/2009/10/23/python-trac-and-shared-hosting/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 10:34:14 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[stuff]]></category>
		<category><![CDATA[cgi]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[shared host]]></category>
		<category><![CDATA[trac]]></category>

		<guid isPermaLink="false">http://theramblingchronicles.co.uk/?p=300</guid>
		<description><![CDATA[Easy, step by step: Set up a &#8220;virtual&#8221; python installation by running this script: virtual-python, then add these to your .bash_profile: export PYTHONPATH=&#34;$HOME/lib/python2.4/site-packages&#34; export LD_LIBRARY_PATH=&#34;$HOME/packages/lib&#34; export PATH=&#34;$HOME/packages/bin:$PATH&#34; then reload your bash profile with source .bash_profile Next get the easy install package: EasyInstall and run it: sh setuptools-0.6c9-py2.4.egg --prefix=~ This now allows you to install Trac [...]]]></description>
			<content:encoded><![CDATA[<p>Easy, step by step:</p>

<p>Set up a &#8220;virtual&#8221; python installation by running this script: <a href="http://peak.telecommunity.com/dist/virtual-python.py">virtual-python</a>, then add these to your .bash_profile:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PYTHONPATH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/lib/python2.4/site-packages&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LD_LIBRARY_PATH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/packages/lib&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/packages/bin:<span style="color: #007800;">$PATH</span>&quot;</span></pre></div></div>



<p>then reload your bash profile with <code>source .bash_profile</code></p>

<p>Next get the easy install package: <a href="http://pypi.python.org/pypi/setuptools">EasyInstall</a> and run it:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sh</span> setuptools-0.6c9-py2.4.egg <span style="color: #660033;">--prefix</span>=~</pre></div></div>




<p>This now allows you to install Trac in an easier way:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">easy_install <span style="color: #660033;">--prefix</span>=~ Trac</pre></div></div>




<p>Next setup the Trac environment:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">trac-admin <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>project initenv</pre></div></div>




<p>then deploy it for use on a webserver. Due to a bug you need to create another directory to deploy to and then copy over:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">trac-admin <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>project deploy <span style="color: #000000; font-weight: bold;">/</span>other<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">dir</span>
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>other<span style="color: #000000; font-weight: bold;">/</span>dir<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>project</pre></div></div>




<p>Now the fun begins &#8211; you need to makes sure all permissions are correct. Navigate to the <code>cgi-bin</code> directory and run:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> +rx trac.cgi</pre></div></div>




<p>You also need to change <code>#!/usr/bin/python</code> to your python path</p>

<p>The next step is to create an index.cgi page to fix the shared server path bugs:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">HOME</span>=<span style="color: #ff0000;">&quot;/your/site/home&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">TRAC_ENV</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/path/to/trac&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PYTHONPATH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/lib/python2.4/site-packages&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/bin:<span style="color: #007800;">$PATH</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LD_LIBRARY_PATH</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$HOME</span>/lib&quot;</span>
<span style="color: #000000; font-weight: bold;">/</span>full<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span>cgi-bin<span style="color: #000000; font-weight: bold;">/</span>trac.cgi</pre></div></div>




<p>and as before, run <code>chmod +rx index.cgi</code> to get it working</p>

<p>Now we need to setup up a .htaccess file to ensure it all works:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">DirectoryIndex cgi-bin<span style="color: #000000; font-weight: bold;">/</span>index.cgi
&nbsp;
AuthType Basic
AuthName <span style="color: #ff0000;">&quot;Trac&quot;</span>
AuthUserFile <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>.htpasswd<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">file</span>
Require valid-user</pre></div></div>




<p>The auth stuff is needed for later. You need to create a htpasswd file with the name of the user you would like to add as admin to it to initially get it running. A better approach will be used when it&#8217;s running.</p>

<p>The next step is to check it all works! Once you&#8217;ve checked it is in fact live and kicking, you need to add the permissions to access it.</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">trac-admin <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>trac<span style="color: #000000; font-weight: bold;">/</span>site
<span style="color: #000000; font-weight: bold;">&gt;&gt;</span> permissions add admins TRAC_ADMIN
<span style="color: #000000; font-weight: bold;">&gt;&gt;</span> permissions add <span style="color: #7a0874; font-weight: bold;">&#123;</span>your_name<span style="color: #7a0874; font-weight: bold;">&#125;</span> admins</pre></div></div>




<p>And you should now be able to log in!</p>

<p>The next step is to get the some better authentication working. First:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">easy_install http:<span style="color: #000000; font-weight: bold;">//</span>trac-hacks.org<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>accountmanagerplugin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0.9</span></pre></div></div>



<p>to install the <a href="http://trac-hacks.org/wiki/AccountManagerPlugin">account manager</a> plugin.</p>

<p>Then simply add the location of the password file in the htpasswd section of the account manager admin. You now need to disable your authentication in the .htaccess file you originally setup so that the <span class="caps">HTML </span>login will work. simply comment out the authentication lines.</p>

<p>Next, edit <code>trac.ini</code> , adding <code>trac.web.auth.LoginModule = disabled</code> to the components section (or disable in the trac admin).</p>

<p>Finally, we need to set up Trac so that it uses a static location for files seen as we&#8217;re stuck using <span class="caps">CGI.</span> Simply edit the <code>trac.ini</code> section so that the <code>htdocs_location</code> reads the full <span class="caps">URL </span>to it: http://your-site.com/htdocs/common/.</p>

<p>Now all should be working!</p>]]></content:encoded>
			<wfw:commentRss>http://notes.theramblingchronicles.co.uk/2009/10/23/python-trac-and-shared-hosting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
