Fedora Core plans do not include Subversion, only CVS is available. CentOS 4 plans have Subversion 1.4.0, and CentOS 5 plans will have the latest version currently offered by eApps (currently version 1.5.6.) If you are on Fedora or CentOS 4 and would like to upgrade to CentOS 5, contact eApps Support for more information. |
Customers running the CentOS 5 or greater operating system can skip directly to the Testing the svn server section of this User Guide. To see what operating system (OS) you have, click on the Subscriptions icon from the My Account tab of your Control Panel. Then click on the name of the subscription you want to see. The OS for the subscription will be displayed near the top of the page. If you are not on a CentOS 5 plan, but would like information on updating your plan, please contact eApps Technical Support for more information. |
All command line examples in this User Guide must be done from the command line of the VPS while logged in via SSH, as the root user. See the SSH User Guide for more information if necessary. The ability to edit files using the vi text editor is required. |
[root@example ~]# cd /etc/ [root@example etc]# vi services |
svn 3690/tcp # Subversion svn 3690/udp # Subversion |
[root@example etc]# cd /etc/xinetd.d [root@example xinetd.d]# vi svnserve |
#----------------COPY BELOW HERE---------------# # default: on # Subversion server service svnserve { socket_type = stream protocol = tcp user = root wait = no disable = no server = /usr/bin/svnserve server_args = -i port = 3690 } #------------COPY ABOVE HERE----------------------# |
[root@example xinetd.d]# cd /opt/ [root@example opt]# mkdir svnserve |
[root@example ~]# service xinetd restart Stopping xinetd: [ OK ] Starting xinetd: [ OK ] [root@example ~]# |
[root@example ~]# telnet localhost 3690 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. ( success ( 2 2 ( ) ( edit-pipeline svndiff1 absent-entries commit-revprops depth log-revprops partial-replay ) ) ) |
Make sure to substitute your own repo name for example_repo and your own domain name for example.com throughout this User Guide |
[root@example svnserve]# svnadmin create /opt/svnserve/example_repo [root@example svnserve]# ll total 4 drwxr-xr-x 6 root root 4096 Nov 11 12:48 example_repo [root@example svnserve]# |
[root@example svnserve]# cd example_repo/ [root@example example_repo]# ll total 24 drwxr-xr-x 2 root root 4096 Nov 11 12:48 conf drwxr-sr-x 6 root root 4096 Nov 11 12:48 db -r--r--r-- 1 root root 2 Nov 11 12:48 format drwxr-xr-x 2 root root 4096 Nov 11 12:48 hooks drwxr-xr-x 2 root root 4096 Nov 11 12:48 locks -rw-r--r-- 1 root root 229 Nov 11 12:48 README.txt [root@example example_repo]# cd conf/ [root@example conf]# ll total 12 -rw-r--r-- 1 root root 1080 Nov 11 12:48 authz -rw-r--r-- 1 root root 309 Nov 11 12:48 passwd -rw-r--r-- 1 root root 2279 Nov 11 12:48 svnserve.conf [root@example conf]# [root@example conf]# vi svnserve.conf |
# anon-access = read # auth-access = write ~ ~ # password-db = passwd |
[root@example conf]# vi passwd [users] # harry = harryssecret # sally = sallyssecret example_user = examplesecret |
This is just a very simple and quick example of using the svn command. svn has 25+ subcommands and over 30 switches. For any questions on svn subcommands and their switches, please refer to the official Subversion documentation. Links to the Subversion documentation are in the Links to other information section of this User Guide. |
macbook:~ macuser$ svn import -m "Initial import" svn://example.com/example_repo/example_project Authentication realm: <svn://example.com:3690> 34b20c70-fca9-4426-b857-32e3d4496b62 Password for 'macuser': press enter Authentication realm: <svn://example.com:3690> 34b20c70-fca9-4426-b857-32e3d4496b62 Username: example_user Password for 'example_user': passwd Adding (bin) OODoc.odt Adding UG.txt Adding README.txt Adding html_doc.html Committed revision 0. macbook:~ macuser$ |
macbook:~ macuser$ svn co svn://example.com/example_repo/example_project A example_project/OODoc.odt A example_project/UG.txt A example_project/README.txt A example_project/html_doc.html Checked out revision 1. macbook:~ macuser$ |
macbook:~ macuser$ svn co svn+ssh://webadmin@example.com/opt/svnserve/example_repo/example_project webadmin@example.com?s password: passwd webadmin@example.com's password: passwd A example_project/OODoc.odt A example_project/UG.txt A example_project/README.txt A example_project/html_doc.html Checked out revision 6. macbook:~ macuser$ |
macbook:~macuser$ svn commit -m "changed UG.txt" webadmin@example.com's password: passwd Sending UG.txt Transmitting file data . Committed revision 7. macbook:~ macuser$ |
Customers running the CentOS 5 or greater operating system can skip directly to the Configuring mod_dav_svn section of this User Guide. The mod_dav_svn module was installed on your VPS when Subversion was installed. |
[webadmin@example ~]$ svn --version svn, version 1.4.0 (r21228) compiled Oct 31 2006, 10:52:34 |
All command line examples must be done from the command line of the VPS while logged in via SSH, as the root user. See the SSH User Guide for more information if necessary. |
[root@example ~]# wget "http://repo-centos.eapps.com/centos/4.7/updates/i386/RPMS/mod_dav_svn-1.4.0-1.ep.i386.rpm" --07:15:21-- http://repo-centos.eapps.com/centos/4.7/updates/i386/RPMS/mod_dav_svn-1.4.0-1.ep.i386.rpm Resolving repo-centos.eapps.com... 69.89.14.200 Connecting to repo-centos.eapps.com|69.89.14.200|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 73414 (72K) [application/x-rpm] Saving to: `mod_dav_svn-1.4.0-1.ep.i386.rpm' 100%[========================================================>] 73,414 --.-K/s in 0.007s 07:15:21 (10.6 MB/s) - `mod_dav_svn-1.4.0-1.ep.i386.rpm' saved [73414/73414] |
[root@example ~]# rpm -ivh mod_dav_svn-1.4.0-1.ep.i386.rpm Preparing... ############################## [100%] 1:mod_dav_svn ############################## [100%] Stopping httpd: [ OK ] Starting httpd: [ OK ] |
[root@example ~]# cd /etc/httpd/conf.d/ [root@example conf.d]# cp subversion.conf{,.bck} [root@example conf.d]# vi subversion.conf |
#LoadModule dav_svn_module modules/mod_dav_svn.so |
<Location /repository_name> DAV svn SVNPath /opt/svnserve/repository_name </Location> |
<Location /example_repo> DAV svn SVNPath /opt/svnserve/example_repo </Location> |
[root@example conf.d]# service httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ] [root@example conf.d]# |
<Location /example_repo> DAV svn SVNPath /opt/svnserve/example_repo AuthType Basic AuthName "Example Repo" AuthUserFile /etc/subversion/svn-passwd-file Require valid-user </Location> |
The AuthUserFile location and name are not fixed, and can be anywhere on the VPS that a non-root user would have access to. This setup is shown for example purposes. The AuthName is whatever you want to call the repo. |
[root@example conf.d]# cd /etc/subversion/ [root@example subversion]# ll total 0 [root@example subversion]# htpasswd -cm svn-passwd-file example_user New password: passwd Re-type new password: passwd Adding password for user example_user [root@example subversion]# cat svn-passwd-file example_user:$apr1$IoY92LdD$Brl.VjmBEpJDVqNnzvnkE0 [root@example subversion]# htpasswd -m svn-passwd-file new_user New password: passwd Re-type new password: passwd Adding password for user new_user [root@example subversion]# cat svn-passwd-file example_user:$apr1$IoY92LdD$Brl.VjmBEpJDVqNnzvnkE0 new_user:$apr1$fGevOrYp$MegyRXFh1gT2QdbKnj2jL1 [root@example subversion]# |
[root@example ~]# cd /opt/svnserve/ [root@example svnserve]# ll total 4 drwxr-xr-x 6 root root 4096 Nov 11 12:48 example_repo [root@example svnserve]# chown -R apache:apache example_repo/ [root@example svnserve]# ll total 4 drwxr-xr-x 6 apache apache 4096 Nov 11 12:48 example_repo [root@example svnserve]# |