Differences between revisions 1 and 78 (spanning 77 versions)
Revision 1 as of 2006-06-18 14:03:10
Size: 3757
Editor: MishaS
Comment: one more page about hgwebdir.cgi
Revision 78 as of 2013-08-27 19:15:46
Size: 3632
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.
For many individuals motor insurance restoration is a straightforward matter of barely looking at the price given by the agent and making a check always out for the amount. Many simply want to get done with this annual schedule and go on with their usual lives. This mellow attitude might however be costing hundreds to you of bucks in insurance premiums. It is time t get more aggressive in regards to the specials you're obtaining and request your insurance agent blunt issues that will help you determine if the plan you currently have is actually the most effective they might do. Listed below are a few pre-determined questions you should create a note of wondering according to Insure.com. <<BR>>
<<BR>>
*How many reductions do you offer? <<BR>>
<<BR>>
Most insurance internet sites may reduce on the facts in regards to the amount of savings they give. Before a discount is given It's frequently yes to the customer to create enquiries. Finally an insurance corporation is really a organization and the more money they charge you for insurance the more profit they make. Ask plainly about discounts and if you must list down all the kinds of discounts you feel if they're presented you be eligible for and inquire. <<BR>>
<<BR>>
*Does my extensive cover give actual cash price or agreed upon value? <<BR>>
<<BR>>
You get compensated if the auto is totaled, when you've comprehensive address. There are many providers who compensate clients at the level of real money price which will be the existing worth of the auto at the moment m the accident. Many individuals could find that their car has really depreciated because the last time they'd it appreciated and tend to be disillusioned by the insurance always check they get. The agreed upon value is nevertheless the value of the car as agreed upon by both you and the insurer at that time you took or last reconditioned your insurance. Make sure you find out which importance applies to prevent awful shocks in future, for example [[http://www.prweb.com/releases/autoinsurance/quotesonline/prweb10902377.htm|auto insurance]]. <<BR>>
<<BR>>
*Do I must say I require anymore than obligation insurance? <<BR>>
<<BR>>
That is really a subject of managing the stats. Depending on the price of the automobile it self, it might not be worth it to use up any longer than liability insurance. If the vehicle features a low value the expense of totally covering it could constitute a big portion of its value. And after spending a deductible, the quantity paid for settlement may not be worth much. <<BR>>
<<BR>>
*What sort of areas do I get for repair work? <<BR>>
<<BR>>
For all this is a subject of inclination. There are initial production parts and replacement parts. Originals are generally pricier thus many providers will often have low cost aftermarket areas utilized in fix work to cut back the statement. If you stringently want initial elements you may want to learn if this program is available at your insurer or choose a new one completely. <<BR>>
<<BR>>
It is vital that you familiarize oneself with insurance conditions and methods. The difference can be made all by this in helping you save countless dollars annually in automobile insurance payments. Especially when they notice they're more or less to close a deal, much information will not be given out too by most insurance agents. Get an on the web price from your own insurer and get additional time to explore it. You could make comparisons with different offers from major insurers in your location and pay your broker a trip to discover what advantage there's in staying his consumer.

For many individuals motor insurance restoration is a straightforward matter of barely looking at the price given by the agent and making a check always out for the amount. Many simply want to get done with this annual schedule and go on with their usual lives. This mellow attitude might however be costing hundreds to you of bucks in insurance premiums. It is time t get more aggressive in regards to the specials you're obtaining and request your insurance agent blunt issues that will help you determine if the plan you currently have is actually the most effective they might do. Listed below are a few pre-determined questions you should create a note of wondering according to Insure.com.

*How many reductions do you offer?

Most insurance internet sites may reduce on the facts in regards to the amount of savings they give. Before a discount is given It's frequently yes to the customer to create enquiries. Finally an insurance corporation is really a organization and the more money they charge you for insurance the more profit they make. Ask plainly about discounts and if you must list down all the kinds of discounts you feel if they're presented you be eligible for and inquire.

*Does my extensive cover give actual cash price or agreed upon value?

You get compensated if the auto is totaled, when you've comprehensive address. There are many providers who compensate clients at the level of real money price which will be the existing worth of the auto at the moment m the accident. Many individuals could find that their car has really depreciated because the last time they'd it appreciated and tend to be disillusioned by the insurance always check they get. The agreed upon value is nevertheless the value of the car as agreed upon by both you and the insurer at that time you took or last reconditioned your insurance. Make sure you find out which importance applies to prevent awful shocks in future, for example auto insurance.

*Do I must say I require anymore than obligation insurance?

That is really a subject of managing the stats. Depending on the price of the automobile it self, it might not be worth it to use up any longer than liability insurance. If the vehicle features a low value the expense of totally covering it could constitute a big portion of its value. And after spending a deductible, the quantity paid for settlement may not be worth much.

*What sort of areas do I get for repair work?

For all this is a subject of inclination. There are initial production parts and replacement parts. Originals are generally pricier thus many providers will often have low cost aftermarket areas utilized in fix work to cut back the statement. If you stringently want initial elements you may want to learn if this program is available at your insurer or choose a new one completely.

It is vital that you familiarize oneself with insurance conditions and methods. The difference can be made all by this in helping you save countless dollars annually in automobile insurance payments. Especially when they notice they're more or less to close a deal, much information will not be given out too by most insurance agents. Get an on the web price from your own insurer and get additional time to explore it. You could make comparisons with different offers from major insurers in your location and pay your broker a trip to discover what advantage there's in staying his consumer.

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