このページの2つのバージョン間の差分を表示します。
次のリビジョン | 前のリビジョン 次のリビジョン 両方とも次のリビジョン | ||
git2:server:git-web [2020/06/04 23:07] y2sunlight 作成 |
git2:server:git-web [2020/06/05 09:03] y2sunlight [GitWebへのアクセス] |
||
---|---|---|---|
行 6: | 行 6: | ||
[[git: | [[git: | ||
- | 本章では、社内用のGitサーバーの構築について説明します。本編の[[git2: | + | 本章では、社内用のGitサーバーの構築について説明します。本編の「[[git2: |
サーバー環境 | サーバー環境 | ||
行 22: | 行 22: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
---- | ---- | ||
+ | |||
+ | ===== GitWebのインストール ===== | ||
+ | |||
+ | gitweb(CGI) を IUSリポジトリからインストールします。本章ではgit2.24を使用しているので、パッケージ名は、'' | ||
+ | |||
+ | < | ||
+ | yum install --enablerepo=ius git224-gitweb | ||
+ | </ | ||
+ | |||
+ | <div indent> | ||
+ | インストールの途中で、インストールしても良いか確認される ('' | ||
+ | </ | ||
+ | |||
+ | ここでインストールしたCGI ('' | ||
+ | |||
+ | < | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | '' | ||
+ | |||
+ | {{fa> | ||
+ | <code perl gitweb.cgi> | ||
+ | ... | ||
+ | 85 # absolute fs-path which will be prepended to the project path | ||
+ | 86 #our $projectroot = "/ | ||
+ | 87 our $projectroot = "/ | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | * 87行目:'' | ||
+ | \\ | ||
+ | |||
+ | ===== Apacheの設定 ===== | ||
+ | |||
+ | GitWeb をインストールすると ''/ | ||
+ | |||
+ | {{fa> | ||
+ | <code int git.conf.rpmnew> | ||
+ | Alias /git / | ||
+ | |||
+ | < | ||
+ | Options +ExecCGI | ||
+ | AddHandler cgi-script .cgi | ||
+ | DirectoryIndex gitweb.cgi | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | これを参考に「[[git2: | ||
+ | |||
+ | {{fa> | ||
+ | <code int git.conf> | ||
+ | # 環境設定 | ||
+ | SetEnv GIT_PROJECT_ROOT /var/git | ||
+ | SetEnv GIT_HTTP_EXPORT_ALL | ||
+ | |||
+ | ScriptAlias /git/ / | ||
+ | |||
+ | # GitWeb | ||
+ | Alias /gitweb / | ||
+ | < | ||
+ | Options +ExecCGI | ||
+ | AddHandler cgi-script .cgi | ||
+ | DirectoryIndex gitweb.cgi | ||
+ | </ | ||
+ | |||
+ | # アクセス制御 | ||
+ | < | ||
+ | |||
+ | < | ||
+ | < | ||
+ | # LAN内の特定のホストのみ許可 | ||
+ | Require all denied | ||
+ | Require host localhost | ||
+ | Require ip 127.0.0.1 | ||
+ | Require ip 192.168.11.0/ | ||
+ | </ | ||
+ | |||
+ | # Basic認証 | ||
+ | AuthType Basic | ||
+ | AuthName "Git Access" | ||
+ | AuthUserFile / | ||
+ | Require valid-user | ||
+ | </ | ||
+ | |||
+ | # 全開 | ||
+ | # Require all granted | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | * ''/ | ||
+ | * ''/ | ||
+ | * ''/ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ===== GitWebへのアクセス ===== | ||
+ | |||
+ | ブラウザで以下のURLにアクセスして下さい。 | ||
+ | |||
+ | < | ||
+ | http:// | ||
+ | </ | ||
+ | |||
+ | [{{: | ||
+ | ■ ロポジトリの一覧が表示されます。 | ||
+ | ■ プロジェクト( ここでは '' | ||
+ | |||
+ | [{{: | ||
+ | ■ プロジェクトの summary が表示されます。\\ | ||
+ | ■ summaryの他に shortlog, log, commit, commitdiff, tree の表示が出来ます | ||
\\ | \\ | ||