trac svn apache2

Server setup

Install subversion

$ sudo apt-get install subversion

Install apache with subversion module:

$ sudo apt-get install apache2 libapache2-svn
$ sudo /etc/init.d/apache2 restart

Edit the dav stuff:

$ sudo gedit /etc/apache2/mods-available/dav_svn.conf

DAV svn
SVNPath /var/lib/svn

AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd

Require valid-user
#AuthzSVNAccessFile /etc/apache2/svn-acl

Place the files from subversion:

$ cd /var/lib
$ sudo chown -R www-data svn/

Creating the passwordfile:

$ sudo htpasswd -c /etc/apache2/dav_svn.passwd first-svn-user

Adding more users with:

$ sudo htpasswd /etc/apache2/dav_svn.passwd more-user

Restart the webserver:

$ sudo /etc/init.d/apache2 restart

Subversion can now be found at: http://localhost/svn/

Trac enviroment

$ sudo apt-get install trac

Create the containing directory with it's files (our trac project is called "horus")

$ sudo mkdir /var/lib/trac
$ sudo chown -R www-data /var/lib/trac/
$ cd /var/lib/trac/
$ sudo trac-admin horus initenv

This will generate the following output:

Creating a new Trac environment at /var/lib/trac/horus

Trac will first ask a few questions about your environment

in order to initialize and prepare the project database.

Please enter the name of your project.

This name will be used in page titles and descriptions.

Project Name [My Project]> Horus

Please specify the connection string for the database to use.

By default, a local SQLite database is created in the environment

directory. It is also possible to use an already existing

PostgreSQL database (check the Trac documentation for the exact

connection string syntax).

Database connection string [sqlite:db/trac.db]>

Please specify the type of version control system,

By default, it will be svn.

If you don't want to use Trac with version control integration,

choose the default here and don't specify a repository directory.

in the next question.

Repository type [svn]>

Please specify the absolute path to the version control

repository, or leave it blank to use Trac without a repository.

You can also set the repository location later.

Path to repository [/path/to/repos]> /var/lib/svn

Creating and Initializing Project


Project environment for 'Horus' created.

You may now configure the environment by editing the file:


If you'd like to take this new project environment for a test drive,

try running the Trac standalone web server `tracd`:

tracd --port 8000 /var/lib/trac/horus

Then point your browser to http://localhost:8000/horus.

There you can also browse the documentation for your installed

version of Trac, including information on further setup (such as

deploying Trac to a real web server).

The latest documentation can also always be found on the project



Change the owner and do a testrun with the webuser (test at http://localhost:8000/horus):

$ sudo chown -R www-data horus
$ sudo -u www-data tracd --port 8000 /var/lib/trac/horus


Trac in Apache 2

Create the location

$ sudo gedit /etc/apache2/sites-available/trac

#set up Trac handling
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /var/lib/trac
PythonOption TracUriRoot /trac

# Use the SVN password file.
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user

Install the python module and make the site available

$ sudo apt-get install libapache2-mod-python
$ sudo a2ensite trac
$ sudo apache2ctl restart

location can be reached at: http://localhost/trac/

No comments: