2011-02-01 64 views
3

我正在嘗試發佈hg存儲庫。我爲多個存儲庫使用hg 1.7.3hgweb。在索引頁上存儲庫名稱被顯示,但是當我點擊它們時,我得到關於斷開鏈接的信息。 Apache錯誤日誌說:hgweb:存儲庫已顯示,但無法訪問

[Tue Feb 01 15:41:31 2011] [error] [client 10.13.3.64] script not found or unable to stat: /home/hg/webdir/index.cgienigma-reports, referer: http://hg.internal/ 

我試圖訪問路徑http://hg.internal/enigma-reports/。任何想法,我可能做錯了什麼?

我的網站,提供外觀配置是這樣的:

<VirtualHost *> 
     ServerName hg.internal 
     ScriptAlias/"/home/hg/webdir/index.cgi/" 
</VirtualHost> 

之前有在路徑中的index.cgi沒有尾隨斜線。爲什麼需要尾部斜線?現在它看起來像一個目錄,而不是一個文件,看起來非常直觀。

回答

5

您的ScriptAlias行可能是錯誤的 - 缺少一個結尾的斜槓。

這是必需的,因爲ScriptAlias爲第二部分替換了第一部分。

所以,當您的網址進來爲:

http://hg.internal/enigma-reports/ 

和協議的阿帕奇的LOP和主機就變成:

/enigma-reports/ 

,然後ScriptAlias指令,匹配的第一個/和不更換,其前你的更新添加斜槓產量

/home/hg/webdir/index.cgienigma-reports/ 

這不是一個有效的腳本。

然而,隨着放到新斜線的置換爲:

/home/hg/webdir/index.cgi/enigma-reports/ 

其中到PATH_INFO CGI變量,這是劇本看什麼變成engigma-reports/