views:

28

answers:

1

I have setup my repo at /home/adil/hg/sample-repo and want to serve it via httpd. I am following the tutorial at http://mercurial.selenic.com/wiki/PublishingRepositories#multiple and have created the hgweb.config file and have copied hgweb.cgi (renamed it to index.cgi) to /home/adil/web/mercurial/

My apache config (/etc/httpd/conf/httpd.conf) looks like this :

ScriptAlias /hg "/home/adil/web/mercurial/index.cgi"

<Directory "/home/adil/web/mercurial">
    Order allow,deny
    Allow from all
    AllowOverride All
    Options ExecCGI
    AddHandler cgi-script .cgi
</Directory>

index.cgi, hgweb.config and all the dirs upwards have world read permissions

http://localhost/hg gives a "403 Forbidden" error. WTF?

PS: Apache error log shows : [Sun Oct 17 06:45:38 2010] [error] [client 1.2.3.4] (13)Permission denied: access to /hg denied

A: 

Probably Apache's process owner does not have permissions to access /home/adil/web/mercurial.

Also, do check Apache's error log (usually located in /var/log/httpd-error.log or some place similar. It will give you extra information to debug your installation.

To check what's the user running Apache's process do:

$ ps aux | grep http

ps should show what's the user running Apache.

Also, in case it helps, here's the way I do it:

ScriptAliasMatch        ^/hg(.*)        /usr/local/share/mercurial/www/hgweb.cgi$1
<Directory /usr/local/share/mercurial/www>
  Options ExecCGI FollowSymLinks
  AllowOverride None
  Options None
  Order allow,deny
  Allow from all
</Directory>
Pablo Santa Cruz
Pablo, it has read permissions on all the directories. How can i check of user 'apache' can access it?
Adil
Does it have permissions for the repositories as well? or just for the CGI script?
Ton