Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following situation:

In the same machine I have a mercurial server and a web server. The project repository is located at /var/hg/repos/myproyect and the public files for web server are in /usr/share/nginx/www

Is any way to link (ln) the repo directory to public path server? when I do

ln /var/hg/repos/myproject/.hg/store/data/ /ush/share/nginx/www/myproject

and I put in the browser is shown nothing

I noted that store data in .hg ending in .i extension

share|improve this question

You should almost certainly setup hgweb to serve the repository rather than dumping the raw files.

The Publishing Repositories and HGWeb Step-by-Step wiki articles covers this in depth, but here are the highlights:

  1. Create a hgweb.conf file (usually in /usr/local/etc/ or something virtual host dependent in multitenant environments).

    myproject = /var/hg/repos/myproject
    allow_archive = gz
    contact = Some Name <>
  2. Copy the hgweb.cgi file from the installation directory to your cgi-bin directory. More likely than not: cp /usr/share/mercurial/www/hgweb.cgi /var/www/cgi-bin/ (You get the idea anyway).

  3. Edit the hgweb.cgi file, set the config file location from #1.
  4. Configure nginx for fcgi:

    location /hg/ {
        include         fastcgi_hg;
        fastcgi_intercept_errors    off;
        limit_except GET HEAD {
            auth_basic  'Example';
            auth_basic_user_file /srv/hg.htpasswd;
  5. Configure the fcgi include (fastcgi_hg) for hg:

    include fastcgi_params;
    fastcgi_split_path_info ^(/hg)(.*)$;
    fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
    fastcgi_param  PATH_INFO          $fastcgi_path_info;
    fastcgi_param  AUTH_USER          $remote_user;
    fastcgi_param  REMOTE_USER        $remote_user;
  6. Restart nginx and Bob's your uncle!
share|improve this answer
thanks! maybe I didn't explain well. for example, if I push a info.php file containing phpinfo(), I would like to see what phpinfo() returns not raw info.php file – papelucho Apr 29 '13 at 16:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.