Quantcast
Channel: プログラム の個人的なメモ
Viewing all articles
Browse latest Browse all 860

【分散リポジトリ】【HG】 Mercurial(HG) ~ BASIC認証を導入する ~

$
0
0

■ 前提条件

https://blogs.yahoo.co.jp/dk521123/36290337.html
で、Mercurial がインストールされていること

■ 構築手順

Apache側の設定のみで導入可能
【1】 Apache側の設定ファイルの追記
【2】 htpasswdファイルの作成

【1】 Apache側の設定ファイルの追記

 * 以下の「<!-- !! Add !! -->」以下を参考に、/etc/httpd/conf.d/hg.confを修正する
【ファイル内容 : /etc/httpd/conf.d/hg.conf】
<IfModule mod_wsgi.c>
  AddHandler wsgi-script .wsgi
  WSGIScriptAlias /hg /usr/local/hg/cgi-bin/hgweb.wsgi

  <Directory "/usr/local/hg/cgi-bin">
   Options ExecCGI FollowSymLinks

   AllowOverride None
   Require all granted
  </Directory>

  <Directory "/usr/local/hg/htdocs">
   Options FollowSymLinks

   AllowOverride None
   Require all granted
  </Directory>

  <!-- !! Add !! -->
  <Location /hg>
    AuthType Basic
    AuthName "Mercurial repositories for Basic Auth"
    AuthUserFile /etc/httpd/.hg_htpasswd
    <!--  push できるのは認証したユーザだけにする -->
    <LimitExcept GET PROPFIND OPTIONS REPORT>
        Require valid-user
    </LimitExcept>
  </Location>
</IfModule>

【2】 htpasswdファイルの作成

 * htpasswd コマンド で、ユーザ/パスワードを保持したhtpasswdファイルを作成する
コマンド例
# 【2-1】ファイル作成(-c : ファイル作成)
sudo htpasswd -c /etc/httpd/.hg_htpasswd user01

# 【2-2】ユーザ追加
sudo htpasswd /etc/httpd/.hg_htpasswd user02
補足:ユーザ削除
sudo htpasswd -D /etc/httpd/.hg_htpasswd user02


関連記事

Mercurial(HG) ~環境構築編~

https://blogs.yahoo.co.jp/dk521123/36290337.html

Viewing all articles
Browse latest Browse all 860

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>