hgrc and hgwebdir.cgi on linux related questions
Patrick Waugh
ptwaugh at gmail.com
Fri Oct 3 07:29:39 CDT 2008
Hi,
On Fri, Oct 3, 2008 at 6:41 AM, J.S. van Bethlehem <jakobb at astro.rug.nl> wrote:
> Patrick Waugh wrote:
>> Hi,
>>
>> First, I get this message in my error log:
>>
>> [Fri Oct 03 05:31:41 2008] [error] [client 98.211.63.103] File does
>> not exist: /var/www/hg, referer:
>> http://98.211.63.103/~patrick/hg/hgweb.cgi
>>
>> and I am not understanding what file does not exist "/var/www/hg".
>
> This is extremely weird. I have a setup using hwebdir.cgi as well and
> have never seen such a problem. Even weirder is that you do get a
> listing...... Maybe it has something to do with the redirecting you're
> doing??
I am not doing any redirection on the local server, and this occurs if
I go to the local server directly, so has nothing to do with
redirection.
> oke... forget the previous remarks. That seems oke then. But it is
> extremely strange that the server tries to access the files as user
> patrick. AFAIK the Apache server has a seperate user apache that is used
> to access files. So any files having read access to the world should be
> readable (or group, if the apache user happens to be in the right group
> of course) But even stranger: I suppose You actually created these
> files. So when the server uses You as user, then it should definitely be
> able to access these files!
The server isn't using me as the user, but yes, all the public_html
stuff is world readable.
>> I'm using Ubuntu Hardy, and tried setting the group of those files to
>> "www-data", but I really want things setup so that I don't have to
>> remember to manually change a user or group name on a file when
>> working as myself. In other words, how can I set things up so that I
>> don't have to change the owner/group of the hgrc file?
>>
> I'm not sure what you are talking about here.... 'those' files? Then you
> speak about 'a file' followed by the hgrc file.... confusing. Maybe
> someone else understands what you mean.
Sorry, what I mean is I tried making the "unreadable" files (as
reported by error.log) readable by putting them in the "www-data"
group which apache2 uses on Ubuntu.
>> The online manual seems to lack a single section which describes all
>> the hgrc/config files/locations/options. The info appears scattered
>> throughout the manual. Is there a single reference for such info?
>>
> Not an easy accessible one, as far as I know. There has actually been a
> request for it recently on the maillist (aah... that was your request I
> see :P) By the way, the following may be helpful:
> http://www.selenic.com/mercurial/hgrc.5.html
> This is a man-page for the hgrc file. I think this is what you are
> looking for. I think I found it through Google, even though it is part
> of the selenic-website. It is a bit unfortunate that this page can't be
> found more easily.
Ah, thanks, good tip. This will help. However, for some reason this
and other pages are not currently available for some reason.
>> BTW, while originally I was trying to get my shared server to host my
>> repos, now what I do is even cooler. I setup redirection on my shared
>> server to go to the repos on my local apache2 server. So, now I've
>> got my "working" local copies in /home/patrick/hg, while I have
>> another copy in /home/patrick/public_html/hg. Are others doing this,
>> or do you just use one or the other and point apache2 appropriately?
>>
> Why would you want to do something that complicated??
Because I could not push to the shared server anyway, or secure it
properly, so the best thing for me to do (now that I'm using linux)
was to just use my actual working copy locally.
> The [paths] and
> [collections] section can hold ANY path, including local ones. I have
> only the script in my webfolder ~/public_html and in the hgweb.config I
> just put:
> /path/to/local = /path/to/local
> (of course, when /path/to/local is not accessible for the server, then
> this doesn't work, but from your story it seems that this is not a problem)
No, this is exactly why I didn't do this... because when I put:
/home/patrick/hg/cbl-dev = /home/patrick/hg/cbl-dev
as that directory is outside the public_html directory root, it cannot
be served.
> So all you need to do in hgweb.cgi is:
> application = hgweb("/home/patrick/hg", "Patrick's HG repository")
> and it should work, without all the hassle of redirections.
I'm using hgwebdir.cgi, but have renamed it to index.cgi for convienence.
Currently, it has this:
application = hgwebdir('hgweb.config')
so I'm not sure at all what replacing or adding the above would do.
I'll have to get out my CGI book I guess.
Patrick
More information about the Mercurial
mailing list