Getting a SVN Server running properly on WinXP/2000/Vista can be a confusing process, here's how I do it:
- Install TortioseSVN from http://tortoisesvn.net/downloads
- Right click on an empty folder and choose TortoiseSVN -> Create repository Here
- Install Apache Windows Server from http://httpd.apache.org/download.cgi
- Get 'Subversion Win32 binaries for Apache' from http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100 and put in C:\svn
- Copy C:\svn\bin\mod_authz.svn.so and C:\svn\bin\mod_dav_svn.so to C:\Program Files\Apache Software Foundation\Apache2.2\modules
- Edit C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf
Add/uncomment the following lines to the LoadModule section:
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
- Add the following to the end of the file:
DAV svn
SVNPath (path to the svn repository you made)
AuthType Basic
AuthName "Subversion repository"
AuthUserFile passwd
#AuthzSVNAccessFile svnaccessfile
#allow only authenticated users to access
Require valid-user
# allow read access to all, write access to authenticated users only
#Order deny,allow
#
# Require valid-user
#
- Next you need to create some users that can access your SVN repository through Apache
Open command prompt at C:\Program Files\Apache Software Foundation\Apache2.2
bin\htpasswd.exe -c passwd (username you want to add)
Note: it will prompt to set the user's password
- run the Apache Server
- On the router, make sure to enable port forwarding for TCP port 80 (www) and 3690 (svn)
- Test the Apache Server to make sure it's working:
http://localhost -> does the web server work?
http://localhost/svn -> does mod_dav, svn modules & authentication work on the server?
http://38.107.191.111 -> (this is your external ip) does remote access work for the server?
- Next you need to set up authentication for the actual SVN service (this is different than the Apache authentication in step 8).
Go to the directory you created your repository in (step 2) and go into the conf subdirectory.
edit the passwd file with a text editor and add a user and password in there (there should be commented out examples):
[users]
testusername = testpassword
- Open svnserve.conf in that same directory with a text editor.
make sure you have something like the following in there that's uncommented:
anon-access = none # this disallows anonymous people from accessing the repository, you can set this to read also
auth-access = write # read/write access for authenticated users
password-db = passwd # make sure this is uncommented, it's commented by default
- Next we need to install the SVN service
Open command prompt at C:\svn\bin
sc create svn.local binpath= "\"c:\svn-win32-1.5.2\bin\svnserve.exe\" --service --root F:\work\Andrograde\svn" displayname= "Subversion Repository" depend= Tcpip
Next go to Services and turn the service on
services.msc
go to Subversion Repository -> click start (optionally set it to Automatic)
- Test the repo-browser:
right click on a folder -> tortoiseSVN -> Repo-browser
svn://localhost -> test if it works internally
svn://38.107.191.111 -> (this is your external ip) test if it works remotely
Other things to check if it's not working
- Make sure the svn versions are the same throughout Apache, SVN and TortoiseSVN. If they're not the same version, you will get something like:
(20014)Error string not specified yet: Expected version '3' of repository; found version '5'
-
You get in TortoiseSVN
No access allowed to this repository
Make sure you have step 12 and 13 correct.
DAV svn
SVNPath (path to the svn repository you made)
AuthType Basic
AuthName "Subversion repository"
AuthUserFile passwd
#AuthzSVNAccessFile svnaccessfile
#allow only authenticated users to access
Require valid-user
# allow read access to all, write access to authenticated users only
#Order deny,allow
#
# Require valid-user
#
with this apache don't start]
(i use xampp)
<Location /svn>
DAV svn
SVNParentPath c:\svn
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile c:\svn\htaccess
Require valid-user
</Location>
<Location /svn/>
DAV svn
SVNParentPath c:\svn
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile c:\svn\htaccess
Require valid-user
</Location>
1st : First we set Path in system Variable -> Right Click On My
Computer -> Properties ->Advanced ->Environment Variable.
Then Edit The Path to C:\programe File \SubVersion\bin
2.Create new system variable as SVN_Edit and give variable value as
C:\ Program File \windows\ notepad.exe
3.: Open command promte " CMD" Type
cd:\sc create svnserve binpath= "c:\Programs\Subversion\bin\svnserve.exe --service -r
D:\ProjectFiles" displayname= "Subversion" depend= Tcpip start= auto
sc is command to create service in windows,
svnserve is service name
binpath : path to executiable file
--service is to start service at startup
D:\ProjectFiles : folder which you created in D-drive well act as SVN Repository
displayname : service name in services console
Start = auto is set to automatic start at system boot
depend= Tcpip works on ip
Then you get this result [SC] CreateService SUCCESS , if every is fine your SVN service is ready .......
Thats all Sanjay
Example: AuthUserFile "c:\Program Files\Apache Software Foundation\Apache2.2\passwd" That file have information about username and password.
<Location /svn>
DAV svn
#SVNParentPath c:\R1
SVNPath c:\R1
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile "c:\Program Files\Apache Software Foundation\Apache2.2\passwd"
Require valid-user
</Location>
Comment:
c:\R1 is SVN repository folder. I created it in step 2 of this manual
For first test I used Firefox:
http://localhost/svn. After that i wrote username and password that i defined in step 8.
http://www.open.collab.net/downloads/subversion