Old:Installing SVN: Difference between revisions

m
no edit summary
(Numbered lists will be messed up if list item is longer than a paragraph)
mNo edit summary
Line 42: Line 42:
== 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 "username:password" 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]]'''''
== 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 ===
{|cellspacing="6"
|-valign="top"
|1)
|'''Run servers''' and check they function.
|Just a quick check, close servers after testing.
|-valign="top"
|2)
|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'''<br />
C:\UniServer_4_3\UniServer\udrive\'''svn'''
|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="top"
|3)
|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''']<br />
Extract to any folder
|Make sure any newer version is compatible with the version of Apache.
|-valign="top"
|4)
|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'''<br />
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<br /> and svn-win32-1.6.3.zip they are no longer required.
|-valign="top"
|5)
|Navigate to C:\UniServer_4_3\UniServer\udrive\svn_tools\'''bin'''<br />
Move files: '''mod_authz_svn.so''' and '''mod_dav_svn.so'''<br />
To folder: C:\UniServer_4_3\UniServer\udrive\usr\local\apache2\'''modules'''
|Move the two modules to Apache's module folder;
|-valign="top"
|6)
|Navigate to C:\UniServer_4_3\UniServer\udrive\svn_tools\'''bin'''<br />
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),<br />
Apache resolves dependences by first looking in<br />
its bin folder and then looks along system paths.<br />
Generally these dlls are located on a system path<br />
however we want a portable installation hence they<br />
are copied to Apache’s bin (binary) folder.
|-valign="top"
|7)
|Edit file: C:\UniServer_4_3\UniServer\udrive\usr\local\apache2\conf\'''httpd.conf'''<br />
Confirm these modules are enabled as shown:
<pre>
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
</pre>
|Configure Apache to use the subversion module.<br />
First check these modules are enabled.<br />
Note, mod_dav.so is enabled by default.<br />
|-valign="top"
|8)
|At the end of load modules section add these two lines:
<pre>
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
</pre>
|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="top"
|9)
|At the end of httpd.conf, add the following block of code.
<pre>
<location /svn>
  DAV svn
  SVNListParentPath on
  SVNParentPath C:/UniServer_4_3/UniServer/udrive/svn
</location>
</pre>
|<br />
* '''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.
* '''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.<br />'''''Note'':''' If you move the servers this path must be changed.
|}
'''''[[#top | Top]]'''''
=== Testing SVN server ===
* Restart Servers
* Access the SVN repository. Type the following into a browser '''<nowiki>http://localhost/svn</nowiki>'''
Page displays
<pre>
Collection of Repositories
page Powered by Subversion version 1.6.3 (r38063).
</pre>
This confirms Apache has been configured correctly. Next step is to create an SVN repository.
'''''[[#top | 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. 
'''''[[#top | Top]]'''''
==== 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:
<pre>
start "SVN COMMAND PROMPT" cmd.exe /k "COLOR B0"
</pre>
Double click to run, a new command prompt is opened and the working folder is automatically set.
'''''[[#top | 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:
<pre>
svnadmin.exe create ..\..\svn\myproject
</pre>
* '''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'''.<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.
'''''[[#top | Top]]'''''
==== Repository Access ====
Start the servers. To access repositories type either of the following into a browser:
# '''<nowiki>http://localhost/svn/</nowiki>''' -- Displays Collection of Repositories page.
## All repositories in folder '''svn''' are listed as links.
## Currently we have just one repository hence a single link “myproject” is displayed
## Click this link to display “myproject” repository.
## 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.<br />&nbsp;
#'''<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'''
## '''''Files'':''' '''README.txt''' and '''format'''
## 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 | 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.
# Create a temporary folder for example '''C:\a_svn_temp'''
# Inside this create three new folders (SVN recommended) named:
## '''trunk'''
## '''tags'''
## '''branches'''
# Copy your current stable project into folder '''trunk''' -- Note: For testing I copied folder C:\UniServer_4_3\UniServer\udrive\'''plugins''' 
# '''Start''' servers
# Run batch file '''z_start_svn_command_prompt.bat''' (whatever you named it)
# Type the following:
<pre>
svn.exe import C:\a_svn_temp http://localhost/svn/myproject -m "Initial import"
</pre>
This updates your repository with new folder structure and project.
View repository, type into browser <nowiki>http://localhost/svn/myproject</nowiki>
* 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 | Top]]'''''
== Related Links ==
* [[SVN: Introduction|Portable Subversion (SVN)]] - Running on 5.0-Nano


== External Links ==
== External Links ==
Line 50: Line 234:




[[Category: Uniform Server 4.0-Mona]]
[[Category: Installation]]
[[Category: Installation]]
[[Category: User Made]]
[[Category: User Made]]
[[Category: Self Install]]
[[Category: Self Install]]
[[Category: Development]]
[[Category: Development]]