【发布时间】:2010-03-31 02:40:09
【问题描述】:
我已经在 ubuntu 服务器中使用 apt-get install websvn 安装了 websvn。
我现在可以通过http://url/websvn访问websvn。
但是,我想为访问设置密码,所以只有授权的人才能访问它。
我该怎么做?
【问题讨论】:
-
可能更适合服务器故障
我已经在 ubuntu 服务器中使用 apt-get install websvn 安装了 websvn。
我现在可以通过http://url/websvn访问websvn。
但是,我想为访问设置密码,所以只有授权的人才能访问它。
我该怎么做?
【问题讨论】:
查看Subversion repository browsing with authorization的文档
希望这会有所帮助。
【讨论】:
您可以在 websvn 文件夹的根目录中放入一个 .htaccess 文件:
http://www.duchnik.com/tutorials/vc/setting-up-and-configuring-websvn
【讨论】:
Add User admin for repository authentication.
$ sudo htpasswd -c /etc/global.htpasswd admin
打开dav_svn.conf 文件。
$ sudo nano /etc/apache2/mods-enabled/dav_svn.conf
添加以下行。
<Location /svn>
DAV svn
SVNParentPath /var/lib/svn
</Location>
<Location /svn/RepoName>
AuthType Basic
AuthName \"RepoName Subversion Repository\"
AuthUserFile /etc/global.htpasswd
Require user admin
</Location>
请正确设置上述SVNParentPath。 确保已安装 apache2-utils。
$ sudo apt-get install -y apache2-utils
$ sudo service apache2 restart
【讨论】: