views:

415

answers:

2

Hello,

By default git instaweb is expecting lighttpd web server, whereas on OSX Leopard server apache2 is the default one.

Adding the following to .git/config :

[instaweb]
local = true
httpd = apache2 -f
port = 4321
modulepath = /usr/libexec/apache2

and running 'git instaweb' results in :

apache2 not found.  
Install apache2 or use --httpd to specify another httpd daemon.

How should I set up .git/config to have it use my default web server ?

Thanks

+1  A: 

If you look at this git-instaweb patch from February 2009, you see:

# 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

Is there a problem with your apache2 executable attribute?

VonC
Maybe. Apache is already running on this server. If I change 'apache2' for 'httpd', I get 'Unknown httpd specified: httpd'.
Peiniau
A: 

The reason is that apache2 is named httpd in OS X, and the modules are somewhere else. I have tried changing the configuration so that it points to the correct paths, but still the server didn't work.

Alternatively, you can use the already installed webrick daemon. Add these lines to your ~/.gitconfig file (global setting) or .git/config file (local setting) :

[instaweb]
               httpd = webrick
ustun
This is what I mentioned already in my comments.
Peiniau