このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
git2:server:git-web [2020/06/05 06:38] y2sunlight [GitWebのインストール] |
git2:server:git-web [2020/06/16 15:28] (現在) y2sunlight [Apacheの設定] |
||
---|---|---|---|
行 6: | 行 6: | ||
[[git: | [[git: | ||
- | 本章では、社内用のGitサーバーの構築について説明します。本編の[[git2: | + | 本章では、社内用のGitサーバーの構築について説明します。本編の「[[git2: |
サーバー環境 | サーバー環境 | ||
行 16: | 行 16: | ||
* [[git2: | * [[git2: | ||
* Gitサーバーの構築 - Git Web | * Gitサーバーの構築 - Git Web | ||
- | * [[git: | + | * [[git2: |
リンク | リンク | ||
行 28: | 行 28: | ||
===== GitWebのインストール ===== | ===== GitWebのインストール ===== | ||
- | git-daemon | + | gitweb(CGI) |
< | < | ||
行 38: | 行 38: | ||
</ | </ | ||
+ | ここでインストールした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の設定 ===== | ===== Apacheの設定 ===== | ||
- | > TODO | + | |
+ | 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.1.0/ | ||
+ | </ | ||
+ | |||
+ | # Basic認証 | ||
+ | AuthType Basic | ||
+ | AuthName "Git Access" | ||
+ | AuthUserFile / | ||
+ | Require valid-user | ||
+ | </ | ||
+ | |||
+ | # 全開 | ||
+ | # Require all granted | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | * ''/ | ||
+ | * ''/ | ||
+ | * ''/ | ||
+ | |||
+ | 編集が終わったら、Apacheを再起動します。 | ||
+ | |||
+ | < | ||
+ | systemctl restart httpd | ||
+ | </code> | ||
\\ | \\ | ||
===== GitWebへのアクセス ===== | ===== GitWebへのアクセス ===== | ||
- | > TODO | + | |
+ | ブラウザで以下のURLにアクセスして下さい。 | ||
+ | |||
+ | <code> | ||
+ | http:// | ||
+ | </ | ||
+ | |||
+ | [{{: | ||
+ | ■ ロポジトリの一覧が表示されます。 | ||
+ | ■ プロジェクト( ここでは '' | ||
+ | |||
+ | [{{: | ||
+ | ■ プロジェクトの summary が表示されます。\\ | ||
+ | ■ summaryの他に shortlog, log, commit, commitdiff, tree の表示が出来ます | ||
\\ | \\ | ||