David Thomas Baker » Web » Installing SVN & Trac on a Plesk host

Process I followed to install subversion and make it available via mod dav svn on a plesk host.

Some notes incase I need to do it again:

  • create new domain in plesk to host my svn + trac install. chose php safe mode.
  • setup ftp
install svn
  • as root on the server install subversion and subversion-tools (using debian: apt-get install subversion subversion-tools libapache2-svn)
  • as root create a new svn repo in the sites directory (ie: the one above httpdocs/)
    # cd /var/www/vhosts/mysite.com/
    # mkdir svn
    # svnadmin create svn/my_repo
  • enable mod dav:
    # a2enmod dav
    # a2enmod dav_svn
    # /etc/init.d/apache2 restart
  • time to edit the apache config for this site
    add the below to /var/www/vhosts/labs.webitor.com.au/conf/vhost.conf
             <Location /svn>
                     DAV svn
                     SVNParentPath /var/www/vhosts/mysite.com/svn/
                     AuthType Basic
                     AuthName "SVN"
                     AuthUserFile /var/www/vhosts/mysite.com/svn.password
                     Require valid-user
             </Location>
  • Create the htpassword:
    # htpasswd -c /var/www/vhosts/mysite.com/svn.password username
  • Update plesk to install your vhost.conf file
    #  /usr/local/psa/admin/sbin/websrvmng -u --vhost-name=mysite.com
  • Now you should be right with svn, visit mysite.com/svn, enter your username/password and you should see a list of your repositories.

install trac

  • download trac to server wget http://ftp.edgewall.com/pub/trac/Trac-0.11.tar.gz
  • tar zxvf Trac-0.11.tar.gz
  • cd Trac-0.11
  • less INSTALL << read it
  • apt-get install python
  • apt-get install python-genshi
  • apt-get install python-sqlite
  • apt-get install libapache2-mod-python
  • a2enmod mod_python
  • /etc/init.d/apache2 restart
  • apt-get install python-setuptools
  • run the trac installer, tell it the path to your svn repo above
  • python ./setup.py install
  • trac-admin /var/www/vhost/mysite.com/trac/myproject initenv
  • chown www-data: /var/www/vhost/mysite.com/trac -R
  • vi conf/vhost.conf
    add these:
    <Location /trac/webitor>
       SetHandler mod_python
       PythonInterpreter main_interpreter
       PythonHandler trac.web.modpython_frontend
       PythonOption TracEnv /var/www/vhosts/mysite.com/trac/myproject
       PythonOption TracUriRoot /trac/webitor
    </Location>
    <Location /trac/webitor/login>
      AuthType Basic
      AuthName "trac"
      AuthUserFile /var/www/vhosts/mysite.com/svn.password 
    Require valid-user
    </Location>
  • apt-get install python-subversion
  • /etc/init.d/apache2 force-reload
  • now hit mysite.com/trac/myproject and  you should see it! woot!

configure trac

  • as root: 
    # trac-admin /var/www/vhosts/mysite.com/trac/myproject permission add myusername TRAC_ADMIN
  • the above will give you a new "ADMIN" tab in the trac environment, so you can use the web based system to control settings instead of `trac-admin`

svn stuff

  • you need to import you code into svn initially, like this:
    # cd /path/to/my/code/
    # svn import -m "initial import" http://mysite.com/svn/my_repo/project_name
        enter username/password for svn and away it goes
  • after you have imported your code into svn, you have to "check out" a copy of the code again in order to work on it and have svn manage everything.
  • two ways to get code out of svn, "check out" and "export.
  • you use "check out" when you want to modify code and check it back in to svn.
  • you use "export" when you want to grab a copy of the code to for example deploy on a server
  • like this:
    # cd /path/to/where/i/want/to/edit/code
    # svn co http://mysite.com/svn/my_repo/project_name
  • code will be checked out into a folder called "project_name" in the current directory.
  • if you look in there you will see a bunch of .svn folders, they store all the svn repo details, dont change them :P
  • after you modify some code, type
    # svn commit
  • it will give you a list of all the changes you have made, and commit them back to the svn repo
  • you can then use trac to browse through the source code and the revision history.
Posted by David Baker in: Web |
Tags:
Perm Link: link
Some ads...

Search My Site

Featured Projects

Collector Comics is THE place to buy, sell, and research comics online. Launching soon.
Launch » Screenshot »
Webitor is a kick-ass easy to use, easy to extend, non-database driven Content Management System. Version 2 with reseller plan coming soon.
Launch » Version 1 »
GC Lounge is my own pet social network and test bed for social related code. Made by locals for locals.
Launch »
GG has indexed over half a million recent Trade Mark applications. This revolutionary tool is extremely valuable for industry experts.
Launch »
GCWiFi is the hub for techies interested in joining a ad-hoc wireless mesh spread across the Gold Coast
Launch »
Web based financial client management system
Launch »
OS Commerce modules and template modification
Launch »
View More Projects »

Daves Friends

BlueTeddy
WebSpark
GC Designer Forum
IPWealth Trademarks
Cheap Websites
Bonsai Shop
Webitor CMS Resellers
Hayley Crook
David Novakovic
Ben Novakovic
Richard Morwood
Gold Coast Linux
Aussie Click
CMS Website Design
Inspire Tuition
Gold Coast Music Network and Gold Coast Gig Guide

Chat with Dave

Powered by...

In the works

Webitor - Easy to use Content Management System with Shop, Newsletter, and Reseller plan