「ConoHa VPS に Gitサーバを立ててみた」の版間の差分
提供: tknotebook
(→ユーザを作成する) |
(→ユーザを作成する) |
||
18行: | 18行: | ||
ユーザ名はgit, グループ名は git。ユーザの作り方は'''「[[Conoha VPS でそこそこ新しいLAMP環境の構築#ユーザを追加する]]」'''を参考にしてください。 | ユーザ名はgit, グループ名は git。ユーザの作り方は'''「[[Conoha VPS でそこそこ新しいLAMP環境の構築#ユーザを追加する]]」'''を参考にしてください。 | ||
+ | |||
+ | ==yum のリポジトリフォルダへ移動== | ||
+ | |||
+ | cd /etc/yum.repos.d | ||
+ | |||
+ | ==wing リポジトリをインストール== | ||
+ | |||
+ | wing リポジトリは 最新のgitをお手軽に yum でインストールできるようにするリポジトリです。 | ||
+ | まずこれをインストールします。尚、Wingは恐らく epel が必須ですが、epelはConoHaでは最初から | ||
+ | enable=1 でインストールされています。 | ||
+ | |||
+ | wget http://wing-repo.net/wing/6/EL6.wing.repo | ||
+ | |||
+ | --2016-10-23 14:33:36-- http://wing-repo.net/wing/6/EL6.wing.repo | ||
+ | Resolving wing-repo.net... 103.12.17.254 | ||
+ | Connecting to wing-repo.net|103.12.17.254|:80... connected. | ||
+ | HTTP request sent, awaiting response... 200 OK | ||
+ | Length: 303 | ||
+ | Saving to: “EL6.wing.repo” | ||
+ | |||
+ | 100%[======================================>] 303 --.-K/s in 0s | ||
+ | |||
+ | 2016-10-23 14:33:36 (37.2 MB/s) - “EL6.wing.repo” saved [303/303] | ||
+ | |||
+ | yum --enablerepo=wing list git | ||
+ | |||
+ | Loaded plugins: fastestmirror, security | ||
+ | Loading mirror speeds from cached hostfile | ||
+ | * base: ftp.iij.ad.jp | ||
+ | * epel: ftp.jaist.ac.jp | ||
+ | * extras: ftp.iij.ad.jp | ||
+ | * updates: ftp.iij.ad.jp | ||
+ | Installed Packages | ||
+ | git.x86_64 1.7.1-3.el6_4.1 @base | ||
+ | Available Packages | ||
+ | git.x86_64 2.10.1-1.el6_55.wing wing | ||
+ | |||
+ | ==git 1-7 の削除== | ||
+ | |||
+ | yum remove git | ||
+ | |||
+ | <pre> | ||
+ | Loaded plugins: fastestmirror, security | ||
+ | Setting up Remove Process | ||
+ | Resolving Dependencies | ||
+ | --> Running transaction check | ||
+ | ---> Package git.x86_64 0:1.7.1-3.el6_4.1 will be erased | ||
+ | --> Processing Dependency: git = 1.7.1-3.el6_4.1 for package: perl-Git-1.7.1-3.el6_4.1.noarch | ||
+ | --> Processing Dependency: git for package: php-phpunit-Version-1.0.3-3.el6.remi.noarch | ||
+ | --> Running transaction check | ||
+ | ---> Package perl-Git.noarch 0:1.7.1-3.el6_4.1 will be erased | ||
+ | ---> Package php-phpunit-Version.noarch 0:1.0.3-3.el6.remi will be erased | ||
+ | --> Processing Dependency: php-composer(sebastian/version) >= 1.0 for package: php-phpunit-PHP-CodeCoverage-2.0.11-1.el6.remi.noarch | ||
+ | --> Processing Dependency: php-composer(sebastian/version) < 2 for package: php-phpunit-PHP-CodeCoverage-2.0.11-1.el6.remi.noarch | ||
+ | --> Processing Dependency: php-composer(sebastian/version) >= 1.0 for package: php-phpunit-PHPUnit-4.3.4-1.el6.remi.noarch | ||
+ | --> Processing Dependency: php-composer(sebastian/version) < 2 for package: php-phpunit-PHPUnit-4.3.4-1.el6.remi.noarch | ||
+ | --> Running transaction check | ||
+ | ---> Package php-phpunit-PHP-CodeCoverage.noarch 0:2.0.11-1.el6.remi will be erased | ||
+ | ---> Package php-phpunit-PHPUnit.noarch 0:4.3.4-1.el6.remi will be erased | ||
+ | --> Finished Dependency Resolution | ||
+ | |||
+ | Dependencies Resolved | ||
+ | |||
+ | ================================================================================ | ||
+ | Package Arch Version Repository | ||
+ | Size | ||
+ | ================================================================================ | ||
+ | Removing: | ||
+ | git x86_64 1.7.1-3.el6_4.1 @base 15 M | ||
+ | Removing for dependencies: | ||
+ | perl-Git noarch 1.7.1-3.el6_4.1 @base 35 k | ||
+ | php-phpunit-PHP-CodeCoverage noarch 2.0.11-1.el6.remi @remi 1.0 M | ||
+ | php-phpunit-PHPUnit noarch 4.3.4-1.el6.remi @remi 957 k | ||
+ | php-phpunit-Version noarch 1.0.3-3.el6.remi @remi 8.7 k | ||
+ | |||
+ | Transaction Summary | ||
+ | ================================================================================ | ||
+ | Remove 5 Package(s) | ||
+ | |||
+ | Installed size: 17 M | ||
+ | Is this ok [y/N]: y | ||
+ | Downloading Packages: | ||
+ | Running rpm_check_debug | ||
+ | Running Transaction Test | ||
+ | Transaction Test Succeeded | ||
+ | Running Transaction | ||
+ | Erasing : php-phpunit-PHPUnit-4.3.4-1.el6.remi.noarch 1/5 | ||
+ | Erasing : php-phpunit-PHP-CodeCoverage-2.0.11-1.el6.remi.noarch 2/5 | ||
+ | Erasing : php-phpunit-Version-1.0.3-3.el6.remi.noarch 3/5 | ||
+ | Erasing : perl-Git-1.7.1-3.el6_4.1.noarch 4/5 | ||
+ | Erasing : git-1.7.1-3.el6_4.1.x86_64 5/5 | ||
+ | Verifying : git-1.7.1-3.el6_4.1.x86_64 1/5 | ||
+ | Verifying : php-phpunit-Version-1.0.3-3.el6.remi.noarch 2/5 | ||
+ | Verifying : perl-Git-1.7.1-3.el6_4.1.noarch 3/5 | ||
+ | Verifying : php-phpunit-PHP-CodeCoverage-2.0.11-1.el6.remi.noarch 4/5 | ||
+ | Verifying : php-phpunit-PHPUnit-4.3.4-1.el6.remi.noarch 5/5 | ||
+ | |||
+ | Removed: | ||
+ | git.x86_64 0:1.7.1-3.el6_4.1 | ||
+ | |||
+ | Dependency Removed: | ||
+ | perl-Git.noarch 0:1.7.1-3.el6_4.1 | ||
+ | php-phpunit-PHP-CodeCoverage.noarch 0:2.0.11-1.el6.remi | ||
+ | php-phpunit-PHPUnit.noarch 0:4.3.4-1.el6.remi | ||
+ | php-phpunit-Version.noarch 0:1.0.3-3.el6.remi | ||
+ | |||
+ | Complete! | ||
+ | </pre> | ||
+ | |||
+ | ==新git追加== | ||
+ | |||
+ | yum --enablerepo=wing install git | ||
+ | |||
+ | <pre> | ||
+ | Loaded plugins: fastestmirror, security | ||
+ | Setting up Install Process | ||
+ | Loading mirror speeds from cached hostfile | ||
+ | * base: ftp.iij.ad.jp | ||
+ | * epel: ftp.jaist.ac.jp | ||
+ | * extras: ftp.iij.ad.jp | ||
+ | * updates: ftp.iij.ad.jp | ||
+ | Resolving Dependencies | ||
+ | --> Running transaction check | ||
+ | ---> Package git.x86_64 0:2.10.1-1.el6_55.wing will be installed | ||
+ | --> Processing Dependency: perl-Git = 2.10.1-1.el6_55.wing for package: git-2.10.1-1.el6_55.wing.x86_64 | ||
+ | --> Processing Dependency: perl(Git) for package: git-2.10.1-1.el6_55.wing.x86_64 | ||
+ | --> Running transaction check | ||
+ | ---> Package perl-Git.noarch 0:2.10.1-1.el6_55.wing will be installed | ||
+ | --> Finished Dependency Resolution | ||
+ | |||
+ | Dependencies Resolved | ||
+ | |||
+ | ================================================================================ | ||
+ | Package Arch Version Repository Size | ||
+ | ================================================================================ | ||
+ | Installing: | ||
+ | git x86_64 2.10.1-1.el6_55.wing wing 9.5 M | ||
+ | Installing for dependencies: | ||
+ | perl-Git noarch 2.10.1-1.el6_55.wing wing 36 k | ||
+ | |||
+ | Transaction Summary | ||
+ | ================================================================================ | ||
+ | Install 2 Package(s) | ||
+ | |||
+ | Total download size: 9.6 M | ||
+ | Installed size: 28 M | ||
+ | Is this ok [y/N]: y | ||
+ | Downloading Packages: | ||
+ | (1/2): git-2.10.1-1.el6_55.wing.x86_64.rpm | 9.5 MB 00:01 | ||
+ | (2/2): perl-Git-2.10.1-1.el6_55.wing.noarch.rpm | 36 kB 00:00 | ||
+ | -------------------------------------------------------------------------------- | ||
+ | Total 8.7 MB/s | 9.6 MB 00:01 | ||
+ | Running rpm_check_debug | ||
+ | Running Transaction Test | ||
+ | Transaction Test Succeeded | ||
+ | Running Transaction | ||
+ | Installing : git-2.10.1-1.el6_55.wing.x86_64 1/2 | ||
+ | Installing : perl-Git-2.10.1-1.el6_55.wing.noarch 2/2 | ||
+ | Verifying : perl-Git-2.10.1-1.el6_55.wing.noarch 1/2 | ||
+ | Verifying : git-2.10.1-1.el6_55.wing.x86_64 2/2 | ||
+ | |||
+ | Installed: | ||
+ | git.x86_64 0:2.10.1-1.el6_55.wing | ||
+ | |||
+ | Dependency Installed: | ||
+ | perl-Git.noarch 0:2.10.1-1.el6_55.wing | ||
+ | |||
+ | Complete! | ||
+ | </pre> | ||
+ | |||
+ | git --version | ||
+ | |||
+ | git version 2.10.1 |
2016年10月23日 (日) 06:02時点における版
メインページ>コンピュータの部屋>ConoHa VPS を使ってみた
長年 Subversion を Subversion Edge で愛用してきましたが、
時代の流れに負け、Git も使ってみることを決心、Git のリモートリポジトリを ConoHa VPS上に作成してみることにしました。
方針
Gitサーバーとクライアントの接続方法には Gitプロトコルや WebDAV など各種方法があるようですが 最も簡単かつ実用的で安全な SSH を使うことにしました。
以下はその手順です。
ユーザを作成する
サーバ上のリポジトリを操作するユーザを用意します。
ユーザ名はgit, グループ名は git。ユーザの作り方は「Conoha VPS でそこそこ新しいLAMP環境の構築#ユーザを追加する」を参考にしてください。
yum のリポジトリフォルダへ移動
cd /etc/yum.repos.d
wing リポジトリをインストール
wing リポジトリは 最新のgitをお手軽に yum でインストールできるようにするリポジトリです。 まずこれをインストールします。尚、Wingは恐らく epel が必須ですが、epelはConoHaでは最初から enable=1 でインストールされています。
wget http://wing-repo.net/wing/6/EL6.wing.repo
--2016-10-23 14:33:36-- http://wing-repo.net/wing/6/EL6.wing.repo Resolving wing-repo.net... 103.12.17.254 Connecting to wing-repo.net|103.12.17.254|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 303 Saving to: “EL6.wing.repo” 100%[======================================>] 303 --.-K/s in 0s 2016-10-23 14:33:36 (37.2 MB/s) - “EL6.wing.repo” saved [303/303]
yum --enablerepo=wing list git
Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile * base: ftp.iij.ad.jp * epel: ftp.jaist.ac.jp * extras: ftp.iij.ad.jp * updates: ftp.iij.ad.jp Installed Packages git.x86_64 1.7.1-3.el6_4.1 @base Available Packages git.x86_64 2.10.1-1.el6_55.wing wing
git 1-7 の削除
yum remove git
Loaded plugins: fastestmirror, security Setting up Remove Process Resolving Dependencies --> Running transaction check ---> Package git.x86_64 0:1.7.1-3.el6_4.1 will be erased --> Processing Dependency: git = 1.7.1-3.el6_4.1 for package: perl-Git-1.7.1-3.el6_4.1.noarch --> Processing Dependency: git for package: php-phpunit-Version-1.0.3-3.el6.remi.noarch --> Running transaction check ---> Package perl-Git.noarch 0:1.7.1-3.el6_4.1 will be erased ---> Package php-phpunit-Version.noarch 0:1.0.3-3.el6.remi will be erased --> Processing Dependency: php-composer(sebastian/version) >= 1.0 for package: php-phpunit-PHP-CodeCoverage-2.0.11-1.el6.remi.noarch --> Processing Dependency: php-composer(sebastian/version) < 2 for package: php-phpunit-PHP-CodeCoverage-2.0.11-1.el6.remi.noarch --> Processing Dependency: php-composer(sebastian/version) >= 1.0 for package: php-phpunit-PHPUnit-4.3.4-1.el6.remi.noarch --> Processing Dependency: php-composer(sebastian/version) < 2 for package: php-phpunit-PHPUnit-4.3.4-1.el6.remi.noarch --> Running transaction check ---> Package php-phpunit-PHP-CodeCoverage.noarch 0:2.0.11-1.el6.remi will be erased ---> Package php-phpunit-PHPUnit.noarch 0:4.3.4-1.el6.remi will be erased --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Removing: git x86_64 1.7.1-3.el6_4.1 @base 15 M Removing for dependencies: perl-Git noarch 1.7.1-3.el6_4.1 @base 35 k php-phpunit-PHP-CodeCoverage noarch 2.0.11-1.el6.remi @remi 1.0 M php-phpunit-PHPUnit noarch 4.3.4-1.el6.remi @remi 957 k php-phpunit-Version noarch 1.0.3-3.el6.remi @remi 8.7 k Transaction Summary ================================================================================ Remove 5 Package(s) Installed size: 17 M Is this ok [y/N]: y Downloading Packages: Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Erasing : php-phpunit-PHPUnit-4.3.4-1.el6.remi.noarch 1/5 Erasing : php-phpunit-PHP-CodeCoverage-2.0.11-1.el6.remi.noarch 2/5 Erasing : php-phpunit-Version-1.0.3-3.el6.remi.noarch 3/5 Erasing : perl-Git-1.7.1-3.el6_4.1.noarch 4/5 Erasing : git-1.7.1-3.el6_4.1.x86_64 5/5 Verifying : git-1.7.1-3.el6_4.1.x86_64 1/5 Verifying : php-phpunit-Version-1.0.3-3.el6.remi.noarch 2/5 Verifying : perl-Git-1.7.1-3.el6_4.1.noarch 3/5 Verifying : php-phpunit-PHP-CodeCoverage-2.0.11-1.el6.remi.noarch 4/5 Verifying : php-phpunit-PHPUnit-4.3.4-1.el6.remi.noarch 5/5 Removed: git.x86_64 0:1.7.1-3.el6_4.1 Dependency Removed: perl-Git.noarch 0:1.7.1-3.el6_4.1 php-phpunit-PHP-CodeCoverage.noarch 0:2.0.11-1.el6.remi php-phpunit-PHPUnit.noarch 0:4.3.4-1.el6.remi php-phpunit-Version.noarch 0:1.0.3-3.el6.remi Complete!
新git追加
yum --enablerepo=wing install git
Loaded plugins: fastestmirror, security Setting up Install Process Loading mirror speeds from cached hostfile * base: ftp.iij.ad.jp * epel: ftp.jaist.ac.jp * extras: ftp.iij.ad.jp * updates: ftp.iij.ad.jp Resolving Dependencies --> Running transaction check ---> Package git.x86_64 0:2.10.1-1.el6_55.wing will be installed --> Processing Dependency: perl-Git = 2.10.1-1.el6_55.wing for package: git-2.10.1-1.el6_55.wing.x86_64 --> Processing Dependency: perl(Git) for package: git-2.10.1-1.el6_55.wing.x86_64 --> Running transaction check ---> Package perl-Git.noarch 0:2.10.1-1.el6_55.wing will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: git x86_64 2.10.1-1.el6_55.wing wing 9.5 M Installing for dependencies: perl-Git noarch 2.10.1-1.el6_55.wing wing 36 k Transaction Summary ================================================================================ Install 2 Package(s) Total download size: 9.6 M Installed size: 28 M Is this ok [y/N]: y Downloading Packages: (1/2): git-2.10.1-1.el6_55.wing.x86_64.rpm | 9.5 MB 00:01 (2/2): perl-Git-2.10.1-1.el6_55.wing.noarch.rpm | 36 kB 00:00 -------------------------------------------------------------------------------- Total 8.7 MB/s | 9.6 MB 00:01 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : git-2.10.1-1.el6_55.wing.x86_64 1/2 Installing : perl-Git-2.10.1-1.el6_55.wing.noarch 2/2 Verifying : perl-Git-2.10.1-1.el6_55.wing.noarch 1/2 Verifying : git-2.10.1-1.el6_55.wing.x86_64 2/2 Installed: git.x86_64 0:2.10.1-1.el6_55.wing Dependency Installed: perl-Git.noarch 0:2.10.1-1.el6_55.wing Complete!
git --version
git version 2.10.1