ユーザ用ツール

サイト用ツール


ubuntu-server-14-04:git-server

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
ubuntu-server-14-04:git-server [2015/01/07 21:53] – [モジュールを有効化] adminubuntu-server-14-04:git-server [2015/01/07 22:50] (現在) admin
行 49: 行 49:
 </code> </code>
  
 +Apache2 のサイトの設定を変更する。[[apache2-ssl|以前作成]]した、SSL を使用するサイトの <VirtualHost> ディレクティブ内に以下を記述する。認証に使用するパスワードは、[[webdav|WebDav をインストール]]した際に作成したものを利用する。 
  
 +  * /var/www/git: Git リポジトリを格納するディレクトリ。複数のリポジトリを格納する予定。
  
 <code> <code>
-                SSLRequireSSL +SetEnv GIT_PROJECT_ROOT /var/www/git 
-                SSLOptions +StrictRequire +AliasMatch ^/git/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$          /var/www/git/$1 
-                Options Indexes +AliasMatch ^/git/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /var/www/git/$1 
-                AuthType Basic +ScriptAlias /git/ /usr/lib/git-core/git-http-backend/ 
-                AuthName "Webdav+ 
-                AuthUserFile /etc/apache2/dav.passwd +<Location /git> 
-                Require valid-user+        SSLRequireSSL 
 +        SSLOptions +StrictRequire 
 +        AuthType Basic 
 +        AuthName "Git Authentication
 +        AuthUserFile /etc/apache2/dav.passwd 
 +        Require valid-user 
 +</Location> 
 </code> </code>
  
行 67: 行 76:
 </code> </code>
  
 +Apache2 を再起動する。
  
-テスト用のリポジトリを作成+<code> 
 +$ sudo service apache2 restart 
 +</code> 
 + 
 + 
 +==== テスト用のリポジトリを作成 ==== 
 + 
 +テスト用にリポジトリを作成する。
  
 <code> <code>
行 76: 行 93:
 $ cd ./test.git/ $ cd ./test.git/
 $ sudo git init --bare $ sudo git init --bare
-Initialized empty Git repository in /var/www/git/test.git/ 
-$ sudo touch ./git-daemon-export-ok 
-$ sudo cp ./hooks/post-update.sample ./hooks/post-update 
 $ sudo git config http.receivepack true $ sudo git config http.receivepack true
 $ sudo git update-server-info $ sudo git update-server-info
 +$ sudo touch ./git-daemon-export-ok
 +$ sudo cp ./hooks/post-update.sample ./hooks/post-update
 $ sudo chown -R www-data:www-data . $ sudo chown -R www-data:www-data .
 </code> </code>
 +
 +クライアントからアクセスし、Git にアクセスできるかを確認する。
 +
  
 ===== 参考 ===== ===== 参考 =====
ubuntu-server-14-04/git-server.1420635227.txt.gz · 最終更新: 2015/01/07 21:53 by admin