Windowsで作る - PHPプログラミングの開発環境
このページへのアクセス 今日: 0 / 昨日: 2 総計: 4758
文書の過去の版を表示しています。
Git 2.24
— y2sunlight 2020-06-04
Git に戻る
本章では、社内用のGitサーバーの構築について説明します。本編の「Smart HTTPによるGitサーバーの構築」によって、基本的なGitサーバーの機能は得られたので、次は、Webベースのブラウジング機能を追加します。Gitには、GitWebと呼ばれるCGIスクリプト(perl5)が付属しています。
サーバー環境
関連記事
リンク
gitweb(CGI) を IUSリポジトリからインストールします。本章ではgit2.24を使用しているので、パッケージ名は、git224-gitweb です。Gitのインストールについての詳細は本編の IUSによるgit2の導入 をご覧ください。
git224-gitweb
yum install --enablerepo=ius git224-gitweb
インストールの途中で、インストールしても良いか確認される (Is this ok [y/d/N]:) ので y と回答します。正常にインストールされると最後に、完了のメッセージが表示されます。
Is this ok [y/d/N]:
y
ここでインストールしたCGI (gitweb.cgi) は以下に設置されます。
gitweb.cgi
/var/www/git/gitweb.cgi
gitweb.cgi(Perl5で書かれている) を以下のように編集します。
** /var/www/git **
85 # absolute fs-path which will be prepended to the project path 86 #our $projectroot = "/pub/scm"; 87 our $projectroot = "/var/git";
$projectroot
/var/git
TODO
** /etc/httpd/conf.d **
Alias /git /var/www/git <Directory /var/www/git> Options +ExecCGI AddHandler cgi-script .cgi DirectoryIndex gitweb.cgi </Directory>
# 環境設定 SetEnv GIT_PROJECT_ROOT /var/git SetEnv GIT_HTTP_EXPORT_ALL ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/ # GitWeb Alias /gitweb /var/www/git <Directory /var/www/git> Options +ExecCGI AddHandler cgi-script .cgi DirectoryIndex gitweb.cgi </Directory> # アクセス制御 <LocationMatch "^/(git|gitweb)"> <RequireAny> <RequireAny> # LAN内の特定のホストのみ許可 Require all denied Require host localhost Require ip 127.0.0.1 Require ip 192.168.11.0/24 </RequireAny> # Basic認証 AuthType Basic AuthName "Git Access" AuthUserFile /var/git/.htpasswd Require valid-user </RequireAny> # 全開 # Require all granted </LocationMatch>