Git setup instaweb httpd to use apache2 on OSX Leopard server

By default, git instaweb expects a lighttpd web server, while on OSX Leopard apache2 is standard.

Adding the following to .git / config:

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

and start ' git instaweb' results in:

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

How do I configure .git/configit to use my default web server?

thanks

+3
source share
3 answers

The reason is that apache2 is called httpd in OS X, and the modules are located somewhere else. I tried to change the configuration so that it pointed to the correct paths, but still the server was not working.

webrick. ~/.gitconfig( ) .git/config ( ):

[instaweb]
               httpd = webrick
+2

git-instaweb 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 ): a commit f8ee1f0 , git -instaweb Apache, Apache 2.4:

MPM Apache :

  • mpm_event
  • mpm_prefork
  • mpm_worker

Thomas Okken answer (upvoted) , https git -instaweb.

+1

git instaweb Apache Mac ( Lion) :

  • root:
    cd /usr/sbin; ln -s httpd apache2
  • root: /usr/libexec/git -core/git -instaweb:
    LockFile "$fqgitdir/gitweb/$httpd_only/access.lock"
    User UsernameForYourGitServer
    PidFile "$fqgitdir/pid"
  • , git , cd
    git instaweb --httpd apache2 -m /usr/libexec/apache2

, , .. " ". gitweb , 1234, 80, .

, /Library/LaunchDaemons/git -web.plist, :

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>Label</key>
        <string>GitWeb</string>
        <key>WorkingDirectory</key>
        <string>/Wherever/Your/Repository/Is</string>
        <key>ProgramArguments</key>
        <array>
            <string>git</string>
            <string>instaweb</string>
            <string>--httpd</string>
            <string>apache2</string>
            <string> -m </string>
            <string> / usr / libexec / apache2 </string>
        </array>
        <key> KeepAlive </key>
        <true />
    </dict>
    </plist>
+1
source

Source: https://habr.com/ru/post/1719082/


All Articles