|
How to setup Subverion – Access over Internet
Regarding what’s subversion and what’s different between CVS and it pls refer to related doc, it’s out of scope of this doc, you may search in google I’m sure you will got a lot of result. Here I just want to demonstrate how to setup Subversion and combine with apache 2.0 to let your member access your Subversion server over internet, by this way you can cooper with anyone who live in the corner of the world.
Platform
OS: Window XP SP2
Web Server: Apache 2.0
Subversion: Svn1ClickSetup-0.8.6
Precondition
OK, let go to our point, first you must have two things in ready, installed the apache 2.0 and Subversion and ensure they can run respectively. You can got these two sets software in binary or compile them from source codes, in this doc, I present to you was installed by from binary. Apache home site provides the latest version to you to doughtload, to the Subversion, suggest you doughtload the compact package from http://svn1clicksetup.tigris.org ... lickSetup-0.8.6.exe, it was package with and special for window OS. If you don’t know how to setup your apache and Subversion, pls ask google.
Setup WebDav in Apache
After installed the Apache and Subversion successfully, now you can combine of them and provide the version control service to internet user.
1) Copy the module provided by Subversion to apache module folder.
According the mention in Subversion doc, Subversion can provide the service to internet user by use the protocol WebDav which apache support. You only need to do is copy the file “mod_dav_svn.so” to apache module folder, if you want to use SSL, pls copy the file “mod_authz_svn.so” also. In this doc, I just use the Base challenge type for authorization, so the file “mod_dav_svn.so” is enough.
2) Revise the apache configuration file http.d
After first step mention above, you next is do revise the apache configuration file to let Apache to load the related modules. User your default text editor open the file “http.d” and find the section LoadModule, insert two sentences as following
[code:1]LoadModule dav_module modules/mod_dav.so
LoadModule dav_svn_module modules/mod_dav_svn.so[/code:1]
3) Mapping the repository to URL
After last step, you have setup apache to load the necessary module to support webdav protocol already. By now, you need to map you repository to certain URL, in order to let internet user access to your repository via URL you must define the mapping in http.d file by using the tag <Location>. (Overview of process Subversion client request: When internet user type the url in subversion client and the request send to your web server, apache will delegate dav module to process this request, finally Subversion demand service will deal with and response to user).
Open http.d file, find the section <Locatoin>, append following directive after last </Location> tag.
[code:1]<Location /repos>
DAV svn
SVNPath c:/svnrepos
</Location>[/code:1]
here I assume that you have a repository in c:\svnrepos.
Save the file and restart the apache. Open your browser and type http://localhost:8080/repon (my web service port was 8080 in default), you ought to see the screen as below, if yes, congratulation! You can provide the Subversion to internet now. of cause, you must change apache listen address to public IP before.
Add Base authorization for Subversion while access in internet
Actually, you can use the Subversion as you SCM now, but remain one thing you should aware of, it was anyone in internet can access your repository now. if you just want your mates has access right to see your source code, suggest you take a time to have a look following content.
1) Prepare the username and password file.
Open your dos console, get into apache/bin directory, and execute following command:
[code:1]Htpasswd –c c:\svn-auth svnuser[/code:1]
And then system will ask you provide the password for the user “svnuser”, see below capture.
now, you have created a file to hold the man who have access right to your repository.
2) Open the http.d file and find the <Location> section which you added last time, insert following directive within between <Location /repos> and </Location>
[code:1]AuthType Basic
AuthName "Subversion repository"
AuthUserFile c:/svn-auth
Require valid-user[/code:1]
save your change and restart apache. Open your browser and type http://localhost:8080/repos, you ought to see the authorization dialog now, type the username “svnuser” and password, you can access to the repository if you pass the validation.
OK, for now on, your mates can access to your repository if s/he has access right.
Finally
Actually, I have omitted lot of topic about the directive in apache configuration file and how to use Subversion client, but I think all of these can find in the manual, in this doc I just want to focus on how to setup Subversion and apache to drive them to provide service to our mates over internet. Anyway, I welcome that received your email or comments if you feel I’m wrong or miss somewhat. Many tks.
MSN: [email protected] |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
×
|