moving hg to new server, hgweb setup problem

John W jwdevel at gmail.com
Sun Mar 24 23:51:27 UTC 2024


I don't have direct experience with configuring hgweb, but have you seen
this old mailing list item?

https://lists.mercurial-scm.org/pipermail/mercurial/2020-August/052200.html

Seems worth a shot, at least.
(perhaps also see the rest of that thread)

-John

On Sun, Mar 24, 2024 at 10:04 AM Scott Derrick <scott at tnstaafl.net> wrote:

> Hi,
>
> Moved to a new server
> Ubuntu 22
> python3.10
> mercurial 6.1
>
> This is the apache2 error I  get when hitting the web site address
> https://URL/hg  I don't understand what "Mercurial only supports encoded
> strings" means?
>
>
>    - [Sun Mar 24 16:48:30.464715 2024] [cgi:error] [pid 41415] [client
>    172.0.6.80:56644] AH01215: Traceback (most recent call last)::
>    /var/www/cgi-hg/hgweb.cgi
>    - [Sun Mar 24 16:48:30.464776 2024] [cgi:error] [pid 41415] [client
>    172.0.6.80:56644] AH01215:   File "/var/www/cgi-hg/hgweb.cgi", line
>    21, in <module>: /var/www/cgi-hg/hgweb.cgi
>    - [Sun Mar 24 16:48:30.464798 2024] [cgi:error] [pid 41415] [client
>    172.0.6.80:56644] AH01215:     application = hgweb("hgweb.config"):
>    /var/www/cgi-hg/hgweb.cgi
>    - [Sun Mar 24 16:48:30.464864 2024] [cgi:error] [pid 41415] [client
>    172.0.6.80:56644] AH01215:   File
>    "/usr/lib/python3/dist-packages/mercurial/hgweb/__init__.py", line 41, in
>    hgweb: /var/www/cgi-hg/hgweb.cgi
>    - [Sun Mar 24 16:48:30.464894 2024] [cgi:error] [pid 41415] [client
>    172.0.6.80:56644] AH01215:     raise error.ProgrammingError(:
>    /var/www/cgi-hg/hgweb.cgi
>    - [Sun Mar 24 16:48:30.464945 2024] [cgi:error] [pid 41415] [client
>    172.0.6.80:56644] AH01215: mercurial.error.ProgrammingError: Mercurial
>    only supports encoded strings: 'hgweb.config': /var/www/cgi-hg/hgweb.cgi
>    - [Sun Mar 24 16:48:30.473397 2024] [cgi:error] [pid 41415] [client
>    172.0.6.80:56644] End of script output before headers: hgweb.cgi
>
>
> here is my hgweb.cgi file
>
>
>    - #!/usr/bin/env python3
>    - #
>    - # An example hgweb CGI script, edit as necessary
>    - # See also https://mercurial-scm.org/wiki/PublishingRepositories
>    - # Path to repo or hgweb config to serve (see 'hg help hgweb')
>    - config = "/var/www/cgi-hg/hbweb.config"
>    - # Uncomment and adjust if Mercurial is not installed system-wide
>    - # (consult "installed modules" path from 'hg debuginstall'):
>    - #import sys; sys.path.insert(0, "/path/to/python/lib")
>    - # Uncomment to send python tracebacks to the browser if an error
>    occurs:
>    - #import cgitb; cgitb.enable()
>    - from mercurial import demandimport
>    - demandimport.enable()
>    - from mercurial.hgweb import hgweb, wsgicgi
>    - application = hgweb("hgweb.config")
>    - wsgicgi.launch(application)
>
>
> here is my hgweb.config file
>
>
>    - [paths]
>    - #VIRTUAL_PATH = /REAL/PATH
>    - #mbel  = /home/repos/mbel
>    - admin = /home/repos/admin
>    - mbepp = /home/repos/mbepp
>    - mbepEditor = /home/repos/mbepEditor
>    - monitor= /home/repos/monitor
>    - solrproxy= /home/repos/solrproxy
>    - mbep-data= /home/repos/mbep-data
>    - mbep-util= /home/repos/mbep-util
>    - mbep-editor= /home/repos/mbep-editor
>    - installer=/home/repos/installer
>    - updater=/home/repos/updater
>    - [web]
>    - style = gitweb
>
> here is my apache hg.conf file
>
>
>    - ScriptAliasMatch        ^/hg(.*)        /var/www/cgi-hg/hgweb.cgi/$1
>    - <Directory /var/www/cgi-hg/>
>    -         Options ExecCGI FollowSymLinks Indexes MultiViews
>    -         AllowOverride All
>    -         Order allow,deny
>    -         Allow from all
>    - </Directory>
>    - <Directory /home/repos/>
>    -  Options FollowSymLinks
>    -  AllowOverride None
>    -  Allow from all
>    - </Directory>
>
> I tried python 2.7 didn't change anything.  I was using a very old version
> of mercurial(past eol) on the old server, but I really don't want to go
> back to that is possible.
>
> Scott
> Scott
> _______________________________________________
> Mercurial mailing list
> Mercurial at lists.mercurial-scm.org
> https://lists.mercurial-scm.org/mailman/listinfo/mercurial
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20240324/c0599de3/attachment.html>


More information about the Mercurial mailing list