{"thread":{"id":"5124","subject":"HOWTO set up a repository which can be pushed into over HTTP","startedAt":"2006-08-04T18:38:58Z","lastAt":"2006-08-09T20:20:04Z","messageCount":8,"participants":["Johannes Schindelin","Junio C Hamano","Rutger Nijlunsing"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"24729","messageId":"Pine.LNX.4.63.0608042021300.1800@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5124","inReplyTo":null,"subject":"HOWTO set up a repository which can be pushed into over HTTP","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-08-04T18:38:58Z","receivedAt":"2006-08-04T18:38:58Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nI set up such a repository twice now, and it is not exactly \nstraight-forward. So, maybe some people find this useful:\n\nThis text assumes that you\n\n- have an Apache webserver,\n- can edit the configuration of it,\n- can restart it, and\n- have permissions to chown a directory\n\nStep 1: setup a bare repository\n-------------------------------\n\nCreate the directory (this assumes you have your Apache installed in\n/usr/local/apache2):\n\n\t$ cd /usr/local/apache/htdocs\n\t$ mkdir my-new-repo.git\n\nInitialize a bare repository\n\n\t$ cd my-new-repo.git\n\t$ git --bare init-db\n\nChange the ownership to your webserver's credentials\n\n\t$ chown -R www.www .\n\nIf you do not know which user Apache runs as, you can alternatively do a \n\"chmod -R a+w .\", inspect the files which are created later on, and set \nthe permissions appropriately.\n\nStep 2: enable DAV on this repository\n-------------------------------------\n\nIn your httpd.conf, make sure that this line exists:\n\n\tDAVLockDB \"/usr/local/apache2/temp/DAV.lock\"\n\nOf course, it can point somewhere else, but the string is actually just a \nprefix in some Apache configurations, and therefore the _directory_ has to \nbe writable by the user Apache runs as.\n\nThen, add something like this to your httpd.conf\n\n\t<Location /my-new-repo.git>\n\t\tDAV on\n\t\tAuthType Basic\n\t\tAuthName \"Git\"\n\t\tAuthUserFile /usr/local/apache2/conf/passwd.git\n\t\tRequire valid-user\n\t</Location>\n\nThe password file can be somewhere else, but it has to be readable by \nApache.\n\nYou can create this file by\n\n\t$ htpasswd -c /usr/local/apache2/conf/passwd.git <user>\n\nyou will be asked a password, and the file is created. Subsequent calls\nto htpasswd should omit the '-c' option, since you want to append to the\nexisting file.\n\nYou need to restart Apache; 'apachectl --graceful' is sufficient.\n\nStep 3: setup the client\n------------------------\n\nMake sure that you have HTTP support, i.e. your git was built with curl.\nThe easiest way to check is to look for the executable 'git-http-push'.\n\nThen, add the following to your .netrc (you can do without, but will be\nasked to input your password a _lot_ of times):\n\n\tmachine <servername>\n\tlogin <username>\n\tpassword <password>\n\nIf you want to access the webserver by its IP, you have to type that in,\ninstead of the server name.\n\nNow, add the remote in your existing repository which contains the project\nyou want to export:\n\n\t$ git-repo-config remote.upload.url \\\n\t\thttp://<username>@<servername>/my-new-repo.git/\n\nIt is important to put the last '/'; Without it, the server will send\na redirect which git-http-push does not (yet) understand, and git-http-push\nwill repeat the request inifinitely.\n\nStep 4: make the initial push\n-----------------------------\n\n>From your client repository, do\n\n\t$ git-http-push upload master\n\n(This assumes that the branch you want to export is called 'master' in your\nclient setup...)\n\nTroubleshooting:\n----------------\n\nIf git-http-push says\n\n\tError: no DAV locking support on remote repo http://...\n\nthen it means the webserver did not accept your authentication. Make sure\nthat the user name and password matches in httpd.conf, .netrc and the URL\nyou are uploading to.\n\nIf git-http-push shows you an error (22/502) when trying to MOVE a blob,\nit means that your webserver somehow does not recognize its name in the\nrequest; This can happen when you start Apache, but then disable the\nnetwork interface. A simple restart of Apache helps.\n\nIn other cases, reading /usr/local/apache2/logs/error_log is often helpful.\n\nCiao,\nDscho\n"},{"id":"24737","messageId":"7vac6kjoxh.fsf@assigned-by-dhcp.cox.net","threadId":"5124","inReplyTo":"Pine.LNX.4.63.0608042021300.1800@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: HOWTO set up a repository which can be pushed into over HTTP","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-04T19:12:10Z","receivedAt":"2006-08-04T19:12:10Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nice addition to Documentation/howto/ I would presume...\n"},{"id":"24774","messageId":"Pine.LNX.4.63.0608050044000.1800@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5124","inReplyTo":"7vac6kjoxh.fsf@assigned-by-dhcp.cox.net","subject":"Re: HOWTO set up a repository which can be pushed into over HTTP","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-08-04T22:45:55Z","receivedAt":"2006-08-04T22:45:55Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 4 Aug 2006, Junio C Hamano wrote:\n\n> Nice addition to Documentation/howto/ I would presume...\n\nI actually planned to submit a patch with a file in that directory \nfirst... But then I read the files already in it, and they all look like \nthey were emails first, which got -- presumably by several people finding \nit useful -- into a patch.\n\nDo people find it useful? Or would you like to wait until I implement an \noption in git-http-push to actually init an HTTP repo remotely?\n\nCiao,\nDscho\n"},{"id":"295903","messageId":"7vd5bd6ku8.fsf@assigned-by-dhcp.cox.net","threadId":"5124","inReplyTo":"Pine.LNX.4.63.0608050044000.1800@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: HOWTO set up a repository which can be pushed into over HTTP","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-08-07T07:55:43Z","receivedAt":"2006-08-07T07:55:43Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Do people find it useful? Or would you like to wait until I implement an \n> option in git-http-push to actually init an HTTP repo remotely?\n\nI do not have need for push over http-dav at the moment myself,\nbut I would imagine I would certainly look for it when I would\nneed to later.\n\nDo people find it useful?  More importantly, has somebody else\nindependently tried to follow the documentation and found the\ndescription accurate and helpful?\n"},{"id":"24990","messageId":"20060808190220.GA6001@nospam.com","threadId":"5124","inReplyTo":"7vd5bd6ku8.fsf@assigned-by-dhcp.cox.net","subject":"Re: HOWTO set up a repository which can be pushed into over HTTP","fromName":"Rutger Nijlunsing","fromEmail":"rutger@nospam.com","sentAt":"2006-08-08T19:02:20Z","receivedAt":"2006-08-08T19:02:20Z","isPatch":false,"sender":{"key":"rutger.nijlunsing@gmail.com","avatar":null},"body":"On Mon, Aug 07, 2006 at 12:55:43AM -0700, Junio C Hamano wrote:\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > Do people find it useful? Or would you like to wait until I implement an \n> > option in git-http-push to actually init an HTTP repo remotely?\n> \n> I do not have need for push over http-dav at the moment myself,\n> but I would imagine I would certainly look for it when I would\n> need to later.\n> \n> Do people find it useful?  More importantly, has somebody else\n> independently tried to follow the documentation and found the\n> description accurate and helpful?\n\nToday I did try to follow it, and it made an otherwise impossible job\nfor me doable, although still taking too much hours and a patch. The\n'impossible job' for me had to do with my zero-apache experience and\n(probably) a bug in WebDAV.\n\nFind attached updated HOWTO with specific information for Debian\nusers, and a patch to git to git-http-push since initially WebDAV gave\nme MOVE 22/404 errors.\n\n--\nRutger Nijlunsing ---------------------------------- eludias ed dse.nl\nnever attribute to a conspiracy which can be explained by incompetence\n----------------------------------------------------------------------\n\nHOWTO: Setting up a git repository which can be pushed into and pulled\nfrom over HTTP.\n\nWhat's needed:\n\n- Have an Apache webserver\n\n  On Debian:\n    $ apt-get install apache2\n    To get apache2 by default started,\n    edit /etc/default/apache2 and set NO_START=0\n\n- can edit the configuration of it\n\n  On Debian: this means being able to edit files under /etc/apache2\n\n- can restart it.\n  'apachectl --graceful' might do.\n\n  On Debian:\n    $ /etc/init.d/apache2 restart\n\n- have permissions to chown a directory\n\nIn effect, this probably means you're going to be root.\n\n\nStep 1: setup a bare GIT repository\n-----------------------------------\n\nCreate the directory (this assumes you have your Apache installed in\n/usr/local/apache2):\n\n    $ cd /usr/local/apache/htdocs\n    $ mkdir my-new-repo.git\n\n  On Debian:\n\n    $ cd /var/www\n    $ mkdir my-new-repo.git\n\n\nInitialize a bare repository\n \n    $ cd my-new-repo.git\n    $ git --bare init-db\n\n\nChange the ownership to your webserver's credentials\n \n    $ chown -R www.www .\n\n  On Debian:\n\n    $ chown -R www-data.www-data .\n\n\nIf you do not know which user Apache runs as, you can alternatively do\na \"chmod -R a+w .\", inspect the files which are created later on, and\nset the permissions appropriately.\n\nRestart apache2, and check whether http://server/my-new-repo.git gives\na directory listing. If not, check whether apache started up\nsuccesfully.\n\n\nStep 2: enable DAV on this repository\n-------------------------------------\n\nIn your httpd.conf, make sure that this line exists which is the file\nused for locking DAV operations:\n\n  DAVLockDB \"/usr/local/apache2/temp/DAV.lock\"\n\n  On Debian:\n\n    Enable the dav and dav_fs modules of apache:\n    $ a2enmod dav_fs\n    $ a2enmod dav\n    The DAV lock is located in /etc/apache2/mods-available/dav_fs.conf:\n      DAVLockDB /var/lock/apache2/DAVLock\n\nOf course, it can point somewhere else, but the string is actually just a \nprefix in some Apache configurations, and therefore the _directory_ has to \nbe writable by the user Apache runs as.\n\nThen, add something like this to your httpd.conf\n\n  <Location /my-new-repo.git>\n     DAV on\n     AuthType Basic\n     AuthName \"Git\"\n     AuthUserFile /usr/local/apache2/conf/passwd.git\n     Require valid-user\n  </Location>\n\n  On Debian:\n    Create (or add to) /etc/apache2/conf.d/git.conf :\n\n    <Location /my-new-repo.git>\n       DAV on\n       AuthType Basic\n       AuthName \"Git\"\n       AuthUserFile /etc/apache2/passwd.git\n       Require valid-user\n    </Location>\n\nThe password file can be somewhere else, but it has to be readable by\nApache and preferably not readable by the world.\n\nCreate this file by\n    $ htpasswd -c /usr/local/apache2/conf/passwd.git <user>\n\n    On Debian:\n      $ htpasswd -c /etc/apache2/passwd.git <user>\n\nYou will be asked a password, and the file is created. Subsequent calls\nto htpasswd should omit the '-c' option, since you want to append to the\nexisting file.\n\nYou need to restart Apache.\n\nNow go to http://<username>@<servername>/my-new-repo.git in your\nbrowser to check whether it asks for a password and accepts the right\npassword.\n\nOn Debian:\n\n   To test the WebDAV part, do:\n\n   $ apt-get install litmus\n   $ litmus http://<servername>/my-new-repo.git <username> <password>\n\n   Mosts tests should pass.\n\n\nStep 3: setup the client\n------------------------\n \nMake sure that you have HTTP support, i.e. your git was built with curl.\nThe easiest way to check is to look for the executable 'git-http-push'.\n\nThen, add the following to your ~/.netrc (you can do without, but will be\nasked to input your password a _lot_ of times):\n\n    machine <servername>\n    login <username>\n    password <password>\n\n...and set permissions:\n     chmod 600 ~/.netrc\n\n    On Windows, use %HOMEDRIVE%%HOMEPATH%.netrc instead.\n\nIf you want to access the webserver by its IP, you have to type that in,\ninstead of the server name.\n\nTo check whether all is OK, do:\n\n   curl --netrc --location -v http://<username>@<servername>/my-new-repo.git/\n\n...this should give a directory listing in HTML of /var/www/my-new-repo.git .\n\n\nNow, add the remote in your existing repository which contains the project\nyou want to export:\n \n   $ git-repo-config remote.upload.url \\\n       http://<username>@<servername>/my-new-repo.git/\n\nIt is important to put the last '/'; Without it, the server will send\na redirect which git-http-push does not (yet) understand, and git-http-push\nwill repeat the request inifinitely.\n\n\nStep 4: make the initial push\n-----------------------------\n\n>From your client repository, do\n\n   $ git push upload master\n\nThis pushes branch 'master' (which is assumed to be the branch you\nwant to export) to repository called 'upload', which we previously\ndefined with git-repo-config.\n\n\nTroubleshooting:\n----------------\n\nIf git-http-push says\n\n   Error: no DAV locking support on remote repo http://...\n\nthen it means the webserver did not accept your authentication. Make sure\nthat the user name and password matches in httpd.conf, .netrc and the URL\nyou are uploading to.\n\nIf git-http-push shows you an error (22/502) when trying to MOVE a blob,\nit means that your webserver somehow does not recognize its name in the\nrequest; This can happen when you start Apache, but then disable the\nnetwork interface. A simple restart of Apache helps.\n\nErrors like (22/502) are of format (curl error code/http error\ncode). So (22/404) means something like 'not found' at the server.\n\nReading /usr/local/apache2/logs/error_log is often helpful.\nOn Debian: Read /var/log/apache2/error.log instead.\n\n\n\ncommit bd1ba734176277034c6e4b33eb68fde170286538\nAuthor: Rutger Nijlunsing <git@tux.tmfweb.nl>\nDate:   Tue Aug 8 14:17:38 2006 +0200\n\n    http-push: Use '_token' instead of '.token' as temporary file before renaming.\n    \n    WebDAV on Debian unstable cannot handle renames on WebDAV from\n    file.ext to newfile (without ext) when newfile* already\n    exists. Normally, git creates a file like 'objects/xx/sha1.token',\n    which is renamed to 'objects/xx/sha1' when transferred completely.\n    \n    Just use '_' instead of '.' so WebDAV doesn't see it as an extension\n    change.\n\ndiff --git a/http-push.c b/http-push.c\nindex 4021e7d..d45733e 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -530,7 +530,7 @@ static void start_put(struct transfer_re\n \trequest->dest = xmalloc(strlen(request->url) + 14);\n \tsprintf(request->dest, \"Destination: %s\", request->url);\n \tposn += 38;\n-\t*(posn++) = '.';\n+\t*(posn++) = '_';\n \tstrcpy(posn, request->lock->token);\n \n \tslot = get_active_slot();\n"},{"id":"25007","messageId":"Pine.LNX.4.63.0608090049480.1800@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5124","inReplyTo":"20060808190220.GA6001@nospam.com","subject":"Re: HOWTO set up a repository which can be pushed into over HTTP","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-08-08T23:11:24Z","receivedAt":"2006-08-08T23:11:24Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 8 Aug 2006, Rutger Nijlunsing wrote:\n\n> On Mon, Aug 07, 2006 at 12:55:43AM -0700, Junio C Hamano wrote:\n> > Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> > \n> > > Do people find it useful? Or would you like to wait until I implement an \n> > > option in git-http-push to actually init an HTTP repo remotely?\n> > \n> > I do not have need for push over http-dav at the moment myself,\n> > but I would imagine I would certainly look for it when I would\n> > need to later.\n> > \n> > Do people find it useful?  More importantly, has somebody else\n> > independently tried to follow the documentation and found the\n> > description accurate and helpful?\n> \n> Today I did try to follow it, and it made an otherwise impossible job\n> for me doable, although still taking too much hours and a patch. The\n> 'impossible job' for me had to do with my zero-apache experience and\n> (probably) a bug in WebDAV.\n\nThank you for doing that valuable work! I think the patch is fine (take \nthat as an Acked-by:); next time you might want to send it as a proper \npatch mail ;-)\n\n> -This text assumes that you\n> -\n> -- have an Apache webserver,\n> -- can edit the configuration of it,\n> -- can restart it, and\n> +\n> +What's needed:\n> +\n> +- Have an Apache webserver\n> +\n> +  On Debian:\n> +    $ apt-get install apache2\n> +    To get apache2 by default started,\n> +    edit /etc/default/apache2 and set NO_START=0\n> +\n> +- can edit the configuration of it\n> +\n> +  On Debian: this means being able to edit files under /etc/apache2\n\nOn some other setups, it is /etc/httpd/. Since it is not specific to \nDebian, we might want to give some common options, but refer the user to \nthe Apache manual if she cannot find it.\n\n> +\n> +- can restart it.\n> +  'apachectl --graceful' might do.\n\nIt is Ã'apachectl graceful' here (without'--').\n\n> +  On Debian:\n> +    $ /etc/init.d/apache2 restart\n\nThis should work everywhere, except it might be called apache or httpd \ninstead. However, please warn users that this interrupts (however briefly) \na running webserver, and if you do that on a production machine, users \njust downloading an iso file might be rightfully upset.\n\n>  - have permissions to chown a directory\n>  \n> +In effect, this probably means you're going to be root.\n\nRight.\n\n> -\t$ cd /usr/local/apache/htdocs\n> -\t$ mkdir my-new-repo.git\n> +    $ cd /usr/local/apache/htdocs\n> +    $ mkdir my-new-repo.git\n> +\n> +  On Debian:\n> +\n> +    $ cd /var/www\n> +    $ mkdir my-new-repo.git\n\nAgain, it might be cooler to be a bit more portable: if the user found \nhttpd.config, he could just \"grep DocumentRoot /where/ever/httpd.conf\".\n\n>  Change the ownership to your webserver's credentials\n> + \n> +    $ chown -R www.www .\n> +\n> +  On Debian:\n> +\n> +    $ chown -R www-data.www-data .\n\nAgain, a better way would be to direct the user to \"grep ^User httpd.conf\" \nand \"grep ^Group httpd.conf\".\n\n> +Restart apache2, and check whether http://server/my-new-repo.git gives\n> +a directory listing. If not, check whether apache started up\n> +succesfully.\n\nA useful addition.\n\n>  Step 2: enable DAV on this repository\n>  -------------------------------------\n>  \n> -In your httpd.conf, make sure that this line exists:\n> +In your httpd.conf, make sure that this line exists which is the file\n> +used for locking DAV operations:\n> +\n> +  DAVLockDB \"/usr/local/apache2/temp/DAV.lock\"\n> +\n> +  On Debian:\n>  \n> -\tDAVLockDB \"/usr/local/apache2/temp/DAV.lock\"\n> +    Enable the dav and dav_fs modules of apache:\n> +    $ a2enmod dav_fs\n> +    $ a2enmod dav\n> +    The DAV lock is located in /etc/apache2/mods-available/dav_fs.conf:\n> +      DAVLockDB /var/lock/apache2/DAVLock\n\nI did not find a2enmod on my only Debian setup, so a more portable way \nwould be to tell the user to insert the following lines in httpd.conf:\n\n\tLoadModule dav_module libexec/httpd/libdav.so\n\tAddModule mod_dav.c\n\n(I do not know if there are setups where you have to load dav_fs \nexplicitely...)\n\n>  Then, add something like this to your httpd.conf\n>  \n> -\t<Location /my-new-repo.git>\n> -\t\tDAV on\n> -\t\tAuthType Basic\n> -\t\tAuthName \"Git\"\n> -\t\tAuthUserFile /usr/local/apache2/conf/passwd.git\n> -\t\tRequire valid-user\n> -\t</Location>\n> +  <Location /my-new-repo.git>\n> +     DAV on\n> +     AuthType Basic\n> +     AuthName \"Git\"\n> +     AuthUserFile /usr/local/apache2/conf/passwd.git\n> +     Require valid-user\n> +  </Location>\n> +\n> +  On Debian:\n> +    Create (or add to) /etc/apache2/conf.d/git.conf :\n\nIs this picked up automatically?\n\n> +    <Location /my-new-repo.git>\n> +       DAV on\n> +       AuthType Basic\n> +       AuthName \"Git\"\n> +       AuthUserFile /etc/apache2/passwd.git\n> +       Require valid-user\n> +    </Location>\n\nWe should not violate the DRY principle (\"DonÂ´'Repeat Yourself\").\n\n> +\n> +The password file can be somewhere else, but it has to be readable by\n> +Apache and preferably not readable by the world.\n>  \n> -The password file can be somewhere else, but it has to be readable by \n> -Apache.\n> +Create this file by\n> +    $ htpasswd -c /usr/local/apache2/conf/passwd.git <user>\n>  \n> -You can create this file by\n> +    On Debian:\n> +      $ htpasswd -c /etc/apache2/passwd.git <user>\n>  \n> -\t$ htpasswd -c /usr/local/apache2/conf/passwd.git <user>\n> -\n> -you will be asked a password, and the file is created. Subsequent calls\n> +You will be asked a password, and the file is created. Subsequent calls\n>  to htpasswd should omit the '-c' option, since you want to append to the\n>  existing file.\n>  \n> -You need to restart Apache; 'apachectl --graceful' is sufficient.\n\nSo, it was my fault to begin with: the '--' is wrong.\n\n> +Now go to http://<username>@<servername>/my-new-repo.git in your\n> +browser to check whether it asks for a password and accepts the right\n> +password.\n\nHelpful.\n\n> +On Debian:\n> +\n> +   To test the WebDAV part, do:\n> +\n> +   $ apt-get install litmus\n> +   $ litmus http://<servername>/my-new-repo.git <username> <password>\n\nThere has to be a more portable way to test WebDAV, like an URL to type \ninto a webbrowser. DAV wizards, anyone?\n\n> -Then, add the following to your .netrc (you can do without, but will be\n> +Then, add the following to your ~/.netrc (you can do without, but will be\n\nOkay, I thought it was common knowledge where this resides. Although I \nwould say $HOME/.netrc instead.\n\n> +...and set permissions:\n> +     chmod 600 ~/.netrc\n\nYeah, right. I always forget about this.\n\n> +    On Windows, use %HOMEDRIVE%%HOMEPATH%.netrc instead.\n\nHuh? You want to access it with something else than cygwin?\n\n> +To check whether all is OK, do:\n> +\n> +   curl --netrc --location -v http://<username>@<servername>/my-new-repo.git/\n> +\n> +...this should give a directory listing in HTML of /var/www/my-new-repo.git .\n\nDoes everybody who has libcurl installed, have curl installed also?\n\n>  >From your client repository, do\n>  \n> -\t$ git-http-push upload master\n> +   $ git push upload master\n> +\n> +This pushes branch 'master' (which is assumed to be the branch you\n> +want to export) to repository called 'upload', which we previously\n> +defined with git-repo-config.\n>  \n> -(This assumes that the branch you want to export is called 'master' in your\n> -client setup...)\n\nYour wording is much clearer.\n\n>  request; This can happen when you start Apache, but then disable the\n>  network interface. A simple restart of Apache helps.\n>  \n> -In other cases, reading /usr/local/apache2/logs/error_log is often helpful.\n> -\n> +Errors like (22/502) are of format (curl error code/http error\n> +code). So (22/404) means something like 'not found' at the server.\n\nI think the error log is more useful than the http error codes.\n\nCiao,\nDscho\n"},{"id":"25044","messageId":"20060809193118.GC7841@nospam.com","threadId":"5124","inReplyTo":"Pine.LNX.4.63.0608090049480.1800@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: HOWTO set up a repository which can be pushed into over HTTP","fromName":"Rutger Nijlunsing","fromEmail":"rutger@nospam.com","sentAt":"2006-08-09T19:31:18Z","receivedAt":"2006-08-09T19:31:18Z","isPatch":false,"sender":{"key":"rutger.nijlunsing@gmail.com","avatar":null},"body":"> > Today I did try to follow it, and it made an otherwise impossible job\n> > for me doable, although still taking too much hours and a patch. The\n> > 'impossible job' for me had to do with my zero-apache experience and\n> > (probably) a bug in WebDAV.\n> \n> Thank you for doing that valuable work! I think the patch is fine (take \n> that as an Acked-by:); next time you might want to send it as a proper \n> patch mail ;-)\n\nOk, I send it out. Don't know if I did it proper...\n\n\n> > -This text assumes that you\n> > -\n> > -- have an Apache webserver,\n> > -- can edit the configuration of it,\n> > -- can restart it, and\n> > +\n> > +What's needed:\n> > +\n> > +- Have an Apache webserver\n> > +\n> > +  On Debian:\n> > +    $ apt-get install apache2\n> > +    To get apache2 by default started,\n> > +    edit /etc/default/apache2 and set NO_START=0\n> > +\n> > +- can edit the configuration of it\n> > +\n> > +  On Debian: this means being able to edit files under /etc/apache2\n> \n> On some other setups, it is /etc/httpd/. Since it is not specific to \n> Debian, we might want to give some common options, but refer the user to \n> the Apache manual if she cannot find it.\n\nOk, but I find it always very convenient when someone describes the\nsituation for _me_. So if other distro's would join in, I would be\ndelighted. And indeed a general fallback to the Apache documentation\nwould be good for all distro's (+ homegrown) not covered.\n\nHowever, Debian already differs quite some from the defaults. I wrote\nthis addendum to the documentation _because_ it costed me quite some\ntime since Debian tries to be different.\n\nDebian seperates as much as possible into different files and\ndirectories to be able to easily install and deinstall modules with\nthe package manager. And it has scripts to manage those directories.\n\n> > +\n> > +- can restart it.\n> > +  'apachectl --graceful' might do.\n> \n> It is Ã'apachectl graceful' here (without'--').\n> \n> > +  On Debian:\n> > +    $ /etc/init.d/apache2 restart\n> \n> This should work everywhere, except it might be called apache or httpd \n> instead. However, please warn users that this interrupts (however briefly) \n> a running webserver, and if you do that on a production machine, users \n> just downloading an iso file might be rightfully upset.\n\nIf you're on a production machine with a webserver already in\nproduction, you're probably not using this tutorial (I hope).\n\nIf you're downloading a large iso, recent browsers have 'resume'\nbuttons. The internet has never been very reliable.\n\nIf you're on Debian, '/etc/init.d/apache2 restart' is the same as\n'/etc/init.d/apache2 force-reload', so no interruptions.\n\n...but warning is always good :)\n\n\n> > +  On Debian:\n> > +\n> > +    $ cd /var/www\n> > +    $ mkdir my-new-repo.git\n> \n> Again, it might be cooler to be a bit more portable: if the user found \n> httpd.config, he could just \"grep DocumentRoot /where/ever/httpd.conf\".\n\nNope. On Debian, httpd.conf is a placeholder which does not contain\nanything expect for:\n\n# This is here for backwards compatability reasons and to support\n#  installing 3rd party modules directly via apxs2, rather than\n#  through the /etc/apache2/mods-{available,enabled} mechanism.\n#\n#LoadModule mod_placeholder /usr/lib/apache2/modules/mod_placeholder.so\n\nAnd the grep gives nothing. Doing a recursive grep gives:\n\n/etc/apache2$ grep -r DocumentRoot * \nsites-available/default:        DocumentRoot /var/www\nsites-enabled/000-default:      DocumentRoot /var/www\n\n...where sites-enabled is a link to sites-available.\n\n\n> >  Change the ownership to your webserver's credentials\n> > + \n> > +    $ chown -R www.www .\n> > +\n> > +  On Debian:\n> > +\n> > +    $ chown -R www-data.www-data .\n> \n> Again, a better way would be to direct the user to \"grep ^User httpd.conf\" \n> and \"grep ^Group httpd.conf\".\n\nBoth come up empty on Debian. The uid + gid appear to be in apache2.conf :\n\n/etc/apache2$ grep ^User *         \napache2.conf:User www-data\n\n\n> > +  DAVLockDB \"/usr/local/apache2/temp/DAV.lock\"\n> > +\n> > +  On Debian:\n> >  \n> > -\tDAVLockDB \"/usr/local/apache2/temp/DAV.lock\"\n> > +    Enable the dav and dav_fs modules of apache:\n> > +    $ a2enmod dav_fs\n> > +    $ a2enmod dav\n> > +    The DAV lock is located in /etc/apache2/mods-available/dav_fs.conf:\n> > +      DAVLockDB /var/lock/apache2/DAVLock\n> \n> I did not find a2enmod on my only Debian setup, so a more portable way \n> would be to tell the user to insert the following lines in httpd.conf:\n> \n> \tLoadModule dav_module libexec/httpd/libdav.so\n> \tAddModule mod_dav.c\n\nNo, a2enmod is the recommended way to enable modules. It adds symlinks\nfrom the /etc/apache2/mods-enabled to /etc/apache2/mods-available.\n\nI got those from http://www.debian-administration.org/articles/285\n\n> (I do not know if there are setups where you have to load dav_fs \n> explicitely...)\n\nAccording to http://www.debian-administration.org/articles/285, I had\nto. Didn't check it myself, though.\n\n> > +  On Debian:\n> > +    Create (or add to) /etc/apache2/conf.d/git.conf :\n> \n> Is this picked up automatically?\n\nYup. From /etc/apache2/README:\n\n...\nconf.d/\n\n        Files in this directory are included by this line in\n        apache2.conf:\n\n        # Include generic snippets of statements\n        Include /etc/apache2/conf.d\n\n        This is a good place to add additional configuration\n        directives.\n\nhttpd.conf\n\n        Empty file.\n...\n\n\n\n> > +    <Location /my-new-repo.git>\n> > +       DAV on\n> > +       AuthType Basic\n> > +       AuthName \"Git\"\n> > +       AuthUserFile /etc/apache2/passwd.git\n> > +       Require valid-user\n> > +    </Location>\n> \n> We should not violate the DRY principle (\"DonÂ´'Repeat Yourself\").\n\nOk, a merge could be done, but AuthUserFile is different.\nSomething like\n    +       AuthUserFile <passwd-file>\nthen.\n\n> > +On Debian:\n> > +\n> > +   To test the WebDAV part, do:\n> > +\n> > +   $ apt-get install litmus\n> > +   $ litmus http://<servername>/my-new-repo.git <username> <password>\n> \n> There has to be a more portable way to test WebDAV, like an URL to type \n> into a webbrowser. DAV wizards, anyone?\n\nThe renaming bug I found by using Windows Internet Explorer -> Open Location ->\nhttp://<servername>/my-new-repo.git [x] Open as webfolder -> login,\nand copy a file to it, rename it, ...\n\nAnother interactive tool is cadaver (see\nhttp://www.debian-administration.org/articles/285 again).\n\nWith FUSE + fusedav you can mount a WebDAV like a normal filesystem\n(which is cool ;)\n\n> > -Then, add the following to your .netrc (you can do without, but will be\n> > +Then, add the following to your ~/.netrc (you can do without, but will be\n> \n> Okay, I thought it was common knowledge where this resides. Although I \n> would say $HOME/.netrc instead.\n\nOk.\n\n> > +    On Windows, use %HOMEDRIVE%%HOMEPATH%.netrc instead.\n> \n> Huh? You want to access it with something else than cygwin?\n\nYou're right, Cygwin should have $HOME set.\n\n> > +To check whether all is OK, do:\n> > +\n> > +   curl --netrc --location -v http://<username>@<servername>/my-new-repo.git/\n> > +\n> > +...this should give a directory listing in HTML of /var/www/my-new-repo.git .\n> \n> Does everybody who has libcurl installed, have curl installed also?\n\nDon't know, but I think most people who have apache2 installed have\nbetter things to worry about :) Might want to add the dependancy\nexplicitly in the document, yes.\n\n> > -\t$ git-http-push upload master\n> > +   $ git push upload master\n> > +\n> > +This pushes branch 'master' (which is assumed to be the branch you\n> > +want to export) to repository called 'upload', which we previously\n> > +defined with git-repo-config.\n> >  \n> > -(This assumes that the branch you want to export is called 'master' in your\n> > -client setup...)\n> \n> Your wording is much clearer.\n\nIt took me a while to figure out, I (incorrectly) assumed 'upload' was\nthe name of the remote branch. And git-http-push didn't work at once,\nso I got it working with some extra options before I realised it\nshould be 'git push' instead.\n\n\n> >  request; This can happen when you start Apache, but then disable the\n> >  network interface. A simple restart of Apache helps.\n> >  \n> > -In other cases, reading /usr/local/apache2/logs/error_log is often helpful.\n> > -\n> > +Errors like (22/502) are of format (curl error code/http error\n> > +code). So (22/404) means something like 'not found' at the server.\n> \n> I think the error log is more useful than the http error codes.\n\nYou deleted those two lines (look at the version I sent), so jut put\nthem back :)\n\n\nDo you want to finish it, or should I do a reedit?\n\nRegards,\nRutger.\n\n-- \nRutger Nijlunsing ---------------------------------- eludias ed dse.nl\nnever attribute to a conspiracy which can be explained by incompetence\n----------------------------------------------------------------------\n"},{"id":"25049","messageId":"Pine.LNX.4.63.0608092215240.13885@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"5124","inReplyTo":"20060809193118.GC7841@nospam.com","subject":"Re: HOWTO set up a repository which can be pushed into over HTTP","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-08-09T20:20:04Z","receivedAt":"2006-08-09T20:20:04Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 9 Aug 2006, Rutger Nijlunsing wrote:\n\n> > [...] but refer the user to the Apache manual if she cannot find it.\n> \n> Ok, but I find it always very convenient when someone describes the\n> situation for _me_. So if other distro's would join in, I would be\n> delighted. And indeed a general fallback to the Apache documentation\n> would be good for all distro's (+ homegrown) not covered.\n\nIf everybody did this, you would not _find_ your distro-specific things \n;-)\n\nBut I agree, Debian is a bureaucrat's dream. I positively _hate_ it. So \nmuch so, that I left Knoppix behind.\n\n> [lots of explanations of Debian, Windows Explorer, etc.]\n\nThanks for clearing these up for me!\n\n> Do you want to finish it, or should I do a reedit?\n\nI am a little short on time, and I want to finish the merge-recur stuff, \nso I would be really grateful if you did it.\n\nCiao,\nDscho\n"}]}