Differences between revisions 1 and 80 (spanning 79 versions)
Revision 1 as of 2006-06-18 14:03:10
Size: 3757
Editor: MishaS
Comment: one more page about hgwebdir.cgi
Revision 80 as of 2013-08-28 17:42:50
Size: 3247
Editor: WeldonWer
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
[[TableOfContents]]
= Publishing Repositories with `hgwebdir.cgi` =

== Introduction ==

Well, we have a certain setup with subversion. I'd like to reproduce it using Mercurial.

== Pre-requisites ==

I run all this on an Ubuntu system. Edgy one. :)

The installed software is:
 * apache2 (apache2, apache2-common, apache2-mpm-prefork, apache2-utils)
 * some version of mercurial (mine was 0.9 taken from Debian/unstable)
 * python:
   * Ubuntu/Edgy comes with python 2.4
   * you will need python2.4-dev package as well
 * sudo (in general, I prefer sudo to su)

== Getting proper Mercurial ==

The whole point was to try pull/push over http. So the following was done (I'm
a real newbie for hg, so please bear me :)):
{{{
$ cd working-directory
$ hg clone http://selenic.com/hg/
$ cd hg
$ hg pull http://hg.intevation.org/mercurial/crew
$ wget http://www.selenic.com/pipermail/mercurial/attachments/20060615/2893c03e/push-http.bin -O push-http.patch
$ hg import -p1 push-http.patch
$ python setup.py build
$ sudo python setup.py install
}}}

== Directory Structure ==

Create the necessary directories:
{{{
$ sudo mkdir -p /var/hg/repos
$ sudo chown www-data:www-data -R /var/hg
}}}

It's usually a good idea to keep special directories out of the tree served by apache.

== Putting the right stuff in place ==

Put the script in place (remember, we are still in that `working-directory/hg` :)):
{{{
$ sudo -u www-data cp hgwebdir.cgi /var/hg
$ sudo -u www-data chmod +x /var/hg/hgwebdir.cgi
}}}

Prepare the config:
{{{
$ cat > /tmp/hgweb.config
[collections]
repos/ = repos/
^D
$ sudo -u www-data cp /tmp/hgweb.config /var/hg
$ rm /tmp/hgweb.config
}}}

== Making it accessible ==

Ok, now it's time for apache.

First of all, do not really change the config of apache directly:
{{{
$ sudo mkdir /etc/apache2/hg
}}}

Create the config with the following contents (e.g by using `sudo vim /etc/apache2/hg/main.conf`):
{{{
ScriptAliasMatch ^/hg(.*) /var/hg/hgwebdir.cgi$1

<Directory /var/hg>
  Options ExecCGI FollowSymLinks

  AllowOverride None
</Directory>
}}}

This config says that we are going to serve our repositories through '<yourhost>/hg/'.

Now make it really available, by changing your favourite site in `/etc/apache2/sites-enabled`.
For this experiment I used `/etc/apache2/sites-enabled/default`:
{{{
  ...
  Include /etc/apache2/hg/main.conf
</VirtualHost>
}}}

Make sure that everything is OK:
{{{
$ sudo apache2ctl configtest
Syntax is OK
}}}

Restart your web server:
{{{
$ sudo apache2ctl stop
$ sudo apache2ctl start
}}}

Check if it works by directing your browser to `<yourhost>/hg/`

== You are done ==

Hooray!

== Final Bits ==

=== Create a new repository ===

{{{
$ sudo -u www-data hg init /var/hg/repos/<repository-name>
}}}

=== Provide more information about it ===

Add the following to the `/var/hg/repos/<repository-name>/.hg/hgrc` file:
{{{
[web]
contact = Bilbo Baggins # Whom to contact, plain text, no fancy stuff
description = My precious! # Nice description what this is about, you can
                              # include HTML (like <a>)
}}}

=== Customize the look ===

Add the following to the `/var/hg/repos/<repository-name>/.hg/hgrc` file:
{{{
[web]
style = gitweb # looks cleaner from my point of view :)
allow_archive = gz, zip, bz2 # If you think people should be able to download
                              # snapshots as .tar.gz, .zip, .tar.bz2 respectively
}}}

== Disclaimer ==

Well, it works (worked) for me. Please do not hesitate to update this page to
include small bits I've forgotten or just plainly am not aware of.
Many people are often surprised once they see that their motor insurance price has gone on rebirth. It's crucial to know about the particular causes that can just take they to be avoided by steps and guide up to such an scenario. A hike in your price can easily see you pay hundreds of bucks more. Even when you do seek out an alternative insurer, you may find that exactly the same factors utilized by recent insurer can effect the others. Listed here are a couple of worries your insurer considers in identifying your car insurance costs. <<BR>>
<<BR>>
1.Criminal Offense <<BR>>
<<BR>>
That describes small occurrences like getting a parking ticket, or being offered for around dashing to significant offenses like driving while intoxicated. A major role is played by traffic violations for making you look like a top danger motorist. Occasionally the insurer may also offer you a notice of cancellation of coverage. Be certain in order to avoid such any and all violations as it could make it difficult not to only spend but actually uncover an ensure who'll acknowledge your application for an insurance policy. <<BR>>
<<BR>>
2.Your Spouse <<BR>>
<<BR>>
Many partners will apply to the same insurer to own both their automobiles covered. This is usually done to simply help the likelihood of a discount and produce the process easier by dealing with a single insurer. However many owners have now been amazed to find that their spouse has a poor driving record solely after doing this and it has triggered a rise in place of discount on their insurance. Before making this type of transfer, be upfront about your document whilst not to detrimentally affect your companion. <<BR>>
<<BR>>
3.The New Car Has A Negative Ranking <<BR>>
<<BR>>
Many people get thrilled at the outlook of a brand new auto and become stunned once they start to see the insurance charges it attracts. When insurance companies establish charges, in addition they go through the amount of states created according to automobile product and produce. Predicated on this analysis, selected automobiles will entice large charges while other will get reduced fee. It is crucial that you find out the status on a vehicle before making a buy to observe how it'll affect your insurance quality ranges. These evaluations may also vary from year to year based on automobile business studies therefore don't be astonished in case a manufacturing downside that penetrates up a year later and is producing mishaps brings t your charges being hiked, see [[http://coolcarinsurancequotes.tumblr.com/|alberta auto insurance]]. <<BR>>
<<BR>>
Most of the time, you might not be in a position to do any such thing concerning the walk in automobile insurance charges you are enduring. You may possibly nonetheless have the ability to enhance a decline by looking at reductions you could request or affect. Discounts on adding antitheft units and taking defensive driving classes can help to bring down your fee to its preceding stage. Be sure to talk to your insurance representative about your possibilities and furthermore accomplish an on the web assessment with other insurance corporations to make certain you are obtaining the greatest package for your overall scenario.

Many people are often surprised once they see that their motor insurance price has gone on rebirth. It's crucial to know about the particular causes that can just take they to be avoided by steps and guide up to such an scenario. A hike in your price can easily see you pay hundreds of bucks more. Even when you do seek out an alternative insurer, you may find that exactly the same factors utilized by recent insurer can effect the others. Listed here are a couple of worries your insurer considers in identifying your car insurance costs.

1.Criminal Offense

That describes small occurrences like getting a parking ticket, or being offered for around dashing to significant offenses like driving while intoxicated. A major role is played by traffic violations for making you look like a top danger motorist. Occasionally the insurer may also offer you a notice of cancellation of coverage. Be certain in order to avoid such any and all violations as it could make it difficult not to only spend but actually uncover an ensure who'll acknowledge your application for an insurance policy.

2.Your Spouse

Many partners will apply to the same insurer to own both their automobiles covered. This is usually done to simply help the likelihood of a discount and produce the process easier by dealing with a single insurer. However many owners have now been amazed to find that their spouse has a poor driving record solely after doing this and it has triggered a rise in place of discount on their insurance. Before making this type of transfer, be upfront about your document whilst not to detrimentally affect your companion.

3.The New Car Has A Negative Ranking

Many people get thrilled at the outlook of a brand new auto and become stunned once they start to see the insurance charges it attracts. When insurance companies establish charges, in addition they go through the amount of states created according to automobile product and produce. Predicated on this analysis, selected automobiles will entice large charges while other will get reduced fee. It is crucial that you find out the status on a vehicle before making a buy to observe how it'll affect your insurance quality ranges. These evaluations may also vary from year to year based on automobile business studies therefore don't be astonished in case a manufacturing downside that penetrates up a year later and is producing mishaps brings t your charges being hiked, see alberta auto insurance.

Most of the time, you might not be in a position to do any such thing concerning the walk in automobile insurance charges you are enduring. You may possibly nonetheless have the ability to enhance a decline by looking at reductions you could request or affect. Discounts on adding antitheft units and taking defensive driving classes can help to bring down your fee to its preceding stage. Be sure to talk to your insurance representative about your possibilities and furthermore accomplish an on the web assessment with other insurance corporations to make certain you are obtaining the greatest package for your overall scenario.

HgWebDirStepByStep (last edited 2018-11-26 18:38:58 by JordiGH)