5. create an authentication document, which is equivalent to passwd when svn is used.
Htpasswd-cm/data/subversion/conf/htpasswd. users jcq
New password:
Re-type new password:
6 Run: svnserve -- listen-host 10.88.0.26 -- listen-port 3690-r/opt/svndata/repos/-d
7. open port 3690 in the firewall
Vi/etc/sysconfig/
Iptables Http://www.linuxso.com/linuxrumen/10490.html
Note: modifications to user configuration files take effect immediately without the need to restart svn.
Passwd. conf [users] is required. the file format is as follows:
[Users]
= The following lists the users who want to access svn. each user has a row, for example:
[Users]
Username = password
Configure svn user access permissions:
# Vi/opt/svn/conf/authz. conf
Note:
* The user name displayed in the permission configuration file must be defined in the user configuration file.
* Changes to the permission configuration file take effect immediately without restarting svn.
User group format:
[Groups]
=,
One user group can contain one or more users separated by commas.
Version library directory format:
[ <版本库> :/Project/directory]
@ <用户组名> = <权限>
<用户名> = <权限>
The box number can be written in multiple ways:
[/] Indicates the root directory and the following. the root directory is specified when svnserve is started. we specify it as/opt/svndata. [/] indicates setting permissions for all vertices.
[Repos:/] indicates that you have set permissions for version Library repos.
[Repos2:/abc] indicates setting permissions for the abc project in the version Library repos2.
[Repos2:/abc/aaa] indicates setting permissions for the aaa Directory of the abc project in the version Library repos2
The permission subject can be a user group, user, or *. the user group is preceded by @, * indicating all users.
.
The permission can be w, r, wr, or null. if it is null, no permission is granted.
Example:
[Groups]
Admin = alan
[/]
@ Admin = rw
[Repos1:/abc/aaa]
King = rw
[Repos2:/pass]
King =
Svn configuration is complete.
3. start svn to create a user who starts svn
# Useradd svn
# Passwd svn
Set the user svn password as prompted
Allow user svn to access the version Library:
# Chown-R svn: svn/opt/svndata
Start svn
# Su-svn-c "svnserve-d listen-port 9999-r/opt/svndata"
Where:
Su-svn indicates to start svn as user svn
-D indicates running in daemon mode (running in the background)
Listen-port 9999 indicates port 9999, which can be replaced with the required port. Note that the root permission is required to use ports lower than 1024.
-R/opt/svndata specifies that the root directory is/opt/svndata
Check:
Ps-ef | grep svnserve
If the following information is displayed, the instance is successfully started:
Svn 6941 1 0? 00:00:00 svnserve-d listen-port 9999-r/opt/svndata
There are many ways to access svn through web. for details, refer to configuring websvn or bsSvnBrowser.
After all the configurations are completed, you can use the client SVN for operations.
Server Test:
# Cd/tmp
# Mkdir test
# Touch test.txt
# Svn import/tmp/test/file: // opt/svndata/repos-m "this is thiefirst import"
# Mkdir-p/tmp/test2
# Cd/tmp/test2
# Svn co file: // opt/svndata/repos/tmp/test2/
Or:
# Svn co svn: // {your-server-ip}: 9999/repos/
You should be able to see the file test.txt.
Test method:
# Telnet {your-server-ip} 9999 check whether the port is connected
If the above check fails, it may be that iptables is not enabled. you can set iptables:
# Vi/etc/sysconfig/iptables
Add:
-A output-p tcp-m tcp -- dport 9999-j ACCEPT
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.