Setup Trac and Subversion
Setup Trac and Subversion
First install packages for both Trac and Subversion. We’ll be using Apache to publish the Subversion reposatoriesapt-get install python-setuptools trac subversion libapache2-svn
Create the SVN reposatory directory structure, used to create new reposatories latermkdir /var/svn/
mkdir /var/svn/tmpproject
mkdir /var/svn/tmpproject/branches
mkdir /var/svn/tmpproject/tags
mkdir /var/svn/tmpproject/trunk
Enable the Apache SVN module
a2enmod dav_fs
Create a password file containing users that have access to the Subversion reposatories and Trachtpasswd -c /etc/apache2/svn.passwd user1
htpasswd /etc/apache2/svn.passwd user2
Edit the apache configurations to enable Trac and Subversion SVN (pico /etc/apache2/sites-enabled/000-default). Add the following lines:
DAV svn
SVNParentPath /var/svn
SVNAutoversioning on
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/svn.passwd
Require valid-user
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
Alias /trac “/usr/share/trac/htdocs”
Create a directory for Trac projectsmkdir /var/trac
Create projects
Subversion reposatorysvnadmin create /var/svn/myproject --fs-type fsfs
svn import /var/svn/tmpproject file:///var/svn/myproject -m "initial import"
find /var/svn/myproject -type f -exec chmod 660 {} \;
find /var/svn/myproject -type d -exec chmod 2770 {} \;
chown -R root.www-data /var/svn/myproject
Trac projecttrac-admin /var/trac/myproject initenv
find /var/trac/myproject -type f -exec chmod 660 {} \;
find /var/trac/myproject -type d -exec chmod 2770 {} \;
chown -R root.www-data /var/trac/myproject
Configure Apache to publish the new project (pico /etc/apache2/sites-enabled/000-default). Add the following lines:ScriptAlias /projects/myproject /usr/share/trac/cgi-bin/trac.cgi
a
SetEnv TRAC_ENV "/var/trac/myproject"
AuthType Basic
AuthName "Trac - myproject"
AuthUserFile /etc/apache2/svn.passwd
Require valid-user
Restart Apache/etc/init.d/apache2 force-reload
Give a user administrator permissions to the projecttrac-admin /var/trac/myproject
permission add user1 TRAC_ADMIN
You can now access your Trac project by browsing with your favorite browser to http://localhost/projects/myproject.
To access the Subversion reposatory you can use any Subversion client. If you’re using Windows, TortoiseSVN would be a good choice.
No hay comentarios:
Publicar un comentario