小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

利用SVNListParentPath增加http瀏覽倉庫根目錄的功能

 rookie 2010-02-26
使用SVNParentPath的時(shí)候,直接訪問ParentPath的時(shí)候,總是得到以下錯(cuò)誤提示:
403 Forbidden
Forbidden
You don't have permission to access /svn/ on this server.
下面的辦法可以搞定它:
一、首先,Subversion1.3及以后版本支持SVNListParentPath ON,之前的版本只能使用PHP自己做。
二、Location 設(shè)置中最后要加上/,應(yīng)該是<Location /svn/>而不是<Location /svn>否則可能不能訪問。
三、通過“http://localhost/svn/” 來訪問倉庫列表,如果想讓“http://localhost/svn”也起作用的話,需要在</Location>的后面增加重定向的設(shè)置:RedirectMatch ^(/svn)$ $1/  ,當(dāng)然也可以采用RewriteEngine之類的辦法。
四、修改后的httpd.conf的對(duì)應(yīng)部分如下:
<Location /svn/>
    DAV svn
    SVNListParentPath on
    SVNParentPath e:/svn
#    SSLRequireSSL                 #指定該目錄只能通過SSL操作
#    SVNPathAuthz off
    AuthzSVNAccessFile e:/ca/access/file
   
    #try anonymous access first,resort to real
    #authentication if necessary.
    #Satisfy Any
    Require valid-user
   
    #how to authenticate a user
    AuthType Basic
    AuthName "服務(wù)器需要身份驗(yàn)證:"
#    AuthUserFile e:/ca/access/svn-auth-file
  AuthMySQLHost localhost
  AuthMySQLUser Bugfree
  AuthMySQLPassword mandarin
  AuthMySQLDB BugFree
  AuthMySQLUserTable BugUser
  AuthMySQLNameField UserName
  AuthMySQLPasswordField UserPassword
#  AuthMySQLMD5Passwords On
  AuthMySQLPwEncryption md5
 
</Location>
RedirectMatch ^(/svn)$ $1/
五、如果使用Subversion1.3以前的版本,或需要定制列表顯示的話,可以自己寫php腳本來控制倉庫列表的顯示,TotoiseSVN的幫助文件中有詳細(xì)描述:
<html>
<head>
<title>Subversion Repositories</title>
</head>
<body>
<h2>Subversion Repositories</h2>
<p>
<?php
    $svnparentpath = "C:/svn";
    $svnparenturl = "/svn";
    $dh = opendir( $svnparentpath );
    if( $dh ) {
        while( $dir = readdir( $dh ) ) {
            $svndir = $svnparentpath . "/" . $dir;
            $svndbdir = $svndir . "/db";
            $svnfstypefile = $svndbdir . "/fs-type";
            if( is_dir( $svndir ) && is_dir( $svndbdir ) ) {
                echo "<a href=\"" . $svnparenturl . "/" .
                        $dir . "\">" . $dir . "</a>\n";
                if( file_exists( $svnfstypefile ) ) {
                    $handle = fopen ("$svnfstypefile", "r");
                    $buffer = fgets($handle, 4096);
                    fclose( $handle );
                    $buffer = chop( $buffer );
                    if( strcmp( $buffer, "fsfs" )==0 ) {
                        echo " (FSFS) <br />\n";
                    } else {
                        echo " (BDB) <br />\n";
                    }
                } else {
                    echo " (BDB) <br />\n";
                }
            }
        }
        closedir( $dh );
    }
?>
</p>
</body>
</html>
Save the lines above to a file svn_index.php and store that file in your web root folder. Next you have to tell Apache to show that page instead of the error:
Uncomment (remove the '#' char) from the following line in your Apache config file:
#LoadModule rewrite_module modules/mod_rewrite.so
Add the following lines just below your <Location> block where you define your Subversion stuff:
    RewriteEngine on
    RewriteRule ^/svn$ /svn_index.php [PT]
    RewriteRule ^/svn/$ /svn_index.php [PT]
    RewriteRule ^/svn/index.html$ /svn_index.php [PT] 六、URL重寫的若干非mod_rewrite方法 原文出處:http://www. 作者:HonestQiao  發(fā)表于:2005-09-23 23:40:16 1、Alias:重寫到本地路徑
可以使用Alias把一個(gè)指定的Url重寫到某一固定的本地路徑
Alias /test/ /home/www/test/
那么對(duì)http://..../test/ 將對(duì)應(yīng)了/home/www/test/
注意:Alias必須是一一對(duì)應(yīng)的,/test/將不對(duì)/test起作用。
2、AliasMatch:重寫到本地路徑
與Alias類似,但是可以使用正則表達(dá)式
AliasMatch ^/test(.*) /home/www/test$1
3、Redirect :重寫到網(wǎng)址
Redirect /test/ http://....../test2/
4、RedirectMatch :重寫到網(wǎng)址
與Redirect類似,但是可以使用正則表達(dá)式
Redirect /test(.*) http://....../test2$1
在不需要很復(fù)雜的URL重寫時(shí),完全可以使用以上的幾條指令來進(jìn)行。

本文來自CSDN博客,轉(zhuǎn)載請(qǐng)標(biāo)明出處:http://blog.csdn.net/islq/archive/2006/04/17/666911.aspx

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多