Conoha VPS でそこそこ新しいLAMP環境の構築

提供: tknotebook
2016年11月9日 (水) 12:20時点におけるNakamuri (トーク | 投稿記録)による版

(差分) ←前の版 | 最新版 (差分) | 次の版→ (差分)
移動: 案内検索

メインページ>コンピュータの部屋>ConoHa VPS を使ってみた

2014年11月

最初ConoHa VPS を使い始めたときは CENTOS 6.5 で既定でインストール可能な LAMP 環境で始めようとしたのですが、SubVersion Edge などがインストールできないことがわかり、もう少し新しめな環境を構築することにしました。以下がその記録です。

方針の確認

CENTOS 6.5 で最も簡単に作れるLAMP環境は apache 2.2, php5.3, mysql 5.1 です。しかも ConoHa VPS では、すでに PHP と apache がインストールされています。しかしこの組み合わせは 以下の問題があります。

  • HTML5のWebSocketが使えない(apache)
  • finallyが使えない(php)
  • 古すぎてサポートが打ち切られている(MySQL)

また、LAMP用のソフトのインストール条件を調べてみると php5.4以上, MYSQL 5.5以上というものがたまにあるようです。

一方、apache 2.4 はインストールがかなりやっかいかつ php や MYSQL との依存関係も複雑です。

MYSQL 5.6 は結構派手に変わったらしく、互換性が心配です。

そこで、以下の方針で行くことにしました。

  1. Websocketは興味がないわけではないが、当分使いそうにないので apache は 2.2のままで行く。
  2. phpでは finally は 5.5 以上ではないと使えないし、これは必須だと思うので 最新のphp5.6 に決定。
  3. Mysql は少しだけ古い MySQL 5.5に決定。これでほとんどのソフトはインストールできる。

これなら epel と remi で yum を使って簡単にインストールできそうです。

VMの作成

ConoHa Control Panel にログインし、サーバーリストを選びます。

画面の ADD VPS ボタンを押し、プラン(2GB) とインストールイメージ(CentOS 6.5(64bit))を選びます。

root のパスワードを入力して CONTINUE ボタンを押すと数分で VM が出来上がり起動します。

コンソール接続

ConoHa の既定のコンソール接続には2つの方法があります。

ひとつはコントロールパネルのコンソール画面からログインする方法です。

この方法ではVPS生成時に指定したパスワードでログインします。

このコンソールはクリップボードから直接文字を入力することはできませんが、クリップボードから文字を貼り付け、コンソールへ送信できるウィンドウを使えるので、クリップボード経由で文字を入力することができます。

もう一つの方法は Teratermなどの SSH クライアントを使う方法です。ConoHaのVPSの初期設定では、rootにsshで秘密鍵を使って接続するようになっています。コントロールパネルの[コンソール]画面から秘密鍵のファイルを落とせるのでそれを使って接続します。

Terterm で ConoHa VPS の SSH に接続し、ユーザ名は root を指定、パスフレーズは空のままにしておいて、秘密鍵ファイルを指定すれば接続できます。

状況確認

サービスリスト

ConoHa VPS の初期のサービスの稼働状態は以下のようになっています。

abrt-ccpp       0:off   1:off   2:off   3:on    4:off   5:on    6:off
abrt-oops       0:off   1:off   2:off   3:on    4:off   5:on    6:off
abrtd           0:off   1:off   2:off   3:on    4:off   5:on    6:off
acpid           0:off   1:off   2:on    3:on    4:on    5:on    6:off
atd             0:off   1:off   2:off   3:on    4:on    5:on    6:off
auditd          0:off   1:off   2:on    3:on    4:on    5:on    6:off
blk-availability        0:off   1:on    2:on    3:off   4:on    5:on    6:off
cgconfig        0:off   1:off   2:off   3:off   4:off   5:off   6:off
cgred           0:off   1:off   2:off   3:off   4:off   5:off   6:off
cpuspeed        0:off   1:on    2:on    3:off   4:on    5:on    6:off
crond           0:off   1:off   2:on    3:on    4:on    5:on    6:off
htcacheclean    0:off   1:off   2:off   3:off   4:off   5:off   6:off

httpd は入っているが起動していない。

httpd           0:off   1:off   2:off   3:off   4:off   5:off   6:off
ip6tables       0:off   1:off   2:on    3:on    4:on    5:on    6:off

ファイアウォールはON

iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off
irqbalance      0:off   1:off   2:off   3:on    4:on    5:on    6:off
iscsi           0:off   1:off   2:off   3:off   4:off   5:off   6:off
iscsid          0:off   1:off   2:off   3:off   4:off   5:off   6:off
kdump           0:off   1:off   2:off   3:off   4:on    5:on    6:off
lvm2-monitor    0:off   1:on    2:on    3:on    4:on    5:on    6:off
mdmonitor       0:off   1:off   2:on    3:on    4:on    5:on    6:off
multipathd      0:off   1:off   2:off   3:off   4:off   5:off   6:off
netconsole      0:off   1:off   2:off   3:off   4:off   5:off   6:off
netfs           0:off   1:off   2:off   3:on    4:on    5:on    6:off
network         0:off   1:off   2:on    3:on    4:on    5:on    6:off

ntpdは動作

ntpd            0:off   1:off   2:off   3:on    4:off   5:off   6:off
ntpdate         0:off   1:off   2:off   3:off   4:off   5:off   6:off

メールサーバも動いている

postfix         0:off   1:off   2:on    3:on    4:on    5:on    6:off
psacct          0:off   1:off   2:off   3:off   4:off   5:off   6:off
quota_nld       0:off   1:off   2:off   3:off   4:off   5:off   6:off
rdisc           0:off   1:off   2:off   3:off   4:off   5:off   6:off
restorecond     0:off   1:off   2:off   3:off   4:off   5:off   6:off
rngd            0:off   1:off   2:off   3:off   4:off   5:off   6:off
rsyslog         0:off   1:off   2:on    3:on    4:on    5:on    6:off
saslauthd       0:off   1:off   2:off   3:off   4:off   5:off   6:off
smartd          0:off   1:off   2:off   3:off   4:off   5:off   6:off

sshも当然動いている。

sshd            0:off   1:off   2:on    3:on    4:on    5:on    6:off
svnserve        0:off   1:off   2:off   3:off   4:off   5:off   6:off
sysstat         0:off   1:on    2:on    3:on    4:on    5:on    6:off
udev-post       0:off   1:on    2:on    3:on    4:on    5:on    6:off
selinux
disabled

初期更新

2014年11月1日

yum -y update

で最初の更新を行いました。 何故か初回は再起動すると Kernel Panic になったため、再度初めから VM を作り直して実行。無事に起動しました。

更新は全部で 208M でした。

初期パッケージ

最初の yum update 後の パッケージの状態です。

abrt-addon-ccpp.x86_64              2.0.8-26.el6.centos                @base
abrt-addon-kerneloops.x86_64        2.0.8-26.el6.centos                @base
abrt-addon-python.x86_64            2.0.8-26.el6.centos                @base
abrt-cli.x86_64                     2.0.8-26.el6.centos                @base
abrt-libs.x86_64                    2.0.8-26.el6.centos                @base
abrt-tui.x86_64                     2.0.8-26.el6.centos                @base
abrt.x86_64                         2.0.8-26.el6.centos                @base
acl.x86_64                          2.2.49-6.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
acpid.x86_64                        1.0.10-2.1.el6                     @base
aic94xx-firmware.noarch             30-2.el6                           @base
alsa-lib.x86_64                     1.0.22-3.el6                       @base
alsa-utils.x86_64                   1.0.22-7.el6                       @base

APR

apr-util-ldap.x86_64                1.3.9-3.el6_0.1                    @base
apr-util.x86_64                     1.3.9-3.el6_0.1                    @base
apr.x86_64                          1.3.9-5.el6_2                      @base
atk.x86_64                          1.30.0-1.el6                       @base
atmel-firmware.noarch               1.3-7.el6                          @base
attr.x86_64                         2.4.44-7.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
at.x86_64                           3.1.10-44.el6_6.2                  @updates
audit-libs-python.x86_64            2.3.7-5.el6                        @base
audit-libs.x86_64                   2.3.7-5.el6                        @base
audit.x86_64                        2.3.7-5.el6                        @base
authconfig.x86_64                   6.1.12-19.el6                      @base
autoconf.noarch                     2.63-5.1.el6                       @base
automake.noarch                     1.11.1-4.el6                       @base
avahi-libs.x86_64                   0.6.25-15.el6                      @base
b43-fwcutter.x86_64                 012-2.2.el6                        @base
b43-openfwwf.noarch                 5.2-4.el6                          @anaconda-CentOS-201311272149.x86_64/6.5
basesystem.noarch                   10.0-4.el6                         @anaconda-CentOS-201311272149.x86_64/6.5
bash.x86_64                         4.1.2-29.el6                       @base
bc.x86_64                           1.06.95-1.el6                      @base
bfa-firmware.noarch                 3.2.23.0-2.el6                     @base
bind-libs.x86_64                    32:9.8.2-0.30.rc1.el6              @base
bind-utils.x86_64                   32:9.8.2-0.30.rc1.el6              @base
binutils.x86_64                     2.20.51.0.2-5.42.el6               @base
biosdevname.x86_64                  0.5.1-1.el6                        @base
bison.x86_64                        2.4.1-5.el6                        @base
blktrace.x86_64                     1.0.1-6.el6                        @base
bridge-utils.x86_64                 1.2-10.el6                         @anaconda-CentOS-201311272149.x86_64/6.5
btparser.x86_64                     0.17-2.el6                         @base
busybox.x86_64                      1:1.15.1-20.el6                    @base
byacc.x86_64                        1.9.20070509-7.el6                 @base
bzip2-libs.x86_64                   1.0.5-7.el6_0                      @anaconda-CentOS-201311272149.x86_64/6.5
bzip2.x86_64                        1.0.5-7.el6_0                      @anaconda-CentOS-201311272149.x86_64/6.5
ca-certificates.noarch              2014.1.98-65.1.el6                 @base
cairo.x86_64                        1.8.8-3.1.el6                      @base
centos-indexhtml.noarch             6-2.el6.centos                     @base
centos-release-cr.x86_64            10:6-0.el6.centos                  @extras
centos-release-SCL.x86_64           10:6-5.el6.centos                  installed
centos-release.x86_64               6-6.el6.centos.12.2                @base
checkpolicy.x86_64                  2.0.22-1.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
chkconfig.x86_64                    1.3.49.3-2.el6_4.1                 @anaconda-CentOS-201311272149.x86_64/6.5
cloog-ppl.x86_64                    0.15.7-1.2.el6                     @base
compat-readline5.x86_64             5.2-17.1.el6                       @base
coreutils-libs.x86_64               8.4-37.el6                         @base
coreutils.x86_64                    8.4-37.el6                         @base
cpio.x86_64                         2.10-12.el6_5                      @base
cpp.x86_64                          4.4.7-11.el6                       @base
cpuspeed.x86_64                     1:1.5-20.el6_4                     @base
cracklib-dicts.x86_64               2.8.16-4.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
cracklib.x86_64                     2.8.16-4.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
crda.x86_64                         1.1.3_2014.06.13-1.el6             @base
cronie-anacron.x86_64               1.4.4-12.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
cronie.x86_64                       1.4.4-12.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
crontabs.noarch                     1.10-33.el6                        @anaconda-CentOS-201311272149.x86_64/6.5
cryptsetup-luks-libs.x86_64         1.2.0-11.el6                       @base
cryptsetup-luks.x86_64              1.2.0-11.el6                       @base
cscope.x86_64                       15.6-6.el6                         @base
ctags.x86_64                        5.8-2.el6                          @base
cups-libs.x86_64                    1:1.4.2-67.el6                     @base
curl.x86_64                         7.19.7-37.el6_5.3                  @base
cvs.x86_64                          1.11.23-16.el6                     @base
cyrus-sasl-lib.x86_64               2.1.23-15.el6                      @base
cyrus-sasl-plain.x86_64             2.1.23-15.el6                      @base
cyrus-sasl.x86_64                   2.1.23-15.el6                      @base
dash.x86_64                         0.5.5.1-4.el6                      @anaconda-CentOS-201311272149.x86_64/6.5
db4-cxx.x86_64                      4.7.25-18.el6_4                    @base
db4-devel.x86_64                    4.7.25-18.el6_4                    @base
db4-utils.x86_64                    4.7.25-18.el6_4                    @anaconda-CentOS-201311272149.x86_64/6.5
db4.x86_64                          4.7.25-18.el6_4                    @anaconda-CentOS-201311272149.x86_64/6.5
dbus-glib.x86_64                    0.86-6.el6                         @anaconda-CentOS-201311272149.x86_64/6.5
dbus-libs.x86_64                    1:1.2.24-7.el6_3                   @anaconda-CentOS-201311272149.x86_64/6.5
dbus-python.x86_64                  0.83.0-6.1.el6                     @base
desktop-file-utils.x86_64           0.15-9.el6                         @base
device-mapper-event-libs.x86_64     1.02.90-2.el6                      @base
device-mapper-event.x86_64          1.02.90-2.el6                      @base
device-mapper-libs.x86_64           1.02.90-2.el6                      @base
device-mapper-multipath-libs.x86_64 0.4.9-80.el6                       @base
device-mapper-multipath.x86_64      0.4.9-80.el6                       @base
device-mapper-persistent-data.x86_64
device-mapper.x86_64                1.02.90-2.el6                      @base
dhclient.x86_64                     12:4.1.1-43.P1.el6.centos          @base
dhcp-common.x86_64                  12:4.1.1-43.P1.el6.centos          @base
diffstat.x86_64                     1.51-2.el6                         @base
diffutils.x86_64                    2.8.1-28.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
dmidecode.x86_64                    1:2.12-5.el6_5                     @updates
dmraid-events.x86_64                1.0.0.rc16-11.el6                  @base
dmraid.x86_64                       1.0.0.rc16-11.el6                  @base
dosfstools.x86_64                   3.0.9-4.el6                        @base
doxygen.x86_64                      1:1.6.1-6.el6                      @base
dracut-kernel.noarch                004-356.el6                        @base
dracut.noarch                       004-356.el6                        @base
e2fsprogs-libs.x86_64               1.41.12-21.el6                     @base
e2fsprogs.x86_64                    1.41.12-21.el6                     @base
ed.x86_64                           1.1-3.3.el6                        @base
efibootmgr.x86_64                   0.5.4-12.el6                       @base
eggdbus.x86_64                      0.6-3.el6                          @base
eject.x86_64                        2.1.5-17.el6                       @base
elfutils-libelf.x86_64              0.158-3.2.el6                      @base
elfutils-libs.x86_64                0.158-3.2.el6                      @base
elfutils.x86_64                     0.158-3.2.el6                      @base
elinks.x86_64                       0.12-0.21.pre5.el6_3               @base
epel-release.noarch                 6-8                                installed
ethtool.x86_64                      2:3.5-5.el6                        @base
expat.x86_64                        2.0.1-11.el6_2                     @anaconda-CentOS-201311272149.x86_64/6.5
file-libs.x86_64                    5.04-21.el6                        @base
filesystem.x86_64                   2.4.30-3.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
file.x86_64                         5.04-21.el6                        @base
findutils.x86_64                    1:4.4.2-6.el6                      @anaconda-CentOS-201311272149.x86_64/6.5
fipscheck-lib.x86_64                1.2.0-7.el6                        @anaconda-CentOS-201311272149.x86_64/6.5
fipscheck.x86_64                    1.2.0-7.el6                        @anaconda-CentOS-201311272149.x86_64/6.5
flex.x86_64                         2.5.35-9.el6                       @base
fontconfig.x86_64                   2.8.0-5.el6                        @base
freetype.x86_64                     2.3.11-14.el6_3.1                  @base
fuse.x86_64                         2.8.3-4.el6                        @anaconda-CentOS-201311272149.x86_64/6.5
gamin.x86_64                        0.1.10-9.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
gawk.x86_64                         3.1.7-10.el6                       @anaconda-CentOS-201311272149.x86_64/6.5

C, C++ が使える。

gcc-c++.x86_64                      4.4.7-11.el6                       @base
gcc-gfortran.x86_64                 4.4.7-11.el6                       @base
gcc.x86_64                          4.4.7-11.el6                       @base

デバッガもある。

gdbm-devel.x86_64                   1.8.0-36.el6                       @base
gdbm.x86_64                         1.8.0-36.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
gdb.x86_64                          7.2-75.el6                         @base
gdk-pixbuf2.x86_64                  2.24.1-5.el6                       @base
gettext-devel.x86_64                0.17-18.el6                        @base
gettext-libs.x86_64                 0.17-18.el6                        @base
gettext.x86_64                      0.17-18.el6                        @base

git

git.x86_64                          1.7.1-3.el6_4.1                    @base
glib2.x86_64                        2.28.8-4.el6                       @base
glibc-common.x86_64                 2.12-1.149.el6                     @base
glibc-devel.x86_64                  2.12-1.149.el6                     @base
glibc-headers.x86_64                2.12-1.149.el6                     @base
glibc.x86_64                        2.12-1.149.el6                     @base
gmp.x86_64                          4.3.1-7.el6_2.2                    @anaconda-CentOS-201311272149.x86_64/6.5
gnupg2.x86_64                       2.0.14-8.el6                       @base
gnutls.x86_64                       2.8.5-14.el6_5                     @base
gpgme.x86_64                        1.1.8-3.el6                        @anaconda-CentOS-201311272149.x86_64/6.5
gpm-libs.x86_64                     1.20.6-12.el6                      @base
grep.x86_64                         2.6.3-6.el6                        @base
groff.x86_64                        1.18.1.4-21.el6                    @anaconda-CentOS-201311272149.x86_64/6.5
grubby.x86_64                       7.0.15-7.el6                       @base
grub.x86_64                         1:0.97-93.el6                      @base
gtk2.x86_64                         2.24.23-6.el6                      @base
gzip.x86_64                         1.3.12-22.el6                      @base
hdparm.x86_64                       9.43-4.el6                         @base
hicolor-icon-theme.noarch           0.11-1.1.el6                       @base

少し古い Apache

httpd-tools.x86_64                  2.2.15-39.el6.centos               @base
httpd.x86_64                        2.2.15-39.el6.centos               @base
hunspell-en.noarch                  0.20090216-7.1.el6                 @base
hunspell.x86_64                     1.2.8-16.el6                       @base
hwdata.noarch                       0.233-11.1.el6                     @base
indent.x86_64                       2.2.10-7.el6                       @base
info.x86_64                         4.13a-8.el6                        @anaconda-CentOS-201311272149.x86_64/6.5
initscripts.x86_64                  9.03.46-1.el6.centos               @base
Installed Packages
intltool.noarch                     0.41.0-1.1.el6                     @base
iproute.x86_64                      2.6.32-32.el6_5                    @base
iptables-ipv6.x86_64                1.4.7-14.el6                       @base
iptables.x86_64                     1.4.7-14.el6                       @base
iputils.x86_64                      20071127-17.el6_4.2                @anaconda-CentOS-201311272149.x86_64/6.5
ipw2100-firmware.noarch             1.3-11.el6                         @base
ipw2200-firmware.noarch             3.1-4.el6                          @base
irqbalance.x86_64                   2:1.0.4-10.el6                     @base
iscsi-initiator-utils.x86_64        6.2.0.873-13.el6                   @base
ivtv-firmware.noarch                2:20080701-20.2                    @base
iwl1000-firmware.noarch             1:39.31.5.1-1.el6                  @base
iwl100-firmware.noarch              39.31.5.1-1.el6                    @base
iwl3945-firmware.noarch             15.32.2.9-4.el6                    @base
iwl4965-firmware.noarch             228.61.2.24-2.1.el6                @base
iwl5000-firmware.noarch             8.83.5.1_1-1.el6_1.1               @base
iwl5150-firmware.noarch             8.24.2.2-1.el6                     @base
iwl6000-firmware.noarch             9.221.4.1-1.el6                    @base
iwl6000g2a-firmware.noarch          17.168.5.3-1.el6                   @base
iwl6050-firmware.noarch             41.28.5.1-2.el6                    @base
iw.x86_64                           3.10-1.1.el6                       @base
jasper-libs.x86_64                  1.900.1-15.el6_1.1                 @base
kbd-misc.noarch                     1.15-11.el6                        @anaconda-CentOS-201311272149.x86_64/6.5
kbd.x86_64                          1.15-11.el6                        @anaconda-CentOS-201311272149.x86_64/6.5
kernel-devel.x86_64                 2.6.32-431.17.1.el6                @updates
kernel-devel.x86_64                 2.6.32-504.el6                     @base
kernel-firmware.noarch              2.6.32-504.el6                     @base
kernel-headers.x86_64               2.6.32-504.el6                     @base
kernel.x86_64                       2.6.32-431.17.1.el6                @updates
kernel.x86_64                       2.6.32-504.el6                     @base
kexec-tools.x86_64                  2.0.0-280.el6                      @base
keyutils-libs.x86_64                1.4-5.el6                          @base
kpartx.x86_64                       0.4.9-80.el6                       @base
krb5-libs.x86_64                    1.10.3-33.el6                      @base
ledmon.x86_64                       0.79-1.el6                         @base
less.x86_64                         436-13.el6                         @base
libacl.x86_64                       2.2.49-6.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
libaio.x86_64                       0.3.107-10.el6                     @anaconda-CentOS-201311272149.x86_64/6.5
libart_lgpl.x86_64                  2.3.20-5.1.el6                     @base
libattr.x86_64                      2.4.44-7.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
libblkid.x86_64                     2.17.2-12.18.el6                   @base
libcap-ng.x86_64                    0.6.4-3.el6_0.1                    @anaconda-CentOS-201311272149.x86_64/6.5
libcap.x86_64                       2.16-5.5.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
libcgroup.x86_64                    0.40.rc1-15.el6_6                  @updates
libcom_err.x86_64                   1.41.12-21.el6                     @base
libcurl.x86_64                      7.19.7-37.el6_5.3                  @base
libdrm.x86_64                       2.4.52-4.el6                       @base
libedit.x86_64                      2.11-4.20080712cvs.1.el6           @anaconda-CentOS-201311272149.x86_64/6.5
libertas-usb8388-firmware.noarch    2:5.110.22.p23-3.1.el6             @base
libevent.x86_64                     1.4.13-4.el6                       @base
libffi.x86_64                       3.0.5-3.2.el6                      @anaconda-CentOS-201311272149.x86_64/6.5
libgcc.x86_64                       4.4.7-11.el6                       @base
libgcj.x86_64                       4.4.7-11.el6                       @base
libgcrypt.x86_64                    1.4.5-11.el6_4                     @anaconda-CentOS-201311272149.x86_64/6.5
libgfortran.x86_64                  4.4.7-11.el6                       @base
libgomp.x86_64                      4.4.7-11.el6                       @base
libgpg-error.x86_64                 1.7-4.el6                          @anaconda-CentOS-201311272149.x86_64/6.5
libICE.x86_64                       1.0.6-1.el6                        @base
libidn.x86_64                       1.18-2.el6                         @anaconda-CentOS-201311272149.x86_64/6.5
libjpeg-turbo.x86_64                1.2.1-3.el6_5                      @updates
libnih.x86_64                       1.0.1-7.el6                        @anaconda-CentOS-201311272149.x86_64/6.5
libnl.x86_64                        1.1.4-2.el6                        @base
libpcap.x86_64                      14:1.4.0-1.20130826git2dbcaa1.el6  @base
libpciaccess.x86_64                 0.13.3-0.1.el6                     @base
libpng.x86_64                       2:1.2.49-1.el6_2                   @base
libproxy-bin.x86_64                 0.3.0-10.el6                       @base
libproxy-python.x86_64              0.3.0-10.el6                       @base
libproxy.x86_64                     0.3.0-10.el6                       @base
libreport-cli.x86_64                2.0.9-21.el6.centos                @base
libreport-compat.x86_64             2.0.9-21.el6.centos                @base
libreport-plugin-kerneloops.x86_64  2.0.9-21.el6.centos                @base
libreport-plugin-logger.x86_64      2.0.9-21.el6.centos                @base
libreport-plugin-mailx.x86_64       2.0.9-21.el6.centos                @base
libreport-plugin-reportuploader.x86_64
libreport-plugin-rhtsupport.x86_64  2.0.9-21.el6.centos                @base
libreport-python.x86_64             2.0.9-21.el6.centos                @base
libreport.x86_64                    2.0.9-21.el6.centos                @base
libselinux-python.x86_64            2.0.94-5.8.el6                     @base
libselinux-utils.x86_64             2.0.94-5.8.el6                     @base
libselinux.x86_64                   2.0.94-5.8.el6                     @base
libsemanage-python.x86_64           2.0.43-4.2.el6                     @base
libsemanage.x86_64                  2.0.43-4.2.el6                     @anaconda-CentOS-201311272149.x86_64/6.5
libsepol.x86_64                     2.0.41-4.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
libSM.x86_64                        1.2.1-2.el6                        @base
libssh2.x86_64                      1.4.2-1.el6                        @anaconda-CentOS-201311272149.x86_64/6.5
libss.x86_64                        1.41.12-21.el6                     @base
libstdc++-devel.x86_64              4.4.7-11.el6                       @base
libstdc++.x86_64                    4.4.7-11.el6                       @base
libtar.x86_64                       1.2.11-17.el6_4.1                  @base
libtasn1.x86_64                     2.3-6.el6_5                        @base
libthai.x86_64                      0.1.12-3.el6                       @base
libtiff.x86_64                      3.9.4-10.el6_5                     @updates
libtool.x86_64                      2.2.6-15.5.el6                     @base
libudev.x86_64                      147-2.57.el6                       @base
libusb1.x86_64                      1.0.9-0.6.rc1.el6                  @base
libusb.x86_64                       0.1.12-23.el6                      @anaconda-CentOS-201311272149.x86_64/6.5
libuser.x86_64                      0.56.13-5.el6                      @anaconda-CentOS-201311272149.x86_64/6.5
libutempter.x86_64                  1.1.5-4.1.el6                      @anaconda-CentOS-201311272149.x86_64/6.5
libuuid.x86_64                      2.17.2-12.18.el6                   @base
libX11-common.noarch                1.6.0-2.2.el6                      @base
libX11.x86_64                       1.6.0-2.2.el6                      @base
libXau.x86_64                       1.0.6-4.el6                        @base
libxcb.x86_64                       1.9.1-2.el6                        @base
libXcomposite.x86_64                0.4.3-4.el6                        @base
libXcursor.x86_64                   1.1.14-2.1.el6                     @base
libXdamage.x86_64                   1.1.3-4.el6                        @base
libXext.x86_64                      1.3.2-2.1.el6                      @base
libXfixes.x86_64                    5.0.1-2.1.el6                      @base
libXft.x86_64                       2.3.1-2.el6                        @base
libXinerama.x86_64                  1.1.3-2.1.el6                      @base
libXi.x86_64                        1.7.2-2.2.el6                      @base
libxml2-python.x86_64               2.7.6-17.el6_6.1                   @updates
libxml2.x86_64                      2.7.6-17.el6_6.1                   @updates
libXpm.x86_64                       3.5.10-2.el6                       @base
libXrandr.x86_64                    1.4.1-2.1.el6                      @base
libXrender.x86_64                   0.9.8-2.1.el6                      @base
libxslt.x86_64                      1.1.26-2.el6_3.1                   @base
libXtst.x86_64                      1.2.2-2.1.el6                      @base
libyaml.x86_64                      0.1.6-1.el6                        @epel
Loaded plugins: fastestmirror, security
logrotate.x86_64                    3.7.8-17.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
lsof.x86_64                         4.82-4.el6                         @base
lua.x86_64                          5.1.4-4.1.el6                      @anaconda-CentOS-201311272149.x86_64/6.5
lvm2-libs.x86_64                    2.02.111-2.el6                     @base
lvm2.x86_64                         2.02.111-2.el6                     @base
lzo.x86_64                          2.03-3.1.el6_5.1                   @base
m4.x86_64                           1.4.13-5.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
mailcap.noarch                      2.1.31-2.el6                       @base
mailx.x86_64                        12.4-7.el6                         @base
MAKEDEV.x86_64                      3.24-6.el6                         @anaconda-CentOS-201311272149.x86_64/6.5
make.x86_64                         1:3.81-20.el6                      @anaconda-CentOS-201311272149.x86_64/6.5
man-pages.noarch                    3.22-20.el6                        @base
man-pages-overrides.noarch          6.6.3-2.el6                        @base
man.x86_64                          1.6f-32.el6                        @base
mdadm.x86_64                        3.3-6.el6                          @base
microcode_ctl.x86_64                1:1.17-19.el6                      @base
mingetty.x86_64                     1.08-5.el6                         @anaconda-CentOS-201311272149.x86_64/6.5
mlocate.x86_64                      0.22.2-4.el6                       @base
module-init-tools.x86_64            3.9-24.el6                         @base
mosh.x86_64                         1.2.4-1.el6                        @epel
mpfr.x86_64                         2.4.1-6.el6                        @base
mtr.x86_64                          2:0.75-5.el6                       @base

MySQL 5.1 のライブラリ。

mysql-libs.x86_64                   5.1.73-3.el6_5                     @updates
nano.x86_64                         2.0.9-7.el6                        @base
ncurses-base.x86_64                 5.7-3.20090208.el6                 @anaconda-CentOS-201311272149.x86_64/6.5
ncurses-libs.x86_64                 5.7-3.20090208.el6                 @anaconda-CentOS-201311272149.x86_64/6.5
ncurses.x86_64                      5.7-3.20090208.el6                 @anaconda-CentOS-201311272149.x86_64/6.5
nc.x86_64                           1.84-22.el6                        @base
neon.x86_64                         0.29.3-3.el6_4                     @base
net-tools.x86_64                    1.60-110.el6_2                     @anaconda-CentOS-201311272149.x86_64/6.5
newt-python.x86_64                  0.52.11-3.el6                      @anaconda-CentOS-201311272149.x86_64/6.5
newt.x86_64                         0.52.11-3.el6                      @anaconda-CentOS-201311272149.x86_64/6.5
nspr.x86_64                         4.10.6-1.el6_5                     @base
nss_compat_ossl.x86_64              0.9.6-1.el6                        @base
nss-softokn-freebl.x86_64           3.14.3-17.el6                      @base
nss-softokn.x86_64                  3.14.3-17.el6                      @base
nss-sysinit.x86_64                  3.16.1-14.el6                      @base
nss-tools.x86_64                    3.16.1-14.el6                      @base
nss-util.x86_64                     3.16.1-3.el6                       @base
nss.x86_64                          3.16.1-14.el6                      @base
ntpdate.x86_64                      4.2.6p5-1.el6.centos               @base
ntp.x86_64                          4.2.6p5-1.el6.centos               @base
ntsysv.x86_64                       1.3.49.3-2.el6_4.1                 @base
numactl.x86_64                      2.0.9-2.el6                        @base

Open LDAP

openldap.x86_64                     2.4.39-8.el6                       @base

Open SSH

openssh-clients.x86_64              5.3p1-104.el6                      @base
openssh-server.x86_64               5.3p1-104.el6                      @base
openssh.x86_64                      5.3p1-104.el6                      @base
openssl.x86_64                      1.0.1e-30.el6_6.2                  @updates
p11-kit-trust.x86_64                0.18.5-2.el6_5.2                   @updates
p11-kit.x86_64                      0.18.5-2.el6_5.2                   @updates
pakchois.x86_64                     0.4-3.2.el6                        @base
pam_passwdqc.x86_64                 1.0.5-6.el6                        @base
pam.x86_64                          1.1.1-20.el6                       @base
pango.x86_64                        1.28.1-10.el6                      @base
parted.x86_64                       2.1-25.el6                         @base
passwd.x86_64                       0.77-4.el6_2.2                     @anaconda-CentOS-201311272149.x86_64/6.5
patchutils.x86_64                   0.3.1-3.1.el6                      @base
patch.x86_64                        2.6-6.el6                          @base
pciutils-libs.x86_64                3.1.10-4.el6                       @base
pciutils.x86_64                     3.1.10-4.el6                       @base
pcmciautils.x86_64                  015-4.2.el6                        @base

PCRE

pcre.x86_64                         7.8-6.el6                          @anaconda-CentOS-201311272149.x86_64/6.5

perl

perl-Compress-Raw-Zlib.x86_64       1:2.021-136.el6                    @base
perl-Compress-Zlib.x86_64           2.021-136.el6                      @base
perl-CPAN.x86_64                    1.9402-136.el6                     @base
perl-devel.x86_64                   4:5.10.1-136.el6                   @base
perl-Digest-SHA.x86_64              1:5.47-136.el6                     @base
perl-Error.noarch                   1:0.17015-4.el6                    @base
perl-ExtUtils-MakeMaker.x86_64      6.55-136.el6                       @base
perl-ExtUtils-ParseXS.x86_64        1:2.2003.0-136.el6                 @base
perl-Git.noarch                     1.7.1-3.el6_4.1                    @base
perl-HTML-Parser.x86_64             3.64-2.el6                         @base
perl-HTML-Tagset.noarch             3.20-4.el6                         @base
perl-IO-Compress-Base.x86_64        2.021-136.el6                      @base
perl-IO-Compress-Zlib.x86_64        2.021-136.el6                      @base
perl-libs.x86_64                    4:5.10.1-136.el6                   @base
perl-libwww-perl.noarch             5.833-2.el6                        @base
perl-Module-Pluggable.x86_64        1:3.90-136.el6                     @base
perl-Pod-Escapes.x86_64             1:1.04-136.el6                     @base
perl-Pod-Simple.x86_64              1:3.13-136.el6                     @base
perl-Test-Harness.x86_64            3.17-136.el6                       @base
perl-URI.noarch                     1.40-2.el6                         @base
perl-version.x86_64                 3:0.77-136.el6                     @base
perl.x86_64                         4:5.10.1-136.el6                   @base
perl-XML-Parser.x86_64              2.36-7.el6                         @base

PHP

php-cli.x86_64                      5.3.3-40.el6_6                     @updates
php-common.x86_64                   5.3.3-40.el6_6                     @updates
php-gd.x86_64                       5.3.3-40.el6_6                     @updates
php-pdo.x86_64                      5.3.3-40.el6_6                     @updates
php-pear.noarch                     1:1.9.4-4.el6                      @base
php.x86_64                          5.3.3-40.el6_6                     @updates
php-xml.x86_64                      5.3.3-40.el6_6                     @updates
pinentry.x86_64                     0.7.6-6.el6                        @anaconda-CentOS-201311272149.x86_64/6.5
pinfo.x86_64                        0.6.9-12.el6                       @base
pixman.x86_64                       0.32.4-4.el6                       @base
pkgconfig.x86_64                    1:0.23-9.1.el6                     @anaconda-CentOS-201311272149.x86_64/6.5
plymouth-core-libs.x86_64           0.8.3-27.el6.centos.1              @base
plymouth-scripts.x86_64             0.8.3-27.el6.centos.1              @base
plymouth.x86_64                     0.8.3-27.el6.centos.1              @base
policycoreutils-python.x86_64       2.0.83-19.47.el6_6.1               @updates
policycoreutils.x86_64              2.0.83-19.47.el6_6.1               @updates
popt.x86_64                         1.13-7.el6                         @anaconda-CentOS-201311272149.x86_64/6.5

postfix

postfix.x86_64                      2:2.6.6-6.el6_5                    @updates
ppl.x86_64                          0.10.2-11.el6                      @base
prelink.x86_64                      0.4.6-3.1.el6_4                    @base
procps.x86_64                       3.2.8-30.el6                       @base
protobuf.x86_64                     2.3.0-7.el6                        @epel
psacct.x86_64                       6.3.2-63.el6_3.3                   @base
psmisc.x86_64                       22.6-19.el6_5                      @updates
pth.x86_64                          2.0.7-9.3.el6                      @anaconda-CentOS-201311272149.x86_64/6.5
pygpgme.x86_64                      0.1-18.20090824bzr68.el6           @anaconda-CentOS-201311272149.x86_64/6.5
python-argparse.noarch              1.2.1-2.el6                        @epel
python-backports-ssl_match_hostname.noarch
python-backports.x86_64             1.0-3.el6                          @epel
python-boto.noarch                  2.32.1-1.el6                       @epel
python-chardet.noarch               2.0.1-1.el6                        @epel
python-cheetah.x86_64               2.4.1-1.el6                        @base
python-configobj.noarch             4.6.0-3.el6                        @base
python-ethtool.x86_64               0.6-5.el6                          @base
python-iniparse.noarch              0.3.1-2.1.el6                      @anaconda-CentOS-201311272149.x86_64/6.5
python-iwlib.x86_64                 0.1-1.2.el6                        @base
python-jsonpatch.noarch             1.2-2.el6                          @epel
python-jsonpointer.noarch           1.0-3.el6                          @epel
python-libs.x86_64                  2.6.6-52.el6                       @updates
python-markdown.noarch              2.0.1-3.1.el6                      @base
python-ordereddict.noarch           1.1-2.el6                          @epel
python-prettytable.noarch           0.7.2-1.el6                        @epel
python-pycurl.x86_64                7.19.0-8.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
python-pygments.noarch              1.1.1-1.el6                        @base
python-requests.noarch              1.1.0-4.el6                        @epel
python-setuptools.noarch            0.6.10-3.el6                       @base
python-six.noarch                   1.7.3-1.el6                        @epel
python-urlgrabber.noarch            3.9.1-9.el6                        @anaconda-CentOS-201311272149.x86_64/6.5
python-urllib3.noarch               1.5-7.el6                          @epel
python.x86_64                       2.6.6-52.el6                       @updates
PyYAML.x86_64                       3.10-3.1.el6                       @updates
ql2100-firmware.noarch              1.19.38-3.1.el6                    @base
ql2200-firmware.noarch              2.02.08-3.1.el6                    @base
ql23xx-firmware.noarch              3.03.27-3.1.el6                    @base
ql2400-firmware.noarch              7.03.00-1.el6_5                    @base
ql2500-firmware.noarch              7.03.00-1.el6_5                    @base
quota.x86_64                        1:3.17-21.el6_5                    @updates
rcs.x86_64                          5.7-37.el6                         @base
rdate.x86_64                        1.4-16.el6                         @base
readahead.x86_64                    1:1.5.6-2.el6                      @base
readline.x86_64                     6.0-4.el6                          @anaconda-CentOS-201311272149.x86_64/6.5
redhat-logos.noarch                 60.0.14-12.el6.centos              @anaconda-CentOS-201311272149.x86_64/6.5
redhat-rpm-config.noarch            9.0.3-42.el6.centos                @base
rfkill.x86_64                       0.3-4.el6                          @base
rng-tools.x86_64                    2-13.el6_2                         @base
rootfiles.noarch                    8.1-6.1.el6                        @anaconda-CentOS-201311272149.x86_64/6.5
rpm-build.x86_64                    4.8.0-37.el6                       @base
rpm-libs.x86_64                     4.8.0-37.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
rpm-python.x86_64                   4.8.0-37.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
rpm.x86_64                          4.8.0-37.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
rsync.x86_64                        3.0.6-12.el6                       @base
rsyslog.x86_64                      5.8.10-9.el6_6                     @updates
rt61pci-firmware.noarch             1.2-7.el6                          @base
rt73usb-firmware.noarch             1.8-7.el6                          @base

ruby

rubygems.noarch                     1.3.7-5.el6                        @base
ruby-irb.x86_64                     1.8.7.374-2.el6                    @base
ruby-libs.x86_64                    1.8.7.374-2.el6                    @base
ruby-rdoc.x86_64                    1.8.7.374-2.el6                    @base
ruby.x86_64                         1.8.7.374-2.el6                    @base
scl-utils.x86_64                    20120927-23.el6_6                  @updates
screen.x86_64                       4.0.3-16.el6                       @base
sed.x86_64                          4.2.1-10.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
selinux-policy.noarch               3.7.19-260.el6                     @base
selinux-policy-targeted.noarch      3.7.19-260.el6                     @base
setools-libs-python.x86_64          3.3.7-4.el6                        @base
setools-libs.x86_64                 3.3.7-4.el6                        @base
setserial.x86_64                    2.17-25.el6                        @base
setup.noarch                        2.8.14-20.el6_4.1                  @anaconda-CentOS-201311272149.x86_64/6.5
setuptool.x86_64                    1.19.9-4.el6                       @base
sg3_utils-libs.x86_64               1.28-6.el6                         @base
sgpio.x86_64                        1.2.0.10-5.el6                     @base
shadow-utils.x86_64                 2:4.1.4.2-19.el6                   @base
shared-mime-info.x86_64             0.70-6.el6                         @base
slang.x86_64                        2.2.1-1.el6                        @anaconda-CentOS-201311272149.x86_64/6.5
smartmontools.x86_64                1:5.43-1.el6                       @base
snappy.x86_64                       1.1.0-1.el6                        @base
sos.noarch                          2.2-68.el6.centos                  @base
sqlite.x86_64                       3.6.20-1.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
strace.x86_64                       4.5.19-1.19.el6                    @base

Subversion

subversion.x86_64                   1.6.11-10.el6_5                    @updates
sudo.x86_64                         1.8.6p3-15.el6                     @base
swig.x86_64                         1.3.40-6.el6                       @base
sysstat.x86_64                      9.0.4-27.el6                       @base
system-config-firewall-base.noarch  1.2.27-7.1.el6                     @base
system-config-firewall-tui.noarch   1.2.27-7.1.el6                     @base
system-config-network-tui.noarch    1.6.0.el6.2-1.el6                  @base
systemtap-client.x86_64             2.5-5.el6                          @base
systemtap-devel.x86_64              2.5-5.el6                          @base
systemtap-runtime.x86_64            2.5-5.el6                          @base
systemtap.x86_64                    2.5-5.el6                          @base
sysvinit-tools.x86_64               2.87-5.dsf.el6                     @anaconda-CentOS-201311272149.x86_64/6.5
tar.x86_64                          2:1.23-11.el6                      @anaconda-CentOS-201311272149.x86_64/6.5
tcpdump.x86_64                      14:4.0.0-3.20090921gitdf3cb4.2.el6 @base
tcp_wrappers-libs.x86_64            7.6-57.el6                         @anaconda-CentOS-201311272149.x86_64/6.5
tcp_wrappers.x86_64                 7.6-57.el6                         @base
tcsh.x86_64                         6.17-24.el6                        @base
telnet.x86_64                       1:0.17-48.el6                      @base
time.x86_64                         1.7-37.1.el6                       @base
tmpwatch.x86_64                     2.9.16-4.el6                       @base
tmux.x86_64                         1.6-3.el6                          @epel
traceroute.x86_64                   3:2.0.14-2.el6                     @base
tzdata.noarch                       2014i-1.el6                        @updates
udev.x86_64                         147-2.57.el6                       @base
unzip.x86_64                        6.0-1.el6                          @base
upstart.x86_64                      0.6.5-13.el6_5.3                   @updates
usbutils.x86_64                     003-4.el6                          @base
usermode.x86_64                     1.102-3.el6                        @base
ustr.x86_64                         1.0.4-9.1.el6                      @anaconda-CentOS-201311272149.x86_64/6.5
util-linux-ng.x86_64                2.17.2-12.18.el6                   @base
vconfig.x86_64                      1.9-8.1.el6                        @base
vim-common.x86_64                   2:7.2.411-1.8.el6                  @base
vim-enhanced.x86_64                 2:7.2.411-1.8.el6                  @base
vim-minimal.x86_64                  2:7.2.411-1.8.el6                  @anaconda-CentOS-201311272149.x86_64/6.5
virt-what.x86_64                    1.11-1.2.el6                       @base
wget.x86_64                         1.12-5.el6_6.1                     @updates
which.x86_64                        2.19-6.el6                         @anaconda-CentOS-201311272149.x86_64/6.5
wireless-tools.x86_64               1:29-5.1.1.el6                     @base
words.noarch                        3.0-17.el6                         @base
xdg-utils.noarch                    1.0.2-17.20091016cvs.el6           @base
xfsprogs.x86_64                     3.1.1-16.el6                       @base
xmlrpc-c-client.x86_64              1.16.24-1210.1840.el6              @base
xmlrpc-c.x86_64                     1.16.24-1210.1840.el6              @base
xorg-x11-drv-ati-firmware.noarch    7.3.99-2.el6                       @base
xz-libs.x86_64                      4.999.9-0.5.beta.20091007git.el6   @base
xz-lzma-compat.x86_64               4.999.9-0.5.beta.20091007git.el6   @base
xz.x86_64                           4.999.9-0.5.beta.20091007git.el6   @base
yum-metadata-parser.x86_64          1.1.2-16.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
yum.noarch                          3.2.29-60.el6.centos               @base
yum-plugin-fastestmirror.noarch     1.1.30-30.el6                      @base
yum-plugin-security.noarch          1.1.30-30.el6                      @base
yum-utils.noarch                    1.1.30-30.el6                      @base
zd1211-firmware.noarch              1.4-4.el6                          @base
zip.x86_64                          3.0-1.el6                          @base
zlib.x86_64                         1.2.3-29.el6                       @anaconda-CentOS-201311272149.x86_64/6.5
zsh.x86_64                          4.3.10-8.el6_5                     @updates

初期のリポジトリ

なんと epel が最初から入ってます。しかも enabled = 1 大胆ですね!

[root@v157-7-234-84 yum.repos.d]# ls -l
-rw-r--r--  1 root root 1991 Oct 23 20:41 CentOS-Base.repo
-rw-r--r--. 1 root root  509 Sep 26  2011 CentOS-CR.repo
-rw-r--r--  1 root root  647 Oct 23 20:41 CentOS-Debuginfo.repo
-rw-r--r--  1 root root  289 Oct 23 20:41 CentOS-fasttrack.repo
-rw-r--r--  1 root root  630 Oct 23 20:41 CentOS-Media.repo
-rw-r--r--  1 root root  453 May 29 16:56 CentOS-SCL.repo
-rw-r--r--  1 root root 5394 Oct 23 20:41 CentOS-Vault.repo
-rw-r--r--. 1 root root  957 Nov  5  2012 epel.repo
-rw-r--r--. 1 root root 1056 Nov  5  2012 epel-testing.repo

ユーザを追加する

ユーザを作成

useradd nakamuri
これで ユーザ nakamuri と グループ nakamuri が生成されます。
passwd nakamuri
でパスワードを設定します。

SSHの設定

  • 鍵を作成
TeraTerm の [設定]→[SSH鍵生成] で公開鍵と秘密鍵を作ります。RSA暗号を選び、パスフレーズも指定した方がよいでしょう。
  • 公開鍵の転送
公開鍵 *.pub ファイルをサーバにアップロードします。rootなどで接続した Teraterm があれば、端末画面にファイルを落とせばホームディレクトリに転送できます。
  • 公開鍵の設定
nakamuriでログインし公開鍵をセット(ここでは nakamuriのホームフォルダに公開鍵 id_rsa.pub があるとしています)
mkdir .ssh 
chmod 700 .ssh 
cat id_rsa.pub > .ssh/authorized_keys 
chmod 600 .ssh/authorized_keys 
rm -f id_rsa.pub

これで、nakamuri で ssh でログインできるようになります。パスフレーズを忘れないように。

  • WinSCP でのログイン
WinSCP では Terterm が生成した秘密(id_rsa)はそのままでは使えないので、付属の PuTTYGen というツールで ppk 形式に変換してください。これを指定すればつながります。

リポジトリのインストール

yum の epel、ius と remi リポジトリをインストールします。

epel のインストール

epel とは 先進系 RHEL系ディストリビューションFedraの RHEL 向けリポジトリ。既存のベースパッケージを置換せず、追加パッケージのみを供給します。 remi やius が依存しているのでより新しいパッケージを入れるなら必須のリポジトリです。

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6*.rpm

これは予想通り、すでにインストールされているとエラーが出てはじかれました。

iusのインストール

ius は CENTOSのコア部分の新しいパッケージを提供するリポジトリです。EPELに依存しています。今のところ全く使っていませんが、gitの新しいものはここにあるようです。

wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/ius-release-1.0-13.ius.centos6.noarch.rpm
rpm -Uvh ius-release*.rpm

remiのインストール

remi は phpのスタックをサポートするためのリポジトリ。MySQL や PHP の新しい版が手に入ります。ただし Apache は無いようです。

wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm 
rpm -Uvh remi-release-6*.rpm

有効フラグOFF

ius と remi は既定で enabled=1 になっているので /etc/yum.repos.d/ の *.repo ファイルを修正して off にしておくのがよいでしょう。 yum で --enablerepo=remi,ius などと指定すれば enable=0 でも yum は ius や remi を使用します。

epelは最初から enabled になっていて今更なので enabled=1 のままにしておきます。

yum repolist --enablerepo=remi,remi-php55,remi-php56,ius
repo id     repo name                                                     status
base        CentOS-6 - Base                                                6,518
cr          CentOS-6 - CR                                                      0
epel        Extra Packages for Enterprise Linux 6 - x86_64                11,148
extras      CentOS-6 - Extras                                                 15
ius         IUS Community Packages for Enterprise Linux 6 - x86_64           282
remi        Les RPM de remi pour Enterprise Linux 6 - x86_64               2,292
remi-php55  Les RPM de remi de PHP 5.5 pour Enterprise Linux 6 - x86_64      328
remi-php56  Les RPM de remi de PHP 5.6 pour Enterprise Linux 6 - x86_64      328
updates     CentOS-6 - Updates                                               209
repolist: 21,120

ファイアウォールの設定

/etc/sysconfig/iptables を以下のように編集します。 MYSQLやFTPは許可しない方針としました。いたってシンプル。

*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# SSH, HTTP
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
service iptables restart

httpdの有効化

apache は 2.2 のままで行く方針なのでそのまま有効化します。

service httpd start
chkconfig httpd on

MySQL5.5のインストールと設定

インストール

yum --enablerepo=remi install mysql mysql-server mysql-devel mysql-libs


====================================================================================================================================
 Package                               Arch                     Version                             Repository                 Size
====================================================================================================================================
Installing:
 mysql                                 x86_64                   5.5.40-1.el6.remi                   remi                      5.8 M
 mysql-devel                           x86_64                   5.5.40-1.el6.remi                   remi                      163 k
 mysql-server                          x86_64                   5.5.40-1.el6.remi                   remi                       10 M
Updating:
 mysql-libs                            x86_64                   5.5.40-1.el6.remi                   remi                      777 k
Installing for dependencies:

これは mysql5.1 のライブラリと 5.5 を共存させるために必要なものらしい。

 compat-mysql51                        x86_64                   5.1.54-1.el6.remi                   remi                      1.4 M
 keyutils-libs-devel                   x86_64                   1.4-5.el6                           base                       29 k
 krb5-devel                            x86_64                   1.10.3-33.el6                       base                      498 k
 libcom_err-devel                      x86_64                   1.41.12-21.el6                      base                       32 k
 libselinux-devel                      x86_64                   2.0.94-5.8.el6                      base                      137 k
 libsepol-devel                        x86_64                   2.0.41-4.el6                        base                       64 k
 openssl-devel                         x86_64                   1.0.1e-30.el6_6.2                   updates                   1.2 M
 perl-DBD-MySQL                        x86_64                   4.013-3.el6                         base                      134 k
 perl-DBI                              x86_64                   1.609-4.el6                         base                      705 k
 zlib-devel                            x86_64                   1.2.3-29.el6                        base                       44 k
[root]# yum --enablerepo=remi list installed | grep my
compat-mysql51.x86_64               5.1.54-1.el6.remi                  @remi
mysql.x86_64                        5.5.40-1.el6.remi                  @remi
mysql-devel.x86_64                  5.5.40-1.el6.remi                  @remi
mysql-libs.x86_64                   5.5.40-1.el6.remi                  @remi
mysql-server.x86_64                 5.5.40-1.el6.remi                  @remi

5.5-35以上を要求するソフトがあるようなので、これは満足な結果といえます。

キャラクタセットの既定値を全て UTF-8に設定

/etc/my.cnf を修正

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used (fedora >= 15).
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mysqld according to the
# instructions in http://fedoraproject.org/wiki/Systemd
user=mysql

# Semisynchronous Replication
# http://dev.mysql.com/doc/refman/5.5/en/replication-semisync.html
# uncomment next line on MASTER
;plugin-load=rpl_semi_sync_master=semisync_master.so
# uncomment next line on SLAVE
;plugin-load=rpl_semi_sync_slave=semisync_slave.so

# Others options for Semisynchronous Replication
;rpl_semi_sync_master_enabled=1
;rpl_semi_sync_master_timeout=10
;rpl_semi_sync_slave_enabled=1

# http://dev.mysql.com/doc/refman/5.5/en/performance-schema.html
;performance_schema

[mysqld]セクションにこれを追加

character-set-server = utf8
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

以下2セクション追加

[client]
default-character-set = utf8
[mysqldump]
default-character-set = utf8
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d

ようするにキャラクタセットの既定値を全部 UTF-8にしているだけです。

サービス開始

service mysqld start
Initializing MySQL database:  Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h v157-7-234-84.z1d6.static.cnode.jp password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

                                                           [  OK  ]
Starting mysqld:                                           [  OK  ]

自動起動設定

chkconfig mysqld on

mysql_secure_installationを実施する

これは MySQL 起動後に行う初期設定です。対話形式で MySQL の初期設定を行います。

[root]# mysql_secure_installation


NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!


In order to log into MySQL to secure it, we'll need the current
password for the root user.  If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

この段階では root パスワードは未設定なので [ENTER]

Enter current password for root (enter for none):
OK, successfully used password, moving on... 
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

もちろんrootパスワードを設定する

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

匿名ユーザーは削除

Remove anonymous users? [Y/n] y
 ... Success!
Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

rootのlocalhost以外からのアクセスは禁止

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MySQL comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

テストデータベースの削除

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...


All done!  If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

phpのインストールと設定

php5.3 の削除

yum remove php-*
====================================================================================================================================
Package                        Arch                       Version                               Repository                    Size
====================================================================================================================================
Removing:
 php                            x86_64                     5.3.3-40.el6_6                        @updates                     3.5 M
 php-cli                        x86_64                     5.3.3-40.el6_6                        @updates                     6.2 M
 php-common                     x86_64                     5.3.3-40.el6_6                        @updates                     2.9 M
 php-gd                         x86_64                     5.3.3-40.el6_6                        @updates                     324 k
 php-pdo                        x86_64                     5.3.3-40.el6_6                        @updates                     168 k
 php-pear                       noarch                     1:1.9.4-4.el6                         @base                        2.2 M
 php-xml                        x86_64                     5.3.3-40.el6_6                        @updates                     307 k

Transaction Summary
====================================================================================================================================
Remove        7 Package(s)

gdのインストール

何故か php より先にgdを入れないと php5.6 のインストールが失敗してしまいます。そこで gd を先に入れます。

yum install gd-last --enablerepo=remi
====================================================================================================================================
 Package                       Arch                         Version                                Repository                  Size
====================================================================================================================================
Installing:
 gd-last                       x86_64                       2.1.0-3.el6.remi                       remi                       134 k
Installing for dependencies:
 libvpx                        x86_64                       1.3.0-5.el6_5                          base                       486 k

Transaction Summary
====================================================================================================================================
Install       2 Package(s)

php5.6 をインストール

remi-php56 を指定することに注意!

yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof


====================================================================================================================================
 Package                                    Arch               Version                                 Repository              Size
====================================================================================================================================
Installing:
 php                                        x86_64             5.6.2-1.el6.remi                        remi-php56             2.6 M
 php-devel                                  x86_64             5.6.2-1.el6.remi                        remi-php56             1.2 M
 php-mbstring                               x86_64             5.6.2-1.el6.remi                        remi-php56             961 k
 php-mcrypt                                 x86_64             5.6.2-1.el6.remi                        remi-php56              43 k
 php-mysqlnd                                x86_64             5.6.2-1.el6.remi                        remi-php56             3.7 M
 php-opcache                                x86_64             5.6.2-1.el6.remi                        remi-php56             117 k
 php-pecl-xdebug                            x86_64             2.2.5-1.el6.remi.5.6                    remi-php56             164 k
 php-pecl-xhprof                            x86_64             0.9.4-4.el6.remi.5.6                    remi-php56              27 k
 php-phpunit-PHPUnit                        noarch             4.3.4-1.el6.remi                        remi                   129 k
Installing for dependencies:
 libmcrypt                                  x86_64             2.5.8-9.el6                             epel                    96 k
 libtidy                                    x86_64             0.99.0-19.20070615.1.el6                base                   127 k
 libtool-ltdl                               x86_64             2.2.6-15.5.el6                          base                    44 k
 php-cli                                    x86_64             5.6.2-1.el6.remi                        remi-php56             3.7 M
 php-common                                 x86_64             5.6.2-1.el6.remi                        remi-php56             1.0 M
 php-doctrine-instantiator                  noarch             1.0.3-1.el6.remi                        remi                   9.4 k
 php-pdo                                    x86_64             5.6.2-1.el6.remi                        remi-php56             112 k
 php-pear                                   noarch             1:1.9.5-3.el6.remi                      remi                   375 k
 php-pecl-jsonc                             x86_64             1.3.6-1.el6.remi.5.6.1                  remi-php56              47 k
 php-pecl-jsonc-devel                       x86_64             1.3.6-1.el6.remi.5.6.1                  remi-php56              25 k
 php-pecl-zip                               x86_64             1.12.4-2.el6.remi.5.6                   remi-php56             269 k
 php-phpunit-File-Iterator                  noarch             1.3.4-5.el6.remi                        remi                    11 k
 php-phpunit-PHP-CodeCoverage               noarch             2.0.11-1.el6.remi                       remi                   273 k
 php-phpunit-PHP-Invoker                    noarch             1.1.3-6.el6.remi                        remi                   8.2 k
 php-phpunit-PHP-Timer                      noarch             1.0.5-5.el6.remi                        remi                   7.3 k
 php-phpunit-PHP-TokenStream                noarch             1.3.0-1.el6.remi                        remi                    14 k
 php-phpunit-PHPUnit-MockObject             noarch             2.3.0-1.el6.remi                        remi                    36 k
 php-phpunit-Text-Template                  noarch             1.2.0-4.el6.remi                        remi                   8.4 k
 php-phpunit-Version                        noarch             1.0.3-3.el6.remi                        remi                   7.5 k
 php-phpunit-comparator                     noarch             1.0.1-1.el6.remi                        remi                    13 k
 php-phpunit-diff                           noarch             1.2.0-1.el6.remi                        remi                    12 k
 php-phpunit-environment                    noarch             1.2.0-1.el6.remi                        remi                   7.7 k
 php-phpunit-exporter                       noarch             1.0.2-1.el6.remi                        remi                   9.9 k
 php-process                                x86_64             5.6.2-1.el6.remi                        remi-php56              57 k
 php-soap                                   x86_64             5.6.2-1.el6.remi                        remi-php56             213 k
 php-symfony-class-loader                   noarch             2.5.5-1.el6.remi                        remi                    20 k
 php-symfony-common                         noarch             2.5.5-1.el6.remi                        remi                    69 k
 php-symfony-yaml                           noarch             2.5.5-1.el6.remi                        remi                    21 k
 php-tidy                                   x86_64             5.6.2-1.el6.remi                        remi-php56              47 k
 php-xml                                    x86_64             5.6.2-1.el6.remi                        remi-php56             209 k

バージョン確認

php -v
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
    with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans


php.ini の調整

php5.6 では基本的に utf-8 で動くので特にエンコーディングに関して設定は不要。

mbstring.language = Japanese のみ設定してます。また、必要に応じで error_log の設定も有用だと思います。

動作確認

DocumentRootに index.php を置いてアクセス。

中身はこれ

<?php
  phpinfo();
?>

まとめ

以上の作業の後、MediaWikiやより条件の厳しい Subversion Edge をインストールして、無事正常に動作しました。 この手順で大きな問題はないようです。