Cannot push to shared server

Paul Boddie paul.boddie at biotek.uio.no
Wed Apr 28 10:51:23 CDT 2010


Nick Gamroth wrote:
> Well, disregard that last message.  It looks like I've got something
> working, but not quite perfect.
>
> I can clone from the server with:
>  hg clone http://***:***@thebeekeeper.net/hg/repos/x
>   

Have you put the repositories into your public_html directory or under 
your "document root"? This isn't necessary if you're using hgwebdir.cgi 
and is obviously going to cause confusion if you retrieve them directly 
via Apache, mostly because you won't be able to push back to the same 
place. Other confusion that people have experienced includes Apache 
misbehaviour as it decides to serve things statically instead of via the 
CGI script.

> To push however, I have to use:
>  hg push --verbose http://****:****@thebeekeeper.net/hg/hgwebdir.cgi/x
>   

Here, you're pushing via hgwebdir.cgi, which is what you would have to 
do, anyway. But you actually should be pulling/cloning them via 
hgwebdir.cgi, too.

> Seems to me like either my .htaccessor my hgweb.config is no good, .
> I'm guessing .htaccess because when I try and look at the web
> interface I have to put hgwebdir.cgi in the URL, but I don't think
> that should be the case.
>   

You need to specify hgwebdir.cgi unless Apache is configured to not 
expose it in some way.

> Anyways, I know this isn't an apache list, but I'll post my .htaccess
> and maybe somebody can give me a hint:
> Options +ExecCGI
> RewriteEngine On
> RewriteBase /home2/thebeeke/public_html/hg
> RewriteRule ^/(.*) /hgwebdir.cgi/$1
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteRule (.*) hgwebdir.cgi/$1 [QSA,L]
> AuthUserFile /home2/thebeeke/etc/hg-basic-auth
> AuthName "HG Repositories"
> AuthType Basic
> Require valid-user
>   

Shouldn't RewriteBase only refer to URL paths, not filesystem paths? See 
here for something which has worked for me in the past:

http://mercurial.selenic.com/wiki/PublishingRepositories#Using_an_.htaccess_File

My advice is this: if you have control over the server configuration, 
use ScriptAlias directives to set the basics up. The mod_rewrite stuff 
does appear to work, but it's very difficult to read and write.

Paul


More information about the Mercurial mailing list