7.权限管理
1)添加用户和密码
htpasswd -c /opt/svn/authfile abc ---第一次设置用户
/opt/httpd/bin/htpasswd -m -b /opt/svn/authfile bow 123456(密码) ---再次添加用户
m:强制执行密码的MD5加密
b:从命令输入密码
/opt/httpd/bin/htpasswd -m /opt/svn/authfile bows
New password:
Re-type new password:
2)权限分配
vim /opt/svn/authz.conf
[test:/] ---仓库test 的根目录下的访问权限
abc = rw ---test仓库用户abc具有读和写的权限
[/] ---在所有仓库的根目录下
abc = rw
@groups = rw ---@表示这是个群组权限设置
[groups]
groups=abc bow
重启apache后,可以用URL访问SVN了。
当使用客户端连接是报500错误,需要将权限修改为766 库目录的用户修改为apache也可以修改为其他用户,但要在Apache的配置文件中将User和Group修改为相应的用户名和组名。
8.svn常用命令
1)查看最新修订版本的信息,可以使用 svnlook info 命令:
/opt/subversion/bin/svnlook info /opt/svn/test
abc
2012-04-23 16:51:08 +0800 (Mon, 23 Apr 2012)
0
命令输出了这个版本库的最新修订版本信息,包括作者、时间、日志字数和日志内容等。
2)显示版本库的具体树形结构,后面的 “--show-ids” 选项指定显示每一个显示元素的修改版本 ID
/ <0.0.r2/338>
b.txt <0-2.0.r2/95>
a.txt <0-1.0.r1/33>
3)svnserve –i
4)作为 inetd 启动
svnserve –d
三、Apache+SVN+SSL(自签证书)
1.cd httpd/conf
2.openssl genrsa -out httpd.key 1024
Generating RSA private key, 1024 bit long modulus
.................................++++++
...........++++++
e is 65537 (0x10001)
3.openssl req -new -key httpd.key -out httpd.pem -days 3650 -x509
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:CN ---国家
State or Province Name (full name) [Berkshire]:BJ ---城市
Locality Name (eg, city) [Newbury]:ZHANG ---用户名
Organization Name (eg, company) [My Company Ltd]:ABC ---公司名称
Organizational Unit Name (eg, section) []:IT ---部门名称
Common Name (eg, your name or your server's hostname) []:test ---主机名
Email Address []:abc@qq.com ---邮箱名
4.cd /opt/httpd/conf/extra/
5.vim httpd-ssl.conf
6.SSLCertificateFile "/opt/httpd//conf/httpd.pem"
7.SSLCertificateKeyFile "/opt/httpd//conf/httpd.key"
8.vim httpd.conf
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
SSLRequireSSL
</Directory>
9. ./apachectl -t ./apachectl restart
