This shows you the differences between two versions of the page.
| — |
blog:pushbx:2025:1026_installing_apache_hgweb_server_locally [2025-10-26 17:57:31 +0100 Oct Sun] (current) ecm created |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Installing apache + hgweb server locally ====== | ||
| + | |||
| + | This post details how to install a hgweb server locally on | ||
| + | an amd64 Debian 12 desktop machine, | ||
| + | as suggested [[blog: | ||
| + | |||
| + | ===== Apache ===== | ||
| + | |||
| + | Run the Synaptic Package Manager, | ||
| + | mark apache2, apache2-bin, | ||
| + | They are version 2.4.65-1~deb12u1 on our current setup. | ||
| + | Also mark mercurial and mercurial-common for installation. | ||
| + | They are version 6.3.2-1+deb12u1 for us. | ||
| + | Install the marked packages. | ||
| + | |||
| + | |||
| + | ===== hgweb ===== | ||
| + | |||
| + | According to https:// | ||
| + | you can copy the hgweb.cgi file from an installed Mercurial package as follows: | ||
| + | |||
| + | < | ||
| + | cp / | ||
| + | |||
| + | The contents of this file on our machine are: | ||
| + | |||
| + | < | ||
| + | # | ||
| + | # An example hgweb CGI script, edit as necessary | ||
| + | # See also https:// | ||
| + | |||
| + | # Path to repo or hgweb config to serve (see 'hg help hgweb' | ||
| + | config = b"/ | ||
| + | |||
| + | # Uncomment and adjust if Mercurial is not installed system-wide | ||
| + | # (consult " | ||
| + | # import sys; sys.path.insert(0, | ||
| + | |||
| + | # 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(config) | ||
| + | wsgicgi.launch(application)</ | ||
| + | |||
| + | I edited the '' | ||
| + | |||
| + | The hgweb.config file contents are as shown in the following log: | ||
| + | |||
| + | < | ||
| + | # | ||
| + | #/ | ||
| + | [paths] | ||
| + | /ecm = / | ||
| + | [ui] | ||
| + | username = E. C. Masloch | ||
| + | [web] | ||
| + | allow_archive = gz, bz2, zip | ||
| + | encoding = utf-8 | ||
| + | [extensions] | ||
| + | highlight =</ | ||
| + | |||
| + | |||
| + | ===== Place the repos ===== | ||
| + | |||
| + | Download a .tlz (tar lzipped) file from https:// | ||
| + | |||
| + | < | ||
| + | cd webrepos | ||
| + | tar -xf ~/ | ||
| + | |||
| + | |||
| + | ===== Install hgweb as part of the apache server ===== | ||
| + | |||
| + | 1. Run '' | ||
| + | |||
| + | 2. Enable CGI module in apache by running ''/ | ||
| + | |||
| + | 3. Unlike what the 510x.se page states, create a file named ''/ | ||
| + | |||
| + | < | ||
| + | < | ||
| + | AllowOverride None | ||
| + | Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch | ||
| + | Require all granted | ||
| + | </ | ||
| + | |||
| + | 4. Run '' | ||
| + | |||
| + | 5. Navigate to http:// | ||
| + | |||
| + | {{tag> | ||
| + | |||
| + | |||
| + | ~~DISCUSSION~~ | ||