This guide will show you how to install a Subversion (SVN) server with Uniform Server. This guide assumes that you have a clean installation of Uniform Server running currently and do not have another version of Apache installed on your PC.
Contents |
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.soand add this below it:
LoadModule dav_svn_module modules/mod_dav_svn.so
svnadmin create --fs-type bdb testor
svnadmin create --fs-type fsfs testNote: test is the folder you created (under your repository root) earlier in Step #2; for more info on which fs-type to choose, read Chapter 5, Repository Data-Stores in the SVN book for more information
First, you should add this anywhere in your configuration file (preferably between "<IfModule mod_dav.c>" and "</IfModule>"):
<Location /svn>
Dav svn
SVNParentPath /svn
AuthType Basic
AuthName "Subversion Repositories"
AuthUserFile /htpasswd/svn/.htpasswd
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location> Note #1: If you do not want your repository to have read access for everyone (even those who do not have the password) remove the <LimitExcept>
Note #2: /svn is the path to your repository root, if you used any drive other than what Apache is on (Uniform Server default = W:\) for your repository root, you'll have to put the drive letter in front of the / (for example, C:\SVN becomes C:/SVN)
Next, create the .htpasswd file which will store the username & password needed to modify your repositories. Open the Command Prompt again, cd into Apache's bin directory (W:\usr\local\Apache2\bin). Execute:htpasswd -c .htpasswd <username>To add more usernames & passwords, execute:
htpasswd .htpasswd <username>Note: Replace <username> with the username of your choice.
For more advanced configurations (not needed by many) view Setting Up an SVN Server.
The following assumes you installed US to C:\UniServer_4_3\UniServer.
If you installed to another location substitute paths accordingly.
| 1) | Run servers and check they function. | Just a quick check, close servers after testing. |
| 2) | Inside folder C:\UniServer_4_3\UniServer\udrive create two new folders svn_tools and svn C:\UniServer_4_3\UniServer\udrive\svn_tools | You can choose different names and locate these outside of the UniServer folder. However we are placing these here for portability. Folder svn will contain your SVN repositories. |
| 3) | Download File: svn-win32-1.6.3.zip or newer. Located at the bottom of this page: tigris.org | Make sure any newer version is compatible with the version of Apache. |
| 4) | Copy the entire content of folder svn-win32-1.6.3\svn-win32-1.6.3 To folder C:\UniServer_4_3\UniServer\udrive\svn_tools | Once copied if you wish to save space delete the extracted files and svn-win32-1.6.3.zip they are no longer required. |
| 5) | Navigate to C:\UniServer_4_3\UniServer\udrive\svn_tools\bin Move files: mod_authz_svn.so and mod_dav_svn.so | Move the two modules to Apache's module folder; |
| 6) | Navigate to C:\UniServer_4_3\UniServer\udrive\svn_tools\bin Copy these files:
To: C:\UniServer_4_3\UniServer\udrive\usr\local\apache2\bin | The above two modules have dependencies (dlls), Apache resolves dependences by first looking in
|
| 7) | Edit file: C:\UniServer_4_3\UniServer\udrive\usr\local\apache2\conf\httpd.conf Confirm these modules are enabled as shown: LoadModule dav_module modules/mod_dav.so LoadModule dav_fs_module modules/mod_dav_fs.so | Configure Apache to use the subversion module. First check these modules are enabled. |
| 8) | At the end of load modules section add these two lines:
LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so | The two lines inform Apache to load the svn modules. Add them just below: LoadModule vhost_alias_module modules/mod_vhost_alias.so |
| 9) | At the end of httpd.conf, add the following block of code.
<location /svn> DAV svn SVNListParentPath on SVNParentPath C:/UniServer_4_3/UniServer/udrive/svn </location> |
|
Page displays
Collection of Repositories page Powered by Subversion version 1.6.3 (r38063).
This confirms Apache has been configured correctly. Next step is to create an SVN repository.
To create a repository use the command line tool svnadmin.exe
This section shows how to create a repository using this tool and how to add a working project.
The admin tools requires opening a command prompt and navigating to the svn_tools executables folder .
This I find very tedious hence create the following batch file in folder C:\UniServer_4_3\UniServer\udrive\svn_tools\bin
Name the batch file whatever you like I have named it z_start_svn_command_prompt.bat add the following content:
start "SVN COMMAND PROMPT" cmd.exe /k "COLOR B0"
Double click to run, a new command prompt is opened and the working folder is automatically set.
You need to create at least one blank repository choose a name that matches your project for this example I will use “myproject”
Run the batch file above and type the following command:
svnadmin.exe create ..\..\svn\myproject
Start the servers. To access repositories type either of the following into a browser:
Note:
SVN comes complete with several other command line tools including a command line client.
Starting with an empty repository you probably want to quickly set it up and publish your current project as it stands.
The following shows a quick way to do this it also includes SVN’s recommended folder structure.
svn.exe import C:\a_svn_temp http://localhost/svn/myproject -m "Initial import"
This updates your repository with new folder structure and project.
View repository, type into browser http://localhost/svn/myproject
Note: If you do not include -m "Some text" SVN will complain about not being able to find a text editor.