* 停止服务:sudo /usr/sbin/apachectl stop
* 开启服务:sudo /usr/sbin/apachectl start
* 重启服务:sudo /usr/sbin/apachectl restart
svn 服务器 命令
Mac下搭建svn服务器和XCode配置svn
先打开命令行终端。
1、创建svn repository
svnadmin create /yourpath/svnroot/repository
2、配置svn用户权限。
/ yourpath /svnroot/repository/conf/目录下存在3个文件:
authz,passwd,svnserve.conf。。
1)svnserve.conf:
将里面的
anon-access = read
auth-access = write
password-db = passwd
……
authz-db = authz
四行前的#号去掉,再将anon-access = read改为anon-access = none(禁止匿名访问,这里如果不改的话,会出现无法读取日志,比如在Mac上用Versions软件时,读不了时间线Timeline)。在#号后是有空格的,也得去掉,让文字顶格。
如果不使用authz-db = authz则不需要去掉该行的#号,也不需要配置第3)步的authz文件。
修改后如下:
anon-access = read
anon-access = none
auth-access = write
password-db = passwd
……
authz-db = authz
2)passwd:
按示例添加用户名和密码
This file is an example password filefor svnserve.
Its format is similar to that ofsvnserve.conf. As shown in the
example below it contains one sectionlabelled [users].
The name and password for each userfollow, one account per line.
[users]
harry = harryssecret
sally = sallyssecret
3)authz:
This file is an example authorizationfile for svnserve.
Its format is identical to that ofmod_authz_svn authorization
files.
As shown below each section definesauthorizations for the path and
(optional) repository specified by thesection name.
The authorizations follow. Anauthorization line can refer to:
- a single user,
- a group of users defined in a special [groups] section,
- an alias defined in a special [aliases] section,
- all authenticated users, using the '$authenticated' token,
- only anonymous users, using the '$anonymous' token,
- anyone, using the '*' wildcard.
A match can be inverted by prefixingthe rule with '~'. Rules can
grant read ('r') access, read-write('rw') access, or no access
('').
[aliases]
joe = /C=XZ/ST=Dessert/L=SnakeCity/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
[groups]
harry_and_sally =harry,sally
harry_sally_and_joe =harry,sally,&joe
[/foo/bar]
harry = rw
&joe = r
* =
对所有版本库的权限设置用[/]
group名称前要加@,用户名不加。
- = 是为所有人设置权限,这里是设置其他所有人没有读写权限。
[/]
@harry_and_sally = rw - =
[repository:/baz/fuz]
@harry_and_sally = rw
* = r
3、启动服务器。
svnserve -d -r / yourpath/svnroot/repository
没有任何提示就说明启动成功了。