2011年8月22日月曜日

CentOS5.6にGit導入→公開(未完成)

鍵生成にはPuTTYgenを推奨

1.インストール
$ wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
$ sudo rpm -ivh epel-release-5-4.noarch.rpm
$ sudo yum -y install git gitosis
$ ssh-keygen -t rsa

2.鍵登録
・PuTTYgenで鍵を生成(※OpenSSH形式じゃないと上手くいかないっぽい点に留意)
$ mkdir /root/.ssh
$ vi /root/.ssh/id_rsa.pub
・「OpenSSHのauthorized_keysファイルにペーストするための公開鍵」の部分をコピーして/root/.ssh/id_rsa.pubに貼りつけ&保存
$ vi /root/.ssh/id_rsa
・PuTTYgen>変換>OpenSSH形式へエクスポートを実行し出てきたファイルの中身を/root/.ssh/id_rsaに貼りつけ&保存
$ sudo -H -u gitosis gitosis-init < /root/.ssh/id_rsa.pub

3.管理ファイルのダウンロード
$ passwd gitosis
Changing password for user gitosis.
New UNIX password:[任意のパスワード]
Retype new UNIX password:[任意のパスワード]

$ mkdir /root/work
$ cd /root/work

$ git clone ssh://gitosis@localhost/gitosis-admin.git
Cloning into gitosis-admin...
The authenticity of host 'localhost (127.0.0.1)' can't be established.
RSA key fingerprint is bd:24:...:9c:83.
Are you sure you want to continue connecting (yes/no)? [yes]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/root/.ssh/id_rsa' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /root/.ssh/id_rsa
Enter passphrase for key '/root/.ssh/id_rsa':[空Enter]
gitosis@localhost's password:[↑で設定した任意のパスワード]
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 0), reused 5 (delta 0)
Receiving objects: 100% (5/5), done.

4.管理ファイルの設定
$ cd gitosis-admin
$ vi gitosis.conf

#最下行に以下追加
[group test]
writable = test-dev
members = testuser
#ココマデ

$ vi keydir/testuser.pub
・追加したいユーザーの「OpenSSHのauthorized_keysファイルにペーストするための公開鍵」を貼付け
$ cd keydir
$ git add testuser.pub
$ cd ../
$ git commit -am "Comment" -a
$ git push
Enter passphrase for key '/root/.ssh/id_rsa':[空Enter]
gitosis@localhost's password:[↑で設定した任意のパスワード]

・新規リポ追加
$ cd ../
$ mkdri test-dev
$ cd test-dev
$ git init
$ touch dummy
$ git add dummy
$ git commit -am "Comment"
$ git remote add origin gitosis@localhost:test-dev.git
$ git push origin master:refs/heads/master

2011年5月26日木曜日

VMwareServer から ESXi への移行の際の変換

1:ovftoolのダウンロード
http://www.vmware.com/download/eula/ovf_eula.html

2:コマンドプロンプトで変換
C:\User\test> cd C:\Program Files\VMware\VMware OVF Tool
C:\User\test> ovftool C:\Test.vmx C:\Test.ovf

※もしServerでの利用時にディスクドライブにISO等を読み込んでいた場合は
 変換前に対象部分をvmxファイルから削除しておく。

3:vSphere Clientでインポート
ファイル>OVFテンプレートのデプロイ

ESXi のバージョンアップ

1:VMware vSphere CLIのダウンロード&インストール
http://downloads.vmware.com/jp/d/details/vcli41/ZHcqYmRoaCpiZHd0aA==

2:ESXiのパッチをダウンロード
http://www.vmware.com/patch/download/
※検索対象にESXがあるので間違いに注意
 ダウンロードしたファイル(今回はupdate-from-esxi4.1-4.1_update01.zip)をC:\直下に移動

3:コマンドプロンプト起動
C:\User\test> cd C:\Program Files\VMware\VMware vSphere CLI\bin
 CLIフォルダに移動
C:\User\test> vihostupdate.pl --server 192.168.0.0 --install --bundle C:\update-from-esxi4.1-4.1_update01.zip
 ESXiサーバーのIPを指定とパッチファイルを指定し、インストールの実行

4:ESXiサーバー再起動
3のインストール処理が終了したらサーバー再起動後画面確認でVerチェック

2011年5月25日水曜日

ESXi での VMware Tools インストール(CentOS)

仮想サーバー右クリック>ゲスト>VMware Tools のインストール/アップグレード

$ reboot
$ mount /dev/cdrom /mnt
$ tar zxf /mnt/VMwareTools-8.3.7-341836.tar.gz
$ umount /mnt
$ cd vmware-tools-distrib
$ ./vmware-install.pl

In which directory do you want to install the binary files?
[/usr/bin]
$ [空Enter]

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc/rc.d]
$ [空Enter]

What is the directory that contains the init scripts?
[/etc/rc.d/init.d]
$ [空Enter]

In which directory do you want to install the daemon files?
[/usr/sbin]
$ [空Enter]

In which directory do you want to install the library files?
[/usr/lib/vmware-tools]
$ [空Enter]

The path "/usr/lib/vmware-tools" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes]
$ [空Enter]

In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools]
The path "/usr/share/doc/vmware-tools" does not exist currently. This program
is going to create it, including needed parent directories. Is this what you
want? [yes]
$ [空Enter]

Before running VMware Tools for the first time, you need to configure it by
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
this program to invoke the command for you now? [yes]
$ [空Enter]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To use the vmxnet driver, restart networking using the following commands:
/etc/init.d/network stop
rmmod pcnet32
rmmod vmxnet
modprobe vmxnet
/etc/init.d/network start

Enjoy,

$ cd ../
$ rm -rf vmware-tools-distrib/