1

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 http://iptoserver.com/myproject is shown nothing

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

1 Answer 1

2

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).

    [paths] myproject = /var/hg/repos/myproject [web] allow_archive = gz contact = Some Name <[email protected]> 
  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/ { fastcgi_pass 127.0.0.1:9000; 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!
1
  • 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 Commented Apr 29, 2013 at 16:41

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.