konratnox
2/29/2016 - 8:50 AM

Все настройки для меркуриал

Все настройки для меркуриал

/etc/apache2/sites-available/sursil-hg.owstudio.ru.conf <VirtualHost 127.0.0.1:8080> ServerName sursil-hg.owstudio.ru DocumentRoot "/usr/share/mercurial"

ScriptAlias / "/usr/share/mercurial/"

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

LogFormat "%h %l %u %t "%r" %>s %b" common CustomLog "/var/log/hg/access.log" common ErrorLog "/var/log/hg/error.log"

RewriteEngine on RewriteCond %{REQUEST_URI} !^/hgweb.cgi/ RewriteRule (.*) /hgweb.cgi/$1 [QSA,L]

/usr/share/mercurial/hgweb.cgi #!/usr/bin/env python

An example hgweb CGI script, edit as necessary

See also https://mercurial-scm.org/wiki/PublishingRepositories

Path to repo or hgweb config to serve (see 'hg help hgweb')

config = "/etc/mercurial/hgweb.conf"

Uncomment and adjust if Mercurial is not installed system-wide

(consult "installed modules" path from 'hg debuginstall'):

#import sys; sys.path.insert(0, "/path/to/python/lib")

Uncomment to send python tracebacks to the browser if an error occurs:

#import cgitb; cgitb.enable()

from mercurial import demandimport; demandimport.enable() from mercurial.hgweb import hgweb, wsgicgi application = hgweb(config) wsgicgi.launch(application)

/etc/mercurial/hgweb.conf [paths] sursil.ru = /home/sites/sursil.ru

[web] style = gitweb push_ssl = false allow_push = * encoding = utf8

/etc/nginx/sites-available/sursil-hg.owstudio.ru server { listen *:80;

    server_name sursil-hg.owstudio.ru;
    access_log /var/log/nginx/hg.access.log combined buffer=16k;

    add_header X-Frame-Options SAMEORIGIN;
    add_header X-Content-Type-Options nosniff;

    server_name_in_redirect off;

    # Proxy headers
    include proxy_headers.conf;
    set $proxyserver        "http://127.0.0.1:8080";


    location / {
            allow 79.104.15.50;
            allow 145.255.233.162;
            allow 145.255.233.163;
            allow 145.255.233.164;
            allow 145.255.233.165;
            allow 145.255.233.166;
            deny all;
            include proxy_headers.conf;
            proxy_pass http://127.0.0.1:8080/;
            #proxy_pass $proxyserver;
    }

}

/etc/nginx/proxy_headers.conf add_header 'X-Real-IP' $remote_addr; add_header 'X-Forwarded-For' $proxy_add_x_forwarded_for; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header Host $http_host;