Old:Installing SVN: Difference between revisions

From The Uniform Server Wiki
Jump to navigation Jump to search
No edit summary
(Removed excess category tags)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
----
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
----
=[http://awuhodynaro.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=
----
=[http://awuhodynaro.co.cc CLICK HERE]=
----
</div>
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.
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.


Line 15: Line 7:


== Apache Module Configuration ==
== Apache Module Configuration ==
# Edit Apache's configuration files (W:\usr\local\Apache2\conf\httpd.conf) and uncomment (remove the # from) this line if it is commented: &lt;pre&gt;LoadModule dav_module modules/mod_dav.so&lt;/pre&gt;
# Edit Apache's configuration files (W:\usr\local\Apache2\conf\httpd.conf) and uncomment (remove the # from) this line if it is commented: <pre>LoadModule dav_module modules/mod_dav.so</pre>
# Next find: &lt;pre&gt;LoadModule dav_fs_module modules/mod_dav_fs.so&lt;/pre&gt; and add this below it: &lt;pre&gt;&lt;nowiki&gt;LoadModule dav_svn_module modules/mod_dav_svn.so
# Next find: <pre>LoadModule dav_fs_module modules/mod_dav_fs.so</pre> and add this below it: <pre><nowiki>LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so&lt;/nowiki&gt;&lt;/pre&gt;
LoadModule authz_svn_module modules/mod_authz_svn.so</nowiki></pre>


== Configuring SVN ==
== Configuring SVN ==
# Create an empty folder (I used W:\svn), which will used as repository root.
# Create an empty folder (I used W:\svn), which will used as repository root.
# Create another empty folder (for example W:\svn\test) in your repository root.
# Create another empty folder (for example W:\svn\test) in your repository root.
# Open the Command Prompt (or MS-DOS Prompt in Win 9x), cd into your repository root. Execute:&lt;pre&gt;svnadmin create --fs-type bdb test&lt;/pre&gt;or&lt;pre&gt;svnadmin create --fs-type fsfs test&lt;/pre&gt; ''Note: test is the folder you created (under your repository root) earlier in Step #2; for more info on which fs-type to choose, read [http://svnbook.red-bean.com/en/1.1/ch05.html#svn-ch-5-sect-1.2.A Chapter 5, Repository Data-Stores] in the SVN book for more information ''
# Open the Command Prompt (or MS-DOS Prompt in Win 9x), cd into your repository root. Execute:<pre>svnadmin create --fs-type bdb test</pre>or<pre>svnadmin create --fs-type fsfs test</pre> ''Note: test is the folder you created (under your repository root) earlier in Step #2; for more info on which fs-type to choose, read [http://svnbook.red-bean.com/en/1.1/ch05.html#svn-ch-5-sect-1.2.A Chapter 5, Repository Data-Stores] in the SVN book for more information ''


== Integrating Apache + SVN ==
== Integrating Apache + SVN ==
First, you should add this anywhere in your configuration file (preferably between &quot;&lt;IfModule mod_dav.c&gt;&quot; and &quot;&lt;/IfModule&gt;&quot;):
First, you should add this anywhere in your configuration file (preferably between "<IfModule mod_dav.c>" and "</IfModule>"):
&lt;pre&gt;&lt;nowiki&gt;&lt;Location /svn&gt;
<pre><nowiki><Location /svn>
     Dav svn
     Dav svn
     SVNParentPath /svn
     SVNParentPath /svn
     AuthType Basic
     AuthType Basic
     AuthName &quot;Subversion Repositories&quot;
     AuthName "Subversion Repositories"
     AuthUserFile /htpasswd/svn/.htpasswd
     AuthUserFile /htpasswd/svn/.htpasswd
     &lt;LimitExcept GET PROPFIND OPTIONS REPORT&gt;
     <LimitExcept GET PROPFIND OPTIONS REPORT>
         Require valid-user
         Require valid-user
     &lt;/LimitExcept&gt;
     </LimitExcept>
&lt;/Location&gt;&lt;/nowiki&gt;&lt;/pre&gt; ''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 &lt;LimitExcept&gt;''
</Location></nowiki></pre> ''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)''
''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 &amp; password needed to modify your repositories. Open the Command Prompt again, cd into Apache's bin directory (W:\usr\local\Apache2\bin). Execute:&lt;pre&gt;htpasswd -c .htpasswd &lt;username&gt;&lt;/pre&gt; To add more usernames &amp; passwords, execute:&lt;pre&gt;&lt;nowiki&gt;htpasswd .htpasswd &lt;username&gt;&lt;/nowiki&gt;&lt;/pre&gt; ''Note: Replace &lt;nowiki&gt;&lt;username&gt;&lt;/nowiki&gt; with the username of your choice.''
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:<pre>htpasswd -c .htpasswd <username></pre> To add more usernames & passwords, execute:<pre><nowiki>htpasswd .htpasswd <username></nowiki></pre> ''Note: Replace <nowiki><username></nowiki> with the username of your choice.''
For more advanced configurations (not needed by many) view [http://tortoisesvn.tigris.org/docs/TortoiseSVN_en/ch03.html Setting Up an SVN Server].
For more advanced configurations (not needed by many) view [http://tortoisesvn.tigris.org/docs/TortoiseSVN_en/ch03.html Setting Up an SVN Server].


== Last Steps ==
== Last Steps ==
# If you are using version 3.3, please skip to step 4.
# If you are using version 3.3, please skip to step 4.
# Create a &quot;htpasswd&quot; directory in the W:/ drive if you are using version 3.2 or less.
# Create a "htpasswd" directory in the W:/ drive if you are using version 3.2 or less.
# Create a &quot;svn&quot; directory under the &quot;htpasswd&quot; directory.
# Create a "svn" directory under the "htpasswd" directory.
# Copy the .htpasswd file into the &quot;svn&quot; directory.
# Copy the .htpasswd file into the "svn" directory.
# Now, the time you've all been for. Restart Uniform Server.
# Now, the time you've all been for. Restart Uniform Server.
# Point your browser to http://localhost/svn/test (where test is the name of the repository you created earlier)
# Point your browser to http://localhost/svn/test (where test is the name of the repository you created earlier)


== Shortcuts ==
== Shortcuts ==
# If you do not understand how to make the .htpasswd file, you can just make the file and edit it with the contents &quot;username:password&quot; in the file.
# If you do not understand how to make the .htpasswd file, you can just make the file and edit it with the contents "username:password" in the file.


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
Line 57: Line 49:
If you installed to another location substitute paths accordingly.
If you installed to another location substitute paths accordingly.
=== How to install SVN ===
=== How to install SVN ===
{|cellspacing=&quot;6&quot;
{|cellspacing="6"
|-valign=&quot;top&quot;
|-valign="top"
|1)
|1)
|'''Run servers''' and check they function.  
|'''Run servers''' and check they function.  
|Just a quick check, close servers after testing.
|Just a quick check, close servers after testing.
|-valign=&quot;top&quot;
|-valign="top"
|2)
|2)
|Inside folder C:\UniServer_4_3\UniServer\'''udrive''' create two new folders '''svn_tools''' and '''svn''' &lt;br /&gt;
|Inside folder C:\UniServer_4_3\UniServer\'''udrive''' create two new folders '''svn_tools''' and '''svn''' <br />
C:\UniServer_4_3\UniServer\udrive\'''svn_tools'''&lt;br /&gt;
C:\UniServer_4_3\UniServer\udrive\'''svn_tools'''<br />
C:\UniServer_4_3\UniServer\udrive\'''svn'''
C:\UniServer_4_3\UniServer\udrive\'''svn'''
|You can choose different names and locate these outside of the UniServer folder.&lt;br /&gt;However we are placing these here for portability.&lt;br /&gt; Folder '''svn''' will contain your SVN repositories.
|You can choose different names and locate these outside of the UniServer folder.<br />However we are placing these here for portability.<br /> Folder '''svn''' will contain your SVN repositories.
|-valign=&quot;top&quot;
|-valign="top"
|3)
|3)
|Download File:  '''svn-win32-1.6.3.zip''' or newer.&lt;br /&gt;
|Download File:  '''svn-win32-1.6.3.zip''' or newer.<br />
Located at the bottom of this page: [http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100 '''tigris.org''']&lt;br /&gt;
Located at the bottom of this page: [http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100 '''tigris.org''']<br />
Extract to any folder
Extract to any folder
|Make sure any newer version is compatible with the version of Apache.
|Make sure any newer version is compatible with the version of Apache.
|-valign=&quot;top&quot;
|-valign="top"
|4)
|4)
|Copy the entire content of folder svn-win32-1.6.3\'''svn-win32-1.6.3'''&lt;br /&gt;
|Copy the entire content of folder svn-win32-1.6.3\'''svn-win32-1.6.3'''<br />
To folder C:\UniServer_4_3\UniServer\udrive\'''svn_tools'''&lt;br /&gt;
To folder C:\UniServer_4_3\UniServer\udrive\'''svn_tools'''<br />
Folder svn_tools will now contain folders '''bin''', '''iconv''', '''licenses''',&lt;br /&gt; '''share''' and file '''README.txt'''
Folder svn_tools will now contain folders '''bin''', '''iconv''', '''licenses''',<br /> '''share''' and file '''README.txt'''
|Once copied if you wish to save space delete the extracted files&lt;br /&gt; and svn-win32-1.6.3.zip they are no longer required.
|Once copied if you wish to save space delete the extracted files<br /> and svn-win32-1.6.3.zip they are no longer required.
|-valign=&quot;top&quot;
|-valign="top"
|5)
|5)
|Navigate to C:\UniServer_4_3\UniServer\udrive\svn_tools\'''bin'''&lt;br /&gt;
|Navigate to C:\UniServer_4_3\UniServer\udrive\svn_tools\'''bin'''<br />
Move files: '''mod_authz_svn.so''' and '''mod_dav_svn.so'''&lt;br /&gt;
Move files: '''mod_authz_svn.so''' and '''mod_dav_svn.so'''<br />
To folder: C:\UniServer_4_3\UniServer\udrive\usr\local\apache2\'''modules'''
To folder: C:\UniServer_4_3\UniServer\udrive\usr\local\apache2\'''modules'''
|Move the two modules to Apache's module folder;
|Move the two modules to Apache's module folder;
|-valign=&quot;top&quot;
|-valign="top"
|6)
|6)
|Navigate to C:\UniServer_4_3\UniServer\udrive\svn_tools\'''bin'''&lt;br /&gt;
|Navigate to C:\UniServer_4_3\UniServer\udrive\svn_tools\'''bin'''<br />
Copy these files:
Copy these files:


Line 99: Line 91:


To: C:\UniServer_4_3\UniServer\udrive\usr\local\apache2\'''bin'''
To: C:\UniServer_4_3\UniServer\udrive\usr\local\apache2\'''bin'''
|The above two modules have dependencies (dlls),&lt;br /&gt;
|The above two modules have dependencies (dlls),<br />
Apache resolves dependences by first looking in&lt;br /&gt;
Apache resolves dependences by first looking in<br />
its bin folder and then looks along system paths.&lt;br /&gt;
its bin folder and then looks along system paths.<br />




Generally these dlls are located on a system path&lt;br /&gt;
Generally these dlls are located on a system path<br />
however we want a portable installation hence they&lt;br /&gt;
however we want a portable installation hence they<br />
are copied to Apache’s bin (binary) folder.
are copied to Apache’s bin (binary) folder.
|-valign=&quot;top&quot;
|-valign="top"
|7)
|7)
|Edit file: C:\UniServer_4_3\UniServer\udrive\usr\local\apache2\conf\'''httpd.conf'''&lt;br /&gt;
|Edit file: C:\UniServer_4_3\UniServer\udrive\usr\local\apache2\conf\'''httpd.conf'''<br />
Confirm these modules are enabled as shown:
Confirm these modules are enabled as shown:
&lt;pre&gt;
<pre>
LoadModule dav_module modules/mod_dav.so
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_fs_module modules/mod_dav_fs.so
&lt;/pre&gt;
</pre>
|Configure Apache to use the subversion module.&lt;br /&gt;
|Configure Apache to use the subversion module.<br />
First check these modules are enabled.&lt;br /&gt;
First check these modules are enabled.<br />
Note, mod_dav.so is enabled by default.&lt;br /&gt;
Note, mod_dav.so is enabled by default.<br />
|-valign=&quot;top&quot;
|-valign="top"
|8)
|8)
|At the end of load modules section add these two lines:
|At the end of load modules section add these two lines:
&lt;pre&gt;
<pre>
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
&lt;/pre&gt;
</pre>
|The two lines inform Apache to load the svn modules.&lt;br /&gt;Add them just below:&lt;br /&gt;LoadModule vhost_alias_module modules/mod_vhost_alias.so
|The two lines inform Apache to load the svn modules.<br />Add them just below:<br />LoadModule vhost_alias_module modules/mod_vhost_alias.so
|-valign=&quot;top&quot;
|-valign="top"
|9)
|9)
|At the end of httpd.conf, add the following block of code.
|At the end of httpd.conf, add the following block of code.
&lt;pre&gt;
<pre>
&lt;location /svn&gt;
<location /svn>
   DAV svn
   DAV svn
   SVNListParentPath on
   SVNListParentPath on
   SVNParentPath C:/UniServer_4_3/UniServer/udrive/svn
   SVNParentPath C:/UniServer_4_3/UniServer/udrive/svn
&lt;/location&gt;
</location>
&lt;/pre&gt;
</pre>
|&lt;br /&gt;
|<br />
* '''svn''' Top level folder name &lt;nowiki&gt;http://localhost&lt;/nowiki&gt;/svn/*** any name after svn is assumed a repository request and passed to DAV for resolving   
* '''svn''' Top level folder name <nowiki>http://localhost</nowiki>/svn/*** any name after svn is assumed a repository request and passed to DAV for resolving   
* '''DAV svn''' Instructs Apache to pass the request onto the DAV layer for processing as a subversion (svn) request.  
* '''DAV svn''' Instructs Apache to pass the request onto the DAV layer for processing as a subversion (svn) request.  
* '''SVNListParentPath on''' Enables listing of all repositories for URL &lt;nowiki&gt;http://localhost&lt;/nowiki&gt;/'''svn'''
* '''SVNListParentPath on''' Enables listing of all repositories for URL <nowiki>http://localhost</nowiki>/'''svn'''
* '''SVNParentPath''' Absolute path to the parent folder containing all the repositories.&lt;br /&gt;'''''Note'':''' If you move the servers this path must be changed.
* '''SVNParentPath''' Absolute path to the parent folder containing all the repositories.<br />'''''Note'':''' If you move the servers this path must be changed.
|}
|}
'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
=== Testing SVN server ===
=== Testing SVN server ===
* Restart Servers
* Restart Servers
* Access the SVN repository. Type the following into a browser '''&lt;nowiki&gt;http://localhost/svn&lt;/nowiki&gt;'''  
* Access the SVN repository. Type the following into a browser '''<nowiki>http://localhost/svn</nowiki>'''  
Page displays
Page displays
&lt;pre&gt;
<pre>
Collection of Repositories
Collection of Repositories
page Powered by Subversion version 1.6.3 (r38063).
page Powered by Subversion version 1.6.3 (r38063).
&lt;/pre&gt;
</pre>
This confirms Apache has been configured correctly. Next step is to create an SVN repository.
This confirms Apache has been configured correctly. Next step is to create an SVN repository.


Line 159: Line 151:
This section shows how to create a repository using this tool and how to add a working project.   
This section shows how to create a repository using this tool and how to add a working project.   


'''''[[#top | Top]]'''''
==== Batch file ====
==== Batch file ====
The admin tools requires opening a command prompt and navigating to the svn_tools executables folder .
The admin tools requires opening a command prompt and navigating to the svn_tools executables folder .
Line 166: Line 157:


Name the batch file whatever you like I have named it '''z_start_svn_command_prompt.bat''' add the following content:
Name the batch file whatever you like I have named it '''z_start_svn_command_prompt.bat''' add the following content:
&lt;pre&gt;
<pre>
start &quot;SVN COMMAND PROMPT&quot; cmd.exe /k &quot;COLOR B0&quot;
start "SVN COMMAND PROMPT" cmd.exe /k "COLOR B0"
&lt;/pre&gt;
</pre>
Double click to run, a new command prompt is opened and the working folder is automatically set.
Double click to run, a new command prompt is opened and the working folder is automatically set.


Line 176: Line 167:


Run the batch file above and type the following command:
Run the batch file above and type the following command:
&lt;pre&gt;
<pre>
svnadmin.exe create ..\..\svn\myproject
svnadmin.exe create ..\..\svn\myproject
&lt;/pre&gt;
</pre>
* '''svnadmin.exe''' Runs the subversion administration program.
* '''svnadmin.exe''' Runs the subversion administration program.
* '''create''' Is the command to be run by svn admin. It creates a repository named '''myproject'''.
* '''create''' Is the command to be run by svn admin. It creates a repository named '''myproject'''.
** '''''Note'':''' You can specify an absolute path or a relative path to the folder '''myproject'''.&lt;br /&gt;For example:&lt;br /&gt;Absolute: '''C:\UniServer_4_3\UniServer\udrive\svn\myproject'''&lt;br /&gt;Relative:  '''..\..\svn\myproject''' - as shown above
** '''''Note'':''' You can specify an absolute path or a relative path to the folder '''myproject'''.<br />For example:<br />Absolute: '''C:\UniServer_4_3\UniServer\udrive\svn\myproject'''<br />Relative:  '''..\..\svn\myproject''' - as shown above
* If the folder '''myproject''' does not exist it is created. Adds subversion database and tracking folders.  
* If the folder '''myproject''' does not exist it is created. Adds subversion database and tracking folders.  


Line 188: Line 179:
Start the servers. To access repositories type either of the following into a browser:
Start the servers. To access repositories type either of the following into a browser:
   
   
# '''&lt;nowiki&gt;http://localhost/svn/&lt;/nowiki&gt;''' -- Displays Collection of Repositories page.
# '''<nowiki>http://localhost/svn/</nowiki>''' -- Displays Collection of Repositories page.
## All repositories in folder '''svn''' are listed as links.
## All repositories in folder '''svn''' are listed as links.
## Currently we have just one repository hence a single link “myproject” is displayed
## Currently we have just one repository hence a single link “myproject” is displayed
## Click this link to display “myproject” repository.
## Click this link to display “myproject” repository.
## If you do not want all repositories listed comment this line as shown: '''#SVNListParentPath on'''&lt;br /&gt;Accessing '''&lt;nowiki&gt;http://localhost/svn/&lt;/nowiki&gt;''' will now produce ''Forbidden You don't have permission to access /svn/ on this server''.  
## If you do not want all repositories listed comment this line as shown: '''#SVNListParentPath on'''<br />Accessing '''<nowiki>http://localhost/svn/</nowiki>''' will now produce ''Forbidden You don't have permission to access /svn/ on this server''.  
## You can still access a repository by entering its full URL see below.&lt;br /&gt;&amp;nbsp;  
## You can still access a repository by entering its full URL see below.<br />&nbsp;  
#'''&lt;nowiki&gt;http://localhost/svn/myproject/&lt;/nowiki&gt;''' -- You directly access a repository by name as shown for &quot;“myproject”. &lt;br /&gt;Viewing this repository with a browser you will find it empty.&lt;br /&gt; However view the same folder using '''Windows Explorer''' displays several SVN suport folders and files.
#'''<nowiki>http://localhost/svn/myproject/</nowiki>''' -- You directly access a repository by name as shown for "“myproject”. <br />Viewing this repository with a browser you will find it empty.<br /> However view the same folder using '''Windows Explorer''' displays several SVN suport folders and files.
## '''''Folders'':''' '''conf''', '''dav''', '''db''',  '''hooks''' and '''locks'''
## '''''Folders'':''' '''conf''', '''dav''', '''db''',  '''hooks''' and '''locks'''
## '''''Files'':''' '''README.txt''' and '''format'''
## '''''Files'':''' '''README.txt''' and '''format'''
Line 218: Line 209:
# Run batch file '''z_start_svn_command_prompt.bat''' (whatever you named it)
# Run batch file '''z_start_svn_command_prompt.bat''' (whatever you named it)
# Type the following:
# Type the following:
&lt;pre&gt;
<pre>
svn.exe import C:\a_svn_temp http://localhost/svn/myproject -m &quot;Initial import&quot;
svn.exe import C:\a_svn_temp http://localhost/svn/myproject -m "Initial import"
&lt;/pre&gt;
</pre>
This updates your repository with new folder structure and project.
This updates your repository with new folder structure and project.


View repository, type into browser &lt;nowiki&gt;http://localhost/svn/myproject&lt;/nowiki&gt;
View repository, type into browser <nowiki>http://localhost/svn/myproject</nowiki>


* The project page and status are displayed '''myproject - Revision 1:'''
* The project page and status are displayed '''myproject - Revision 1:'''




'''''Note'':''' If you do not include '''-m &quot;Some text&quot;''' SVN will complain about not being able to find a text editor.  
'''''Note'':''' If you do not include '''-m "Some text"''' SVN will complain about not being able to find a text editor.  


'''''[[#top | Top]]'''''
'''''[[#top | Top]]'''''
Line 241: Line 232:
* [http://subversion.tigris.org/ Subversion Homepage]
* [http://subversion.tigris.org/ Subversion Homepage]
* [http://tortoisesvn.tigris.org/ TortoiseSVN, a popular Win32 GUI SVN Client]
* [http://tortoisesvn.tigris.org/ TortoiseSVN, a popular Win32 GUI SVN Client]
[[Category: Uniform Server 4.0-Mona]]
[[Category: Installation]]
[[Category: User Made]]
[[Category: Self Install]]
[[Category: Development]]

Latest revision as of 21:17, 22 June 2013

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.

Installing SVN

  1. Download the latest Win32 SVN binaries from here. This guide uses the .exe Installer provided there.
  2. After installing / unpacking it, copy the contents of its httpd folder (usually C:\Program Files\Subversion\httpd) into Apache's module directory (Uniform Server's default is W:\usr\local\Apache2\modules)
  3. Copy libdb42.dll from the bin folder into the same module directory.

Apache Module Configuration

  1. Edit Apache's configuration files (W:\usr\local\Apache2\conf\httpd.conf) and uncomment (remove the # from) this line if it is commented:
    LoadModule dav_module modules/mod_dav.so
  2. Next find:
    LoadModule dav_fs_module modules/mod_dav_fs.so
    and add this below it:
    LoadModule dav_svn_module modules/mod_dav_svn.so

LoadModule authz_svn_module modules/mod_authz_svn.so

Configuring SVN

  1. Create an empty folder (I used W:\svn), which will used as repository root.
  2. Create another empty folder (for example W:\svn\test) in your repository root.
  3. Open the Command Prompt (or MS-DOS Prompt in Win 9x), cd into your repository root. Execute:
    svnadmin create --fs-type bdb test
    or
    svnadmin create --fs-type fsfs test
    Note: 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

Integrating Apache + SVN

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.

Last Steps

  1. If you are using version 3.3, please skip to step 4.
  2. Create a "htpasswd" directory in the W:/ drive if you are using version 3.2 or less.
  3. Create a "svn" directory under the "htpasswd" directory.
  4. Copy the .htpasswd file into the "svn" directory.
  5. Now, the time you've all been for. Restart Uniform Server.
  6. Point your browser to http://localhost/svn/test (where test is the name of the repository you created earlier)

Shortcuts

  1. If you do not understand how to make the .htpasswd file, you can just make the file and edit it with the contents "username:password" in the file.

Top

NEW Installing SVN on 4.3-Mona

The following assumes you installed US to C:\UniServer_4_3\UniServer.

If you installed to another location substitute paths accordingly.

How to install SVN

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
C:\UniServer_4_3\UniServer\udrive\svn

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
Extract to any folder

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
Folder svn_tools will now contain folders bin, iconv, licenses,
share and file README.txt

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
To folder: C:\UniServer_4_3\UniServer\udrive\usr\local\apache2\modules

Move the two modules to Apache's module folder;
6) Navigate to C:\UniServer_4_3\UniServer\udrive\svn_tools\bin

Copy these files:

  • intl3_svn.dll
  • libdb44.dll
  • libsvn_delta-1.dll
  • libsvn_fs-1.dll
  • libsvn_repos-1.dll
  • libsvn_subr-1.dll

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
its bin folder and then looks along system paths.


Generally these dlls are located on a system path
however we want a portable installation hence they
are copied to Apache’s bin (binary) folder.

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.
Note, mod_dav.so is enabled by default.

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>

  • svn Top level folder name http://localhost/svn/*** any name after svn is assumed a repository request and passed to DAV for resolving
  • DAV svn Instructs Apache to pass the request onto the DAV layer for processing as a subversion (svn) request.
  • SVNListParentPath on Enables listing of all repositories for URL http://localhost/svn
  • SVNParentPath Absolute path to the parent folder containing all the repositories.
    Note: If you move the servers this path must be changed.

Top

Testing SVN server

  • Restart Servers
  • Access the SVN repository. Type the following into a browser http://localhost/svn

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.

Top

Creating a repository - Command line

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.

Batch file

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.

Top

Create a repository

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
  • svnadmin.exe Runs the subversion administration program.
  • create Is the command to be run by svn admin. It creates a repository named myproject.
    • Note: You can specify an absolute path or a relative path to the folder myproject.
      For example:
      Absolute: C:\UniServer_4_3\UniServer\udrive\svn\myproject
      Relative: ..\..\svn\myproject - as shown above
  • If the folder myproject does not exist it is created. Adds subversion database and tracking folders.

Top

Repository Access

Start the servers. To access repositories type either of the following into a browser:

  1. http://localhost/svn/ -- Displays Collection of Repositories page.
    1. All repositories in folder svn are listed as links.
    2. Currently we have just one repository hence a single link “myproject” is displayed
    3. Click this link to display “myproject” repository.
    4. If you do not want all repositories listed comment this line as shown: #SVNListParentPath on
      Accessing http://localhost/svn/ will now produce Forbidden You don't have permission to access /svn/ on this server.
    5. You can still access a repository by entering its full URL see below.
       
  2. http://localhost/svn/myproject/ -- You directly access a repository by name as shown for "“myproject”.
    Viewing this repository with a browser you will find it empty.
    However view the same folder using Windows Explorer displays several SVN suport folders and files.
    1. Folders: conf, dav, db, hooks and locks
    2. Files: README.txt and format
    3. Never edit or delete the above folders or files. They tag and track all changes in a repository.

Note:

SVN comes complete with several other command line tools including a command line client.

Top

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.

  1. Create a temporary folder for example C:\a_svn_temp
  2. Inside this create three new folders (SVN recommended) named:
    1. trunk
    2. tags
    3. branches
  3. Copy your current stable project into folder trunk -- Note: For testing I copied folder C:\UniServer_4_3\UniServer\udrive\plugins
  4. Start servers
  5. Run batch file z_start_svn_command_prompt.bat (whatever you named it)
  6. Type the following:
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

  • The project page and status are displayed myproject - Revision 1:


Note: If you do not include -m "Some text" SVN will complain about not being able to find a text editor.

Top

Related Links

External Links