Home
Packages
Forums
Wiki
GitLab
Security
AUR
Download
コンテンツにスキップ
メインメニュー
メインメニュー
サイドバーに移動
非表示
案内
メインページ
目次
コミュニティに貢献
最近の出来事
おまかせ表示
特別ページ
交流
ヘルプ
貢献
最近の更新
最近の議論
新しいページ
統計
リクエスト
ArchWiki
検索
検索
表示
アカウント作成
ログイン
個人用ツール
アカウント作成
ログイン
Gitwebのソースを表示
ページ
議論
日本語
閲覧
ソースを閲覧
履歴を表示
ツール
ツール
サイドバーに移動
非表示
操作
閲覧
ソースを閲覧
履歴を表示
全般
リンク元
関連ページの更新状況
ページ情報
表示
サイドバーに移動
非表示
←
Gitweb
あなたには「このページの編集」を行う権限がありません。理由は以下の通りです:
この操作は、次のグループに属する利用者のみが実行できます:
登録利用者
。
このページのソースの閲覧やコピーができます。
[[Category:バージョン管理システム]] [[en:Gitweb]] Gitweb は [[git]] 自体に含まれているデフォルトのウェブインターフェイスであり [[cgit]], [[en2:gitosis|gitosis]] と行った他の git スクリプトのベースにもなっています。 gitweb は fcgi をネイティブでサポートしているため、cgi スクリプトとしてラッピングする必要はありません: http://repo.or.cz/w/alt-git.git?a=blob_plain;f=gitweb/INSTALL https://sixohthree.com/1402/running-gitweb-in-fastcgi-mode == インストール == gitweb をインストールするには、まず {{Pkg|git}} とウェブサーバーをインストールしてください。ここで、テストを行いたい場合は、{{ic|git instaweb}} のヘルプを見て下さい。完全なセットアップをする場合、以下を読んで下さい。 ここでは {{Pkg|apache}} を例として用いますが {{Pkg|nginx}}, {{Pkg|lighttpd}} などを使うことも可能です。 現在の gitweb のデフォルトからウェブサーバーのディレクトリにリンクを作成する必要があります。次の例ではデフォルトのフォルダを使用します: # ln -s /usr/share/gitweb /srv/http/gitweb {{Note|1=サーバーのディレクトリはよく確認してシンボリックリンクを作成してください。}} == 設定 == === Apache 2.2 === 以下を {{ic|/etc/httpd/conf/httpd.conf}} の最後に追加します: <Directory "/srv/http/gitweb"> DirectoryIndex gitweb.cgi Allow from all AllowOverride all Order allow,deny Options ExecCGI <Files gitweb.cgi> SetHandler cgi-script </Files> SetEnv GITWEB_CONFIG /etc/conf.d/gitweb.conf </Directory> バーチャルホストを使っている場合、以下を {{ic|/etc/httpd/conf/extra/httpd-vhosts.conf}} に追加します: <VirtualHost *:80> ServerName gitserver DocumentRoot /var/www/gitweb <Directory /var/www/gitweb> Options ExecCGI +FollowSymLinks +SymLinksIfOwnerMatch AllowOverride All order allow,deny Allow from all AddHandler cgi-script cgi DirectoryIndex gitweb.cgi </Directory> </VirtualHost> また、設定を {{ic|/etc/httpd/conf/extra/}} の設定ファイルに記述することもできますが、そうするかどうかはあなた次第です。 ==== Apache 2.4 ==== Apache 2.4 の場合、{{Pkg|git}} と {{Pkg|apache}} に加えて {{Pkg|mod_perl}}{{Broken package link|package not found}} をインストールしてください。 {{ic|/etc/httpd/conf/extra/httpd-gitweb.conf}} を作成: <IfModule mod_perl.c> Alias /gitweb "/usr/share/gitweb" <Directory "/usr/share/gitweb"> DirectoryIndex gitweb.cgi Require all granted Options ExecCGI AddHandler perl-script .cgi PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders SetEnv GITWEB_CONFIG /etc/conf.d/gitweb.conf </Directory> </IfModule> 以下の行を {{ic|/etc/httpd/conf/httpd.conf}} のモジュールセクションに追記: LoadModule perl_module modules/mod_perl.so 以下の行を {{ic|/etc/httpd/conf/httpd.conf}} の最後に追加: # gitweb configuration Include conf/extra/httpd-gitweb.conf === Lighttpd === 以下を {{ic|/etc/lighttpd/lighttpd.conf}} に追加: server.modules += ( "mod_alias", "mod_cgi", "mod_redirect", "mod_setenv" ) setenv.add-environment = ( "GITWEB_CONFIG" => "/etc/conf.d/gitweb.conf" ) url.redirect += ( "^/gitweb$" => "/gitweb/" ) alias.url += ( "/gitweb/" => "/usr/share/gitweb/" ) $HTTP["url"] =~ "^/gitweb/" { cgi.assign = ( ".cgi" => "" ) server.indexfiles = ( "gitweb.cgi" ) } また、GitWeb を正しく表示させるには {{ic|mimetype.assign}} の行に {{ic|".css" => "text/css"}} を追加する必要があります。 === Nginx === {{ic|# ln -s /usr/share/gitweb /srv/http}} とシンボリックリンクを作成した場合、nginx の設定に以下の location を追加: {{hc|/etc/nginx/nginx.conf| <nowiki>location /gitweb/ { index gitweb.cgi; include fastcgi_params; gzip off; fastcgi_param GITWEB_CONFIG /etc/conf.d/gitweb.conf; if ($uri ~ "/gitweb/gitweb.cgi") { fastcgi_pass unix:/var/run/fcgiwrap.sock; } }</nowiki> }} また、{{Pkg|fcgiwrap}} と {{Pkg|spawn-fcgi}} をインストールして fcgiwrap のサービスファイルを編集する必要があります: {{hc|/usr/lib/systemd/system/fcgiwrap.service| <nowiki>[Unit] Description=Simple server for running CGI applications over FastCGI After=syslog.target network.target [Service] Type=forking Restart=on-abort PIDFile=/var/run/fcgiwrap.pid ExecStart=/usr/bin/spawn-fcgi -s /var/run/fcgiwrap.sock -P /var/run/fcgiwrap.pid -u http -g http -- /usr/sbin/fcgiwrap ExecStop=/usr/bin/kill -15 $MAINPID [Install] WantedBy=multi-user.target</nowiki> }} 最後に、サービスを有効化・再起動: {{bc|systemctl enable nginx fcgiwrap systemctl start nginx fcgiwrap}} === Gitweb の設定 === 次に gitweb の設定ファイルを作成する必要があります。{{ic|/etc/conf.d/gitweb.conf}} ファイルを開いて (ファイルが存在しない場合は作成して) 以下のように記述してください: {{hc|/etc/conf.d/gitweb.conf|<nowiki> our $git_temp = "/tmp"; # The directories where your projects are. Must not end with a slash. our $projectroot = "/path/to/your/repositories"; # Base URLs for links displayed in the web interface. our @git_base_url_list = qw(git://<your_server> http://git@<your_server>); </nowiki>}} "blame" (ソースファイルの各行の著者を表示) を有効にするには、以下の行を追加: $feature{'blame'}{'default'} = [1]; 設定が完了したら、ウェブサーバーを再起動してください。apache の場合: systemctl restart httpd lighttpd の場合: systemctl restart lighttpd === シンタックスハイライト === Gitweb でシンタックスハイライトを使うには、まず {{Pkg|highlight}} パッケージをインストールしてください。 highlight をインストールしたら、以下の行を {{ic|gitweb.conf}} に追加します: {{bc|<nowiki>$feature{'highlight'}{'default'} = [1];</nowiki>}} ファイルを保存すればハイライトが有効になります。 == リポジトリの追加 == リポジトリフォルダにリポジトリを追加するには、以下のようにリポジトリを作成: mkdir my_repository.git git init --bare my_repository.git/ cd my_repository.git/ touch git-daemon-export-ok echo "Short project's description" > description 次に {{ic|config}} ファイルを開いて以下を追加: [gitweb] owner = Your Name これで gitweb の "Owner" フィールドが入りますが、必須ではありません。 I assumed that you want to have this repository as "central" repository storage where you push your commits to so the git-daemon-export-ok and --bare are here to have minimal overhead and to allow the git daemon to be used on it. That is all for making a repository. You can now see it on your http://localhost/gitweb (assuming everything went fine). You do not need to restart apache for new repositories since the gitweb cgi script simply reads your repository folder. == 参照 == このページは主に howtoforge を基にしています: http://www.howtoforge.com/how-to-install-a-public-git-repository-on-a-debian-server 。動作させるのに必要な部分だけを抜き出しています。
このページで使用されているテンプレート:
テンプレート:Bc
(
ソースを閲覧
)
テンプレート:Bug
(
ソースを閲覧
)
テンプレート:Hc
(
ソースを閲覧
)
テンプレート:Ic
(
ソースを閲覧
)
テンプレート:Man
(
ソースを閲覧
)
テンプレート:Pkg
(
ソースを閲覧
)
Gitweb
に戻る。
検索
検索
Gitwebのソースを表示
話題を追加