【发布时间】:2010-04-19 22:12:08
【问题描述】:
我有一个新的 Fedora 12 服务器,我正在尝试在上面设置 Mercurial。我有yum installed mercurial,大多数事情似乎都运行良好。但是,通过 apache 设置 hgwebdir.cgi 后,我无法对当前托管的唯一存储库执行 hg push。我得到的错误是:
searching for changes
abort: HTTP Error 500: Permission denied: .hg/store/lock
httpd 以 apache 用户身份运行
UID PID PPID C STIME TTY TIME CMD
root 1691 1 0 13:19 ? 00:00:00 /usr/sbin/httpd
apache 1694 1691 0 13:19 ? 00:00:00 /usr/sbin/httpd
apache 1695 1691 0 13:19 ? 00:00:00 /usr/sbin/httpd
apache 1696 1691 0 13:19 ? 00:00:00 /usr/sbin/httpd
apache 1697 1691 0 13:19 ? 00:00:00 /usr/sbin/httpd
apache 1698 1691 0 13:19 ? 00:00:00 /usr/sbin/httpd
apache 1699 1691 0 13:19 ? 00:00:00 /usr/sbin/httpd
apache 1700 1691 0 13:19 ? 00:00:00 /usr/sbin/httpd
apache 1701 1691 0 13:19 ? 00:00:00 /usr/sbin/httpd
我设置了权限,以便 apache 用户拥有整个 repo 和所有内容。在最后一次尝试中,我什至让 repo 全局可写。
[root@builds .hg]# ll
total 424K
drwxrwxrwx. 3 apache apache 4.0K 2010-04-19 14:43 .
drwxrwxrwx. 19 apache apache 4.0K 2010-04-15 13:33 ..
-rw-rw-rw-. 2 apache apache 57 2010-04-13 11:42 00changelog.i
-rw-rw-rw-. 1 apache apache 93 2010-04-16 15:33 branchheads.cache
-rw-rw-rw-. 1 apache apache 192K 2010-04-15 13:33 dirstate
-rw-r--r--. 1 apache apache 156 2010-04-19 14:43 hgrc
-rw-rw-rw-. 1 apache apache 42 2010-04-15 13:33 last-message.txt
-rw-rw-rw-. 2 apache apache 23 2010-04-13 11:42 requires
drwxrwxrwx. 4 apache apache 4.0K 2010-04-19 11:26 store
-rw-rw-rw-. 1 apache apache 45 2010-04-14 14:08 tags.cache
-rw-rw-rw-. 1 apache apache 7 2010-04-16 15:33 undo.branch
-rw-rw-rw-. 1 apache apache 192K 2010-04-16 15:33 undo.dirstate
[root@builds .hg]# cd store
[root@builds store]# ll
total 308K
drwxrwxrwx. 4 apache apache 4.0K 2010-04-19 11:26 .
drwxrwxrwx. 3 apache apache 4.0K 2010-04-19 14:43 ..
-rw-rw-rw-. 1 apache apache 20K 2010-04-16 15:33 00changelog.i
-rw-rw-rw-. 1 apache apache 81K 2010-04-16 15:33 00manifest.i
drwxrwxrwx. 17 apache apache 4.0K 2010-04-13 11:47 data
drwxrwxrwx. 3 apache apache 4.0K 2010-04-13 11:43 dh
-rw-rw-rw-. 2 apache apache 177K 2010-04-15 11:03 fncache
-rw-rw-rw-. 1 apache apache 67 2010-04-16 15:33 undo
我在以其他用户身份运行的机器上其他地方有一个 repo 的克隆。如果我将克隆 hgrc 文件的 [paths] 部分中的 default 值设置为服务器上的本地文件路径,则推送工作正常,但如果我将其切换为使用 url,我每次都会收到错误消息。
我如何设置它的一些可能的怪癖... hgwebdir.cgi 位于/var/www/cgi-bin 并且repo 是/opt/hg 的子代。我也关闭了 suexec,这似乎并没有解决问题。我在 apache 配置中添加的使 hgwebdir 运行的唯一行是:
ScriptAlias /hg "/var/www/cgi-bin/hgwebdir.cgi"
hgweb.config 也在/var/www/cgi-bin 中,它的内容是:
[collections]
/opt/hg = /opt/hg
[trusted]
users = *
[web]
baseurl = /hg
push_ssl = false
allow_push = *
回购浏览器工作正常,只是推送不起作用。 Apache error_log 根本没有关于这个错误的任何内容。
【问题讨论】:
标签: mercurial