https://stackoverflow.com/questions/60736/how-to-setup-a-subversion-svn-server-on-gnu-linux-ubuntu
我刚刚意识到NameVirtualHost ,并将其configuration为NameVirtualHost *:443但没有帮助。
我完整的svnserverconfiguration:
#<VirtualHost *:80> <VirtualHost *:443> ServerAdmin webmaster@localhost SSLEngine on SSLCertificateFile /etc/apache2/ssl/apache.pem SSLProtocol all SSLCipherSuite HIGH:MEDIUM DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
当我尝试通过浏览器到达网站VM时,我得到了一个403禁止。
我的dav_svn.conf:
<Location /svn> # Uncomment this to enable the repository DAV svn SVNParentPath /var/svn/svn-repos AuthType Basic AuthName "Subversion Repository" AuthUserFile /etc/apache2/dav_svn.passwd # To enable authorization via mod_authz_svn #AuthzSVNAccessFile /etc/apache2/dav_svn.authz # The following three lines allow anonymous read, but make # committers authenticate themselves. It requires the 'authz_user' # module (enable it with 'a2enmod'). <LimitExcept GET PROPFIND OPTIONS REPORT> Require valid-user </LimitExcept> #Added SVNListParentPath On </Location>
应允许外部用户访问svn(如教程中所述)。
那么,为什么我得到403错误?
apache错误日志:
[Fri Aug 10 17:51:11 2012] [error] [client my.main.pc.ip] Could not fetch resource information. [403, #0] [Fri Aug 10 17:51:11 2012] [error] [client my.main.pc.ip] (2)No such file or directory: The URI does not contain the name of a repository. [403, #190001]
我添加SVNListParentPath On我的位置块,并在我的浏览器中获得以下输出:
<D:error><C:error/><m:human-readable errcode="2"> Can't open directory '/var/svn/svn-repos': No such file or directory </m:human-readable></D:error>
使用SVNPath ,而使用SVNParentPath解决了这个问题。 但是我想要使用更多的一个存储库。
任何帮助表示赞赏!
听起来就像你在apache Location设置一个SVNParentPath ,但没有在客户端提供一个存储库名称。 例如:
<Location /svn> SVNParentPath /my/repos # ... </Location>
通过客户端URL访问: http://server/svn
/svn URL不是一个版本库,而是一个父path,您需要svnadmin create /my/repos/repo1 ,然后访问http://server/svn/repo1
如果您打开Location块中的列表父path指令,则可以列出子存储库:
<Location /svn> SVNParentPath /my/repos SVNListParentPath On # ... </Location>
你的<Location /svn>块是什么样的? 它应该有一个SVNPath或SVNParentPath语句指向你的仓库。 在同一个块中应该有<LimitExcept>块。
是/ var / svn / $ REPOS(或任何SVN(父)path指向)由www数据拥有? 应该是,或者至less它应该是www-data可读和可写的。