'2011/06'에 해당되는 글 1건

  1. trac 0.11.7 on ubuntu 10.10 2011/06/14

trac 0.11.7 on ubuntu 10.10

from Misc 2011/06/14 16:58
This is a backlog of installing trac + subversion + apache2 on ubuntu 10.10.

1. Install trac using Synaptic Package Manager. This includes Subversion, SQLite, and Apache2 installation.
2. install libapache2-mod-python package.
3. install libapache2-svn package.
4. prepare data directory for subversion and trac
  4.1 create trac root directory: /path/to/trac/root
  4.2 create svn root directory: /path/to/svn/root
5. make following script and run
#!/usr/bin/perl

$sName= $ARGV[0];
$lName= $ARGV[1];
if ($sName eq "") {
    print "At least the project name is necessary\n\n";
} else {
    if ($lName eq "") {
        $lName= $sName;
    }

    $path= "sudo svnadmin create /path/to/svn/root/$sName";
    system($path);
    $path= "sudo chown -$ www-data:www-data /path/to/svn/root/$sName";
    system($path);
    $path= "sudo trac-admin /path/to/trac/root/$sName initenv '$lName' 'sqlite:db/trac.db' 'svn' '/path/to/svn/root/$sName' --inherit=/etc/trac.ini";
    system($path);
    $path= "sudo chown -R www-data:www-data /path/to/trac/root/$sName";
    system($path);
    $path= "sudo trac-admin /path/to/trac/root/$sName permission add username TRAC_ADMIN";
    system($path);
    $path= "sudo htpasswd -cm /path/to/passwd/file username";
    system($path);
    print "Done!\n\n";
    print "Don't forget to add password setting on /etc/apache2/conf.d/trac!!\n\n";
}
6. add following lines to /etc/apache2/conf.d/trac
#trac
<Location /project>
    SetHandler mod_python
    PythonInterpreter main_interpreter
    PythonHandler trac.web.modpython_frontend
    PythonOption TracEnvParentDir /path/to/trac/root
    PythonOption TracUriRoot /project
    PythonOption PYTHON_EGG_CACHE /tmp
</Location>
<Location /project/<project_name>/login>
    AuthType Basic
    AuthName "project description"
    AuthUserFile /path/to/passwd/file
    Require valid-user
</Location>
#subversion
<Location /svn>
    DAV svn
    SVNParentPath /path/to/svn/root
</Location>
<Location /svn/<project_name> >
    AuthType Basic
    AuthName "project description"
    AuthUserFile /path/to/passwd/file
    Require valid-user
</Location>
7. restart apache server
2011/06/14 16:58 2011/06/14 16:58