Cannot push to shared server

Nick Gamroth thebeekeeper at gmail.com
Wed Apr 28 11:58:22 CDT 2010


On Wed, Apr 28, 2010 at 10:51 AM, Paul Boddie <paul.boddie at biotek.uio.no> wrote:
> 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.
>

Makes sense.  I moved my repos directory out of the public_html tree
into my home directory.

>> 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

I used this advice and .htaccess seems to be working correctly.  In my
browser I can go to http://thebeekeeper.net/hg/ and get the mercurial
repositories view.  I can push to the server with
hg push http://****:****@thebeekeeper.net/hg/x

I can't clone from /hg/x however; I get a abort: HTTP Error 500:
Internal Server Error.  It seems like this isn't related to apache at
all, and I found
http://mercurial.selenic.com/wiki/PublishingRepositories#Troubleshooting
which looked like it would help, but its still not working after
setting the permissions.  It still seems like a permissions issue, but
I'm not sure where.  Everything in my ~/repos tree has read
permissions.

I took a look at my server logs, and tried each URL in my browser.
Everything succeeds except for

"GET /hg/x?bases=0000000000000000000000000000000000000000&cmd=changegroupsubset&heads=627caa389f544cd5ef6241525b5b1397bc6f59a1
HTTP/1.1" 500 738 "-" "mercurial/proto-1.0"

which gives me the 500 error

Nick


>
> 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
>



-- 
~+~+~+~+~+~+~
thebeekeeper.net


More information about the Mercurial mailing list