默认情况下,git instaweb使用的是lighttpd web服务器,而在OSX Leopard服务器上,默认的是apache2。
将以下内容添加到.git/config中:
[instaweb]
local = true
httpd = apache2 -f
port = 4321
modulepath = /usr/libexec/apache2运行'git instaweb‘的结果是:
apache2 not found.
Install apache2 or use --httpd to specify another httpd daemon.我应该如何设置.git/config,使其使用我的默认web服务器?
谢谢
发布于 2009-11-05 07:52:40
原因是apache2在OS中被命名为httpd,而模块在其他地方。我尝试更改配置,使其指向正确的路径,但服务器仍然无法工作。
或者,您可以使用已经安装的webrick守护进程。将以下行添加到~/.gitconfig文件(全局设置)或.git/config文件(本地设置):
[instaweb]
httpd = webrick发布于 2009-10-02 10:58:01
如果你看一下这个git-instaweb patch from February 2009,你会看到:
# check if server can be executed
httpd_only="$(echo $httpd | cut -f1 -d' ')"
if ! type $httpd_only >/dev/null 2>&1; then
echo >&2 "$httpd_only not found. Install $httpd_only or use" \
+ "--httpd to specify another httpd daemon."
fi您的apache2可执行文件属性有问题吗?
更新2014 (5年后):commit like f8ee1f0显示git-instaweb不仅支持Apache,而且还支持apache2.4:
检测可用的Apache,并按照以下优先顺序使用第一个可用的:
Thomas Okken的answer详细介绍了如何引用https来启动git-instaweb。
https://stackoverflow.com/questions/1508752
复制相似问题