Разворачиваем сервер Mercurial (Ubuntu)

Инструкция по установке и настройке Mercurial через Apache (проверено на ubuntu 10.04) Установка Mercurial и Apache [code] sudo aptitude install mercurial sudo aptitude install apache2 libapache2-mod-wsgi [/code] Создаем пользователя hg и его папку [code] sudo useradd hg sudo mkdir /home/hg sudo chown hg:hg /home/hg sudo -u hg mkdir /home/hg/rep /home/hg/www [/code] Создаем виртуальный хост файл: /etc/apache2/sites-available/mercurial [code] ServerAdmin [email protected] ServerName hg.myhost.ru DocumentRoot /home/hg/www/ # настройки wsgi WSGIProcessGroup hg WSGIDaemonProcess hg user=hg group=hg threads=2 maximum-requests=1000 # путь до скрипта, обрабатывающий wsgi WSGIScriptAlias / /home/hg/rep/hgwebdir.wsgi # ограничение доступа к репозиторию AuthType Basic AuthName "Mercurial repositories" AuthUserFile /home/hg/.hg.htpasswd Require valid-user [/code] Подключаем виртуальный хост [code] sudo a2ensite mercurial [/code] Создаем hg (wsgi) приложение Файл: /home/hg/rep/hgwebdir.wsgi [code] #!/usr/bin/python # -*- coding: utf-8 -*- import os os.environ['HGENCODING'] = 'utf-8' from mercurial.hgweb.hgwebdir_mod import hgwebdir from mercurial.hgweb.request import wsgiapplication path = os.path.dirname(os.path.abspath(__file__)) application = hgwebdir(path+'/hgwebdir.conf') [/code] Создаем репозиторий "myproject" [code] sudo -u hg hg init /home/hg/rep/myproject [/code] Создаем файл настроек /home/hg/rep/hgwebdir.con [code] [web] style = coal [paths] myproject = /home/hg/rep/myproject [/code] в раздел path нужно прописывать все созданные репозитории Добавление пользователей Создание файла паролей и добавление пользователей [code] htpasswd -c /home/hg/.hg.htpasswd user1 htpasswd /home/hg/.hg.htpasswd user2 [/code] Перезагружаем Apache [code] sudo /etc/init.d/apache restart [/code] push через web Для того что-бы можно было пушить через apache, нужно в файле репозитория .hg/hgrc прописать: [code] [web] allow_push = user1, user2 #allow_push = * push_ssl = false [/code] в параметре allow_push перечислить пользователей либо поставить "*" - все пользователи. параметр push_ssl = false дает возможность пушить через http (по умолчанию можно только через https) Готово. [url=http://www.py-my.ru/post/4c049ed31d41c8298f000003]Источник[/url]

Комментариев нет:

Отправить комментарий