<?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>TipsInBox &#187; trac</title>
	<atom:link href="http://www.didiergalland.com/tag/trac/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.didiergalland.com</link>
	<description>Hints and tips of a web worker</description>
	<lastBuildDate>Wed, 04 Jan 2012 00:35:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Install of trac + subversion</title>
		<link>http://www.didiergalland.com/2010/05/17/install-of-trac-subversion/</link>
		<comments>http://www.didiergalland.com/2010/05/17/install-of-trac-subversion/#comments</comments>
		<pubDate>Mon, 17 May 2010 14:58:19 +0000</pubDate>
		<dc:creator>didier</dc:creator>
				<category><![CDATA[Project management]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[trac]]></category>

		<guid isPermaLink="false">http://www.didiergalland.com/2010/05/17/install-of-trac-subversion/</guid>
		<description><![CDATA[Step 1 : first trac installation story (you can go directly to step 3 if you don&#8217;t like install nightmares) Here is the whole story of my trac install on a virtual ubuntu machine. Not the easy and perfect way, but I think it would be useful to see the errors too Install of trac [...]]]></description>
			<content:encoded><![CDATA[<h2>Step 1 : first trac installation story (you can go directly to step 3 if you don&#8217;t like install nightmares)</h2>
<p> Here is the whole story of my trac install on a virtual ubuntu machine. Not the easy and perfect way, but I think it would be useful to see the errors too <img src='http://www.didiergalland.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  </p>
<p style=" -qt-block-indent:1;">
<ol>
<li>Install of trac via synaptic</li>
<li>Followed instruction of this page : <a href="https://help.ubuntu.com/community/Trac">https://help.ubuntu.com/community/Trac</a> (/etc/apache2/conf.d/trac.conf + /var/www/projects/index.cgi). I also used <a href="http://trac.edgewall.org/wiki/TracModPython" target="_blank">http://trac.edgewall.org/wiki/TracModPython</a>. The most useful and accurate is actually <a href="http://trac.edgewall.org/wiki/TracUbuntuMultipleProjects">http://trac.edgewall.org/wiki/TracUbuntuMultipleProjects</a></li>
<li>Install of perl in apache (libapache2-mod-perl2 in synaptic) to enable the index.cgi script</li>
<li>$ sudo /etc/init.d/apache2 restart =&gt; &quot;&#8230; waiting Syntax error on line 31 of /etc/apache2/conf.d/trac.conf: Invalid command &#8216;PythonInterpreter&#8217;, perhaps misspelled or defined by a module not included in the server configuration&quot;</li>
<li>So I installed libapache2-mod-python (synaptic). Yes I know I read to fast the doc, it was mentioned.</li>
<li>Point browser to http://127.0.0.1/projects/ -&gt; Internal server error (500). In /var/log/apache2/error.log I have &quot; OSError: [Errno 2] No such file or directory: &#8216;/var/trac&#8217; (dir specified in index.cgi)</li>
<li>$ sudo trac-admin /usr/share/trac/htdocs initenv (answer questions). I set a distant svn repository : http:/subversion.assembla.com/svn/myproject. This is not supported. I had to change it to my local repository later.</li>
<li>Notice the config file path : /usr/share/trac/htdocs/conf/trac.ini</li>
<li>$ tracd &#8211;port 8000 /usr/share/trac/htdocs</li>
<li>http://localhost:8000/htdocs =&gt; &quot;TracError: The user &lt;currentUser&gt; requires read _and_ write permissions to the database file /usr/share/trac/htdocs/db/trac.db and the directory it is located in.&quot; (probably, I&#8217;d rather install trac from user, no root, in my home dir ?)</li>
<li>$ cd /usr/share/trac/htdocs/; sudo chown -R currentUser.currrentUser db</li>
<li>Again : $ tracd &#8211;port 8000 /usr/share/trac/htdocs</li>
<li>Bravo ! Trac displayed&#8230; (http://localhost:8000/htdocs)</li>
<li>mmhh&#8230; Warning : Warning: Can&#8217;t synchronize with the repository (/usr/share/trac/htdocs/http:/subversion.assembla.com/svn/myproject does not appear to be a Subversion repository.). Look in the Trac log for more information.&quot;. This is because trac doesn&#8217;t support distant svn repository. Ok install subversion locally&#8230;</li>
<li>I was still stuck with a 500 server error if I try to load http://localhost/projects/.</li>
<li>I had to correct the /etc/apache2/conf.d/trac.conf : Replace &quot;/var/trac&quot; by &quot;/usr/share/trac&quot; in the line &quot;PythonOption TracEnvParentDir /var/trac&quot; (you must have &quot;PythonOption TracEnvParentDir /usr/share/trac&quot; to match the dir I specified with the trac-admin initenv command in step 7). I had to correct also the index.cgi file (replace &#8216;my $trac_path = &quot;/var/trac&quot;;&#8217; by &#8216;my $trac_path = &quot;/usr/share/trac/htdocs&quot;;&#8217;</li>
<li>Then, when I click on my project link (url=http://localhost/projects/htdocs), I have a trac error : &quot;The user www-data requires read _and_ write permissions to the database file /usr/share/trac/htdocs/db/trac.db and the directory it is located in.&quot;. It&#8217;s the same error I had when I ran the standalone server (tracd), but now it&#8217;s apache the process owner. So I made &quot;$ cd /usr/share/trac/htdocs/; sudo chown -R www-data db&quot;, and it made the trick.</li>
<li>I deleted /var/www/projects/index.cgi which is totally useless.</li>
</ol>
<h2>Step 2 : Issues left to fix :</h2>
<p style=" -qt-block-indent:1;">
<ol>
<li> I still have the error about the missing subversion repository. Solution : install a subversion repository. Well explained here : http://trac.edgewall.org/wiki/TracUbuntuMultipleProjects</li>
<li>Another issue is that the url of my project is ended by &quot;/htdocs&quot;, and it should be http://localhost/projects/myprojectname (the error was made when I ran the command &quot;$ sudo trac-admin /usr/share/trac/htdocs initenv&quot;. It should have been : &quot;$ sudo trac-admin /usr/share/trac/&lt;myproject&gt; initenv&quot;</li>
<li>Authentication (i saw a plugin authManager&#8230;)</li>
</ol>
<h2>Step 3 : Long story made short and install ok</h2>
<p> NB. I choose to install trac home in /var/trac instead of /usr/share/trac ; and /var/svn as the root dir for all subversion repositories. To correct my first try, I mainly followed <a href="http://trac.edgewall.org/wiki/TracUbuntuMultipleProjects" target="_blank">http://trac.edgewall.org/wiki/TracUbuntuMultipleProjects</a> wich I found to be the best ressource. </p>
<p style=" -qt-block-indent:1;">
<ol>
<li>Install trac (and modules trac-accountmanager, trac-customfieldadmin, trac-email2trac, trac-mastertickets, trac-wysiwyg, trac-xmlrpc&#8230;) + perl apache module + python apache module + libapache2-svn (to have dav_svn module)</li>
<li>Create /etc/apache2/conf.d/trac.conf (see mine below)</li>
<li>% sudo mkdir /var/trac</li>
<li>% sudo chown www-data:www-data /var/trac</li>
<li>% sudo mkdir /var/svn</li>
<li>% sudo mkdir /var/svn/YourProjectNameHere</li>
<li>% sudo svnadmin create /var/svn/YourProjectNameHere</li>
<li>% sudo chown -R www-data /var/svn/YourProjectNameHere</li>
<li>% sudo /etc/init.d/apache2 sudo restart</li>
<li>sudo trac-admin /var/trac/YourProjectNameHere initenv</li>
<li>sudo chown -R www-data:www-data /var/trac/YourProjectNameHere</li>
<li>http://localhost/projects</li>
<li>Take a breath !</li>
<li>% sudo htpasswd -c /var/trac/.htpasswd admin [choose a password - The path is specified in /etc/apache2/conf.d/trac.conf]</li>
<li>% sudo htpasswd /var/trac/.htpasswd &lt;someotheruser&gt;</li>
<li>You owe your cup of coffee now !</li>
</ol>
<h3>My /etc/apache2/conf.d/trac.conf</h3>
<pre><code>
# Trac project directory (for project listing)

        AllowOverride None
        Options Indexes +ExecCGI MultiViews FollowSymLinks
        AddHandler cgi-script .cgi
        Order allow,deny
        Allow from all                                                          

# use the following for one authorization for all projects                      

    AuthType Basic
    AuthName &quot;Trac Project authentication&quot;
    AuthUserFile /var/trac/.htpasswd
    Require valid-user                                                          

## Using multiple projects

   SetHandler mod_python
   PythonInterpreter main_interpreter
   PythonHandler trac.web.modpython_frontend
   # For multiple projects
   PythonOption TracEnvParentDir /var/trac
   PythonOption TracUriRoot /projects                                           

</code></pre>
<h2>Customisation</h2>
<ul>
<li>sudo trac-admin /var/trac/myProjectName/</li>
<li>(in trac console) permission add admin TRAC_ADMIN</li>
<li>permission list admin</li>
<li>quit</li>
<li>Then reload trac and you must have a new &quot;admin&quot; tab in the right upper side</li>
<li>Enable the plugins in Admin &gt; Plugins </li>
</ul>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.didiergalland.com%2F2010%2F05%2F17%2Finstall-of-trac-subversion%2F&amp;title=Install%20of%20trac%20%2B%20subversion" id="wpa2a_2"><img src="http://www.didiergalland.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.didiergalland.com/2010/05/17/install-of-trac-subversion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

