You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

201 lines
6.6 KiB

<html><head><title>Trac on SDF</title>
<style type="text/css">
.title{
background-color:#ffffff;
font-size:30px;
color:#2a2a2a;
}
.header{
background-color:#ffffff;
font-size:20px;
color:#2a2a2a;
}
.body{
background-color:#ffffff;
font-size:15px;
color:#2a2a2a;
}
.reference{
border: 1px dotted #000;
text-align: left;
padding: 5px;
padding: 15px 30px 15px;
background:#CCC url('http://sdf.org/tutorials/images/ref.png') 5px 5px no-repeat;
color: #000;
margin: 10px 5px;
}
.link { text-decoration:none }
.superscript{
font-size:10px;
vertical-align:top;
}
.subscript{
font-size:10px;
vertical-align:bottom;
}
.note{
border: 1px dotted #000;
text-align: left;
padding: 5px;
padding: 15px 30px 15px;
background: #DC143C url('http://sdf.org/tutorials/images/note.png') 5px 5px no-repeat;
color: #FFF;
margin: 10px 5px;
}
.code{
border: 1px dotted #000;
text-align: left;
padding: 5px;
padding: 15px 40px 15px;
background:#2F4F4F url('http://sdf.org/tutorials/images/code.png') 5px 5px no-repeat;
color: #00FF00;
margin: 10px 5px;
font-family: monospace;
}
table.table {
border-width: 0px;
border-spacing: 0px;
border-style: none;
border-collapse: collapse;
background-color: #1E90FF;
}
table.table th {
border-width: 1px;
padding: 1px;
border-style: inset;
border-color: white;
background-color: #A0522D;
-moz-border-radius: ;
padding: 10;
}
table.table td {
border-width: 1px;
padding: 1px;
border-style: inset;
border-color: white;
background-color: #FFEBCD;
-moz-border-radius: ;
padding: 5;
}
</style>
</head>
<body>
<h1>Trac on SDF</h1>
<p>This tutorial discusses how to install <a href="http://trac.edgewall.org/" title="The Trac Project">Trac</a>, in the words of its creators <q>a minimalistic approach to web-based management of software projects.</q></p>
<h3>Contents</h3>
<ol>
<li><a href="#intro">Introduction</a></li>
<li><a href="#install">Installation</a></li>
<li><a href="#running">Running Trac</a></li>
<li><a href="#further">Further reading</a></li>
</ol>
<hr />
<h2 id="intro">Introduction</h2>
<p>Trac includes wiki, bug tracker, milestone plan and an interface to Subversion. It is installed on SDF, so you can setup your own instance and manage your projects.</p>
<h2 id="install">Installing a Trac instance on SDF</h2>
<h3>Setting up an SVN repository</h3>
<p>Skip this step if you want to use Trac <em>without</em> a repository. Otherwise run the commands
<p class="code">
$ mkdir .svn_repos
$ svnadmin create .svn_repos/my-cool-project
</p>
to setup a repository named <code>my-cool-project</code> in your homedir under <code>$HOME/.svn_repos</code>.
You can then checkout your repository from your home using the <a href="http://svnbook.red-bean.com/en/1.4/svn.serverconfig.svnserve.html#svn.serverconfig.svnserve.sshauth" title="Subversion: Tunneling over SSH">svn+ssh protocol</a>.
</p>
<h3>Setting up Trac</h3>
<p>Get started with
<p class="code">
trac-admin /path/to/trac initenv
</p>
where <code>/path/to/trac</code> is the directory where Trac will be installed (it will be created if doesn't exist). The installation routine will ask you a bunch of questions, including your project's name, database connection (default is fine), repository type and path (type in the path you have chosen above, <acronym title="for example">e.g.</acronym> <code>~/.svn_repos/my-cool-project</code>) or leave it blank if you didn't setup a repository. <strong>Whenever you are not sure what to do, just hit <kbd>[return]</kbd> to use the default.</strong></p>
<p>
If the output finally reads <q>Project environment for 'My cool project' created</q> and <q>Congratulations!</q>, you have just successfully installed Trac. Pat yourself on the back and read on!
</p>
<h2 id="running">Running Trac</h2>
<p>There are currently two ways to run Trac on SDF: with the standalone server <code>tracd</code> and as CGI within Apache.</p>
<h3>Using the standalone server <code>tracd</code></h3>
<p>This is by far the least painful, but requires the MetaARPA membership because <code>tracd</code> opens a port on the machine.</p>
<p>First, run the command
<p class="code">
id -u
</p>
and note down the number that is printed on the terminal. This will be your port number (to avoid conflicts between users) and will be refered to as <code>PORT</code> from here on.</p>
<p>Next, run the command
<p class="code">
tracd --port PORT /path/to/trac
</p>
You will now be able to connect to your Trac instance with your Browser of Choice&trade; at http://sverige.freeshell.org:PORT/trac</p>
<h3>Running Trac as CGI within Apache</h3>
<p>With this setup, you will be able to run Trac under your own domain. The tradeoff is performance &#8211; <code>tracd</code> is considerably faster.</p>
<p>Copy <code>trac.cgi</code> into your <code>html/</code> directory:
<p class="code">
cp /usr/pkg/share/trac/cgi-bin/trac.cgi html/
</p>
and fix the permissions using <code>mkhomepg -p</code>.
Add the following lines to <code>trac.cgi</code> just after the comments:
<p class="code">
import os
os.environ['TRAC_ENV']='/path/to/trac'
</p>
Now Trac can locate the directory containing your instance.
</p>
<p>
If you rename the CGI to <code>index.cgi</code>, it can be called just by the directory. In that case, you may consider setting up a subdirectory (like
MYPROJECT) and copying the CGI there.
</p>
<p>
Point your browser to http://YOURLOGIN.freeshell.org/trac.cgi (or even just YOURLOGIN.freeshell.org/MYPROJECT if you renamed the CGI and copied it to the MYPROJECT subdirectory of your html/) to check that it works. Please be patient, CGI takes a while to load the page.
</p>
<p>
<strong>Note:</strong> If you want to use Trac in your VHOSTed domain at SDF, be sure to put <code>trac.cgi</code> into the corresponding domain directory under <code>html/</code>.
</p>
<h2 id="further">Further reading</h2>
<p>
To use prettier <acronym title="Uniform Resource Locator">URL</acronym>s, please refer to <a href="http://trac.edgewall.org/wiki/TracPrettyUrls#Usingmod_rewritefrom.htaccessfiles" title="Prettier URLs for Trac">Prettier URLs for Trac</a>.
</p>
<p>
Most basic information (tickets, milestones, etc.) can be changed through the web interface.
However, administrative tasks must be done on the command line using the <code>trac-admin</code> command. Please refer to <a href="http://trac.edgewall.org/wiki/TracAdmin" title="Administering a Trac project">Trac Admin</a> for details.
</p>
<p>
Lastly, <a href="http://trac.edgewall.org/wiki/0.10/TracGuide" title="The Trac User and Administration Guide">the Trac User and Administration Guide</a> is pretty thorough and should answer all Trac-related questions.
</p>
<hr />
<cite>$Id: trac-on-sdf.html,v 1.4 2014/10/18 19:00:12 grobe0ba Exp $</cite>