svn搭建完毕出现500错误原因之一

出现500的原因是由于配置的时候少生成了授权文件,
通过锁定服务器的日志文件 tail -f  /var/log/apache2/error.log 得到的错误日志如下:
[Sat Aug 25 09:16:33 2012] [error] [client 192.168.1.101] Could not fetch resource information.  [500, #0]
[Sat Aug 25 09:16:33 2012] [error] [client 192.168.1.101] Could not open the requested SVN filesystem  [500, #2]
[Sat Aug 25 09:16:33 2012] [error] [client 192.168.1.101] Could not open the requested SVN filesystem  [500, #2]
[Sat Aug 25 09:20:07 2012] [notice] caught SIGTERM, shutting down
[Sat Aug 25 09:20:08 2012] [notice] Apache/2.2.16 (Ubuntu) DAV/2 SVN/1.6.12 configured -- resuming normal operations
[Sat Aug 25 09:49:34 2012] [notice] caught SIGTERM, shutting down
[Sat Aug 25 09:49:36 2012] [notice] Apache/2.2.16 (Ubuntu) DAV/2 SVN/1.6.12 configured -- resuming normal operations
[Sat Aug 25 10:05:05 2012] [notice] caught SIGTERM, shutting down
[Sat Aug 25 10:05:06 2012] [notice] Apache/2.2.16 (Ubuntu) DAV/2 SVN/1.6.12 configured -- resuming normal operations
[Sat Aug 25 10:17:37 2012] [error] [client 192.168.1.101] (2)No such file or directory: Could not open password file: /etc/apache2/dav_svn.passwd
解决方法是生成对应的文件:
现在通过命令设置SVN账户:
Shell代码  收藏代码

   1. sudo htpasswd -c /etc/apache2/dav_svn.passwd <username> 

sudo htpasswd -c /etc/apache2/dav_svn.passwd <username>


这里用到参数-c,是因为/etc/apache2/dav_svn.passwd文件不存在,如果文件存在,则无需该参数!否则,将覆盖掉原有密码文件!
形如:
引用
sudo htpasswd -c /etc/apache2/dav_svn.passwd snowolf
New password:
Re-type new password:
Updating password for user snowolf

可以追加多个账户!
引用
sudo htpasswd /etc/apache2/dav_svn.passwd zlex
New password:
Re-type new password:
Updating password for user zlex

你可能感兴趣的:(SVN,ubuntu,500)