legacy-wiki
Subversion
Recovered from the older tannerjc.net wiki snapshot dated January 23, 2016.
My Repos
Dreamhost
http://wiki.dreamhost.com/Subversion#Upgrading_to_Newest_Subversion
- ssh tannerjc@tannerjc.net
- cd tannercj.net
- wget http://websvn.tigris.org/files/documents/1380/47525/websvn-2.3.1.tar.gz
- tar xvf websvn-2.3.1.tar.gz
- mv websvn-2.3.1 websvn
- cd /home/tannerjc/tannerjc.net/websvn/include
- cp distconfig.php config.php
Setup
-
Install packages and create necessary directories to store repos yum -y install subversion mod_dav_svn websvn mkdir /var/svn mkdir /var/svn/conf mkdir /var/svn/repos chown -R apache.apache /var/svn/repos
-
Edit the httpd directives for svn and DAV cp /etc/httpd/conf.d/subversion.conf /etc/httpd/conf.d/subversion.conf.orig vi /etc/httpd/conf.d/subversion.conf
[root@sasha ~]# cat /etc/httpd/conf.d/subversion.conf | egrep -v -e ^\# -e ^\$
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
Location /repos
DAV svn
SVNParentPath /var/svn/repos
# Limit write permission to list of valid users.
LimitExcept GET PROPFIND OPTIONS REPORT
# Require SSL connection for password protection.
# SSLRequireSSL
AuthType Basic
AuthName SVN server auth
AuthUserFile /var/svn/conf/passwd
Require valid-user
/LimitExcept
/Location
- Create users vi /var/svn/conf/authz
[root@sasha ~]# cat /var/svn/conf/authz
[/]
* =
jtanner = ######
-
Create httpd password for user(s) htpasswd -c /var/svn/conf/passwd jtanner
-
Edit websvn’s config.php to allow authorized access and directory location cp /etc/websvn/config.php /etc/websvn/config.php.orig vi /etc/websvn/config.php
[root@sasha conf.d]# cat /etc/websvn/config.php | egrep -v -e ^$ -e ^\/
?php
$config-addRepository('svn test repo', 'file:///var/svn/repos/test');
$config-setTemplatePath($locwebsvnreal/templates/calm/);
$config-useMultiViews();
$config-addInlineMimeType(text/plain);
$config-setMinDownloadLevel(2);
$config-useGeshi();
set_time_limit(0);
$config-expandTabsBy(8);
- Allow logins cp /etc/httpd/conf.d/websvn.conf /etc/httpd/conf.d/websvn.conf.orig vi /etc/httpd/conf.d/websvn.conf
[root@sasha conf.d]# cat /etc/httpd/conf.d/websvn.conf
Alias /websvn /usr/share/websvn/
Directory /usr/share/websvn/
Options MultiViews
DirectoryIndex wsvn.php
order deny,allow
#deny from all
#allow from 127.0.0.1
allow from all
/Directory
- Restart apache and login service httpd restart browser – http://localhost/websvn/
Creating a repo
svnadmin create /var/svn/repos/test
Deleting a repo
There is no command to delete a repository. Just delete the directory created by svnadmin manually … rm -rf /var/svn/repos/reponame
Importing code
-
Initial import mkdir -p /home/jtanner/code/testprog1 touch home/jtanner/code/testprog1/1 touch home/jtanner/code/testprog1/2 touch home/jtanner/code/testprog1/3 svn import –username jtanner –password ###### testprog1 file:///var/svn/repos/test/testprog1 -m Initial import
-
Listing files svn list file:///var/svn/repos/test svn list file:///var/svn/repos/test/testprog1
-
Adding all new files/directories svn add –force testprog1/*
-
Committing changes svn status testprog1 svn ci testprog1
Checking out code
- file method svn co file:///var/svn/repos/test/testprog testprog1
- http method URL path is dictated by Location directive in /etc/httpd/conf.d/subversion.conf svn co http://localhost/repos/test/testprog1 testprog1
Eclipse Integration
yum -y install eclipse-subclipse eclipse-epic websvn mod_dav_svn