我正在嘗試設置共享主機的中央存儲庫。我一直閱讀本教程https://www.mercurial-scm.org/wiki/PublishingRepositories,無濟於事。這是我採取的步驟。如何在共享主機上設置Mercurial中央存儲庫
1. Copy hgwebdir.cgi file to directory at http://url.com/central_repository/hgwebdir.cgi
2. Added the following information to the hgweb.config file and copied it to same place.
[paths]
projectname = /home/username/central_repository/projectname
[web]
baseurl = /hg
3. Added the following to an htaccess file and copied it to the same place
# Taken from http://www.pmwiki.org/wiki/Cookbook/CleanUrls#samedir
# Used at http://ggap.sf.net/hg/
Options +ExecCGI
RewriteEngine On
#write base depending on where the base url lives
RewriteBase /hg
RewriteRule ^$ hgwebdir.cgi [L]
# Send requests for files that exist to those files.
RewriteCond %{REQUEST_FILENAME} !-f
# Send requests for directories that exist to those directories.
RewriteCond %{REQUEST_FILENAME} !-d
# Send requests to hgwebdir.cgi, appending the rest of url.
RewriteRule (.*) hgwebdir.cgi/$1 [QSA,L]
4. Uploaded the repository without the working directory to /home/user/central_repository/projectname
5. Tried to clone the repository to my computer using the folloing destination path: http://url.com/hg/projectname
通過這些步驟後,我得到一個404:未找到錯誤。
但是,如果我將目標路徑更改爲http://url.com/central_repository/projectname它的行爲就像找到了存儲庫,它告訴我它找到了更改集,它添加了更改集和清單,但它接着說「事務中止!HTTP錯誤500:內部服務器錯誤。
感謝您的幫助!都市報
編輯
而且每當我試圖把的ScriptAlias,別名,以前的內容,或以下內容爲htaccess文件,我得到500內部l服務器錯誤。
<Directory "/home/username/central_repository/projectname">
DirectoryIndex index.cgi
AddHandler cgi-script .cgi
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
事實上,如果我把所有的東西,除了以下的hgwebdir.cgi文件,我得到一個500錯誤。
#!/usr/bin/env python
#
# An example CGI script to export multiple hgweb repos, edit as necessary
我甚至試過把這個文件放在cgi-bin目錄下,我仍然收到錯誤。我也一定要將文件權限設置爲755.是否有可能我無法在此服務器上運行python文件?
嘿Ry4an,我想你也幫助我的前一天:)。非常感謝。如果我不應該將.hg文件夾直接放到projectname文件夾中,我該如何構造它?我打算做的是/central_repository/project1/.hg,/cr/project2/.hg ...等... – Metropolis 2010-03-20 20:17:03