Setup Trac on Windows

Using Bitnami Trac Stack + Subversion (SVN).

    1. Setup environment
      • Download Bitnami Track Stack (Windows installer) & install it
      • Add to PATH
        C:\Program Files\BitNami Trac Stack\python\Scripts
        C:\Program Files\BitNami Trac Stack\apache2\bin
    2. Create new project
      • Cmd
        $ trac-admin <trac env path> initenv
      • path: C:\Users\Username\Projects\Trac\newproject
    3. Configure SVN repo
      • Edit C:\Users\Username\Projects\Trac\newproject\conf\trac.ini
        repository_dir = <svn repo path>
      • path: C:\Users\Username\Projects\Repos\newproject (create using TortoiseSVN)
    4. Enable SVN module in Trac
        • Edit trac.ini

  • Edit logo image
    • Edit trac.ini
      src = site/logo.png
    • Place image in <trac env path>\htdocslogo.png
  • Enable syntax highlighting
    • Install pygments
      # easy_install pygments
    • Edit trac.ini
      pygments_default_style = default
  • Add admin permission
    • Cmd
      $ trac-admin /path/to/projenv permission add admin TRAC_ADMIN
    • /path/to/projectenv = c:\Users\Username\Projects\Trac\newproject
  • Add user
    • Cmd
      # htdigest -c htpasswd "Trac" username
    • -c = Create auth file (exclude when adding user)
      htpasswd = C:\Users\Username\BitNami Trac Stack\apps\trac\users\htpasswd
      “trac” = realm in http-dav-svn.conf below
  • Enable SVN repo hosting on Apache
    • Add in httpd.conf
      # svn repository
      Include conf/extra/http-dav-svn.conf
    • Create http-dav-svn.conf (copied from subversion.conf at
    • Edit:
      SVNParentPath C:\Users\Username\Projects\Repos
      AuthType Basic
    • AuthName & AuthUserFile follow values in c:\Program Files\BitNami Trac Stack\apps\trac\conf\trac.conf
      * bitnami trac by default is using basic auth

Trac can be accessed at http://localhost/trac. Checkout & commit to SVN repo at http://localhost/svn

Git basic

I’m a noob in using Git, and I’m using Github to host some of the code I wrote. Here are some basic commands to host a project with Github (or using Git revision control generally) (sometimes I forgot the command or the order of which command goes first)

Global setup:

Set up git

git config --global "Your Name"
git config --global [email protected]

Next steps:

mkdir project-name
cd project-name
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin [email protected]:username/project-name.git
git push -u origin master

Existing Git Repo?

cd existing_git_repo
git remote add origin [email protected]:username/project-name.git
git push -u origin master

To commit changes (and optionally push changes to Github)

git add .
git commit -m 'commit message'
git push -u origin master

Common SVN users may find it confusing when using Git. Here’s some of the tips:

  • There are no centralized server or repo. You are the server / repo
  • In SVN, what’s in your computer is working copy and the center for committing changes is the repository, In Git, your working copy is your repository.
  • In SVN, project members checked out a working copy and commit changes to a centralized repository. In Git, everyone in a project can be the repository, can checkout (pull) and commit (push) changes to each other
    (Note: In Git, ‘checkout’ is called `pull`, ‘commit’ is saving changes to your own repository, ‘push’ is sending and merging changes to remote repository

Trac on Fedora

This is multiple projects installation, a continuation from previous posts.

Install required packages:

yum install trac mod_wsgi

Software: Trac 0.11.7, mod_wsgi 2.3

Trac folder: /var/svn/trac
Python eggs cache dir: /tmp/egg-cache

Create new trac environment

trac-admin /var/svn/trac/testproj initenv
  Project Name > Test Project
  Database connection string > [sqlite:db/trac.db]
  Repository type > [svn]
  Path to repository > /var/svn/repos/testproj

Create wsgi script

vim /var/svn/trac/trac.wsgi
#!/usr/bin/env python
import os
def application(environ, start_request):
  os.environ['TRAC_ENV_PARENT_DIR'] = '/var/svn/trac'
  os.environ['PYTHON_EGG_CACHE'] = '/tmp/egg-cache'
  from trac.web.main import dispatch_request
  return dispatch_request(environ, start_request)

Apache mod_wsgi settings

vim /etc/httpd/conf.d/trac.conf
# comment all settings in /etc/httpd/conf.d/wsgi.conf
LoadModule wsgi_module modules/
WSGIScriptAlias /trac /var/svn/trac/trac.wsgi
<Directory /var/svn/trac>
  WSGIApplicationGroup %{GLOBAL}
  Order deny,allow
  Allow from all
<LocationMatch "/trac/[^/]+/login">
  AuthType Digest
  AuthName "Project Repository"
  AuthUserFile /var/svn/auth
  Require valid-user

Grant administration right to admin user (trac>=0.11)

trac-admin /var/svn/trac/testproj permission add user1 TRAC_ADMIN

Set ownership

chown -R apache.apache /var/svn

Reload apache

service httpd reload

View list of projects – http://localhost/trac

Apache + SVN on Fedora

Create SVN repo, accessible from network, all users can read & checkout, certain users can write / commit

Software: Apache 2.2.11, Subversion 1.6.6, mod_dav_svn 1.6.6

File & folder:

/var/svn/auth – authentication file
/var/svn/repos/ – project repositories

Install mod_dav_svn

yum install mod_dav_svn svn

Create SVN repo (refer previous post)

svnadmin create --fs-type fsfs /var/svn/repos/testproj

Create authentication file

htdigest [-c] <auth file> <realm> <username>
htdigest -c /var/svn/auth "Project Repository" user1

c – create file (exclude this flag when adding users)

Setup Apache + mod_dav_svn

vim /etc/httpd/conf.d/subversion.conf
LoadModule dav_svn_module modules/
LoadModule authz_svn_module modules/

<Location /svn>
  DAV svn
  SVNParentPath /var/svn/repos
  SVNListParentPath On
  AuthType Digest
  AuthName "Project Repository"
  AuthUserFile /var/svn/auth
    Require valid-user

Change ownership of the whole svn repo dir

chown -R apache.apache /var/svn

Note: Re-assign the ownership everytime you create a new repo

Lastly, reload apache

service httpd reload

View list of projects – http://localhost/svn
View contents of particular (myproj) project – http://localhost/svn/myproj

Using SVN

My notes on how to use subversion from command line.


Project dir: ~/Projects/myproj
SVN temp layout dir: /tmp/svn
SVN repos: /var/svn/repos

Create repo

mkdir -p /var/svn/repos
svnadmin create --fs-type fsfs /var/svn/repos/myproj

Import project

svn import <local dir> <repo>
mkdir -p /tmp/svn/trunk /tmp/svn/tags /tmp/svn/branches
svn import /tmp/svn file:///var/svn/repos/myproj -m "Initial import" 
svn import ~/Projects/myproj file:///var/svn/repos/myproj/trunk -m "Initial project import"

for local repo – file:/// …
for network repo – http:// …

Check out

svn checkout|co <repo> [working copy]
svn checkout file:///var/svn/repos/myproj ~/Projects/myproj
svn co file:///var/svn/repos/myproj/trunk
# will auto checkout to folder 'myproj' in current dir
# that folder is called 'working copy' dir

Review changes

svn status
# in working copy dir

Add files

svn add <folder|file>

Delete file/folder

svn delete <folder|file>
svn delete file:///var/svn/repos/myproj/trunk/file.txt 
# also can delete file in repo, not only in working copy


svn commit -m "Log message"
# in working copy dir


svn update (in working copy dir)

Tagging projects

svn copy <repo> <repo tag dir>
svn copy file:///var/svn/repos/myproj/trunk file:///var/svn/repos/myproj/tags/0.1 -m "Version 0.1"

Export (for release)

svn export <repo>
svn export file:///var/svn/repos/myproj/tags/0.1
# will export to folder 'myproj'  in current dir

Subversion on thumbdrive

This post shows how to create a Subversion (SVN) repo on a thumbdrive. I don’t know what’s the minimum capacity of thumbdrive should be used, but 2GB seems enough (mine’s 8GB)

Software to use: RabbitVCS

There are 3 parts, download all parts (Core, Nautilus & GEdit plugin), and install them

  • Select all 3 packages, right click > Open with Package Installer


  • the repo folder on thumbdrive is referred as /media/thumbdrive/project_repo
  • project folder is ~/project/my_project (folder contains your work)

Create new repository:

  1. Create a folder (for repo) on thumbdrive (/media/thumbdrive/project_repo)
  2. Go inside that folder, right click > RabbitVCS > Create repository here
  3. Create temporary folder (~/tmp) and create repo layout inside:
    • ~/tmp/trunk
    • ~/tmp/branches
    • ~/tmp/tags
  4. Import repo layout into repo inside the thumbdrive:
    • Select ~/tmp > right click > RabbitVCS > Import
    • Repository: file:///media/thumbdrive/project_repo
    • enter import message, and OK
  5. Import project folder into repo inside the thumbdrive:
    • Select ~/project/my_project, right click > RabbitVCS > Import
    • Repository: file:///media/thumbdrive/project_repo/trunk
    • enter message, and OK

Check out repo into another computer

Assuming this another computer running Windows, it should have TortoiseSVN installed.
Note: c:usersusername is referred as ~ in this post, repo folder in thumbdrive is e:project_repo

  1. Go to project folder (folder which your keep all your project files, e.g. ~projects)
  2. Right click > SVN Checkout
  3. URL of repository: file:///E:/project_repo/trunk
  4. Checkout directory – make sure it is ~projects, then OK