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
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/myproject
- 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/mysite.com/conf/vhost.conf
- 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
you should be right with svn, visit mysite.com/svn, enter your
username/password and you should see a list of your repositories.
- download trac to server wget http://ftp.edgewall.com/pub/trac/Trac-0.11.tar.gz
tar zxvf Trac-0.11.tar.gz
less INSTALL << read it
apt-get install python python-genshi python-sqlite libapache2-mod-python 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
PythonOption TracEnv /var/www/vhosts/mysite.com/trac/myproject
PythonOption TracUriRoot /trac/myproject
apt-get install python-subversion
- now hit mysite.com/trac/myproject and you should see it! woot!
- as root:
# trac-admin /var/www/vhosts/mysite.com/trac/myproject permission add myusername TRAC_ADMIN
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
- 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
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 😛
- 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