2018年5月4日金曜日

herokuメンテナンスページの設定による任意サイトへのリダイレクトと注意点

herokuにはメンテナンスページを設定できる機能がある。(2018年5月4日 確認)
herokuのアプリを起動した状態から任意のページに転送できる。
外部サイトのURLでも動作した。
動作としては一度、herokuで作成したページが表示された後に転送される。

コマンドライン上から簡単に設定できる。
MAINTENANCE_PAGE_URLというheroku上の環境変数を設定するだけで済む。

設定前に環境変数を事前に確認すると良い。
heroku config --app 【アプリ名】

$ heroku config -a trial-misrecognition
=== 【アプリ名】 Config Vars
DATABASE_URL:             postgres://ooerqfdjfubrmy:@【ホスト名】.compute-1.amazonaws.com:5432/
LANG:                     en_US.UTF-8
RACK_ENV:                 production
RAILS_ENV:                production
RAILS_SERVE_STATIC_FILES: enabled
SECRET_KEY_BASE:          【シークレットキー】
MAINTENANCE_PAGE_URLの設定は以下の様な書式となる。
heroku config:set MAINTENANCE_PAGE_URL=用意したページのURL --app 【アプリ名】

$ heroku config:set MAINTENANCE_PAGE_URL=【URL】 --app 【アプリ名】
Setting MAINTENANCE_PAGE_URL and restarting ⬢ 【アプリ名】... done, v【バージョン番号】
MAINTENANCE_PAGE_URL: 【URL】
設定後、再度 heroku config --app 【アプリ名】から確認する。

$ heroku config -a trial-misrecognition
=== 【アプリ名】 Config Vars
DATABASE_URL:             postgres://【ユーザ名】:@【ホスト名】.compute-1.amazonaws.com:5432/
LANG:                     en_US.UTF-8
MAINTENANCE_PAGE_URL:     【URL】
RACK_ENV:                 production
RAILS_ENV:                production
RAILS_SERVE_STATIC_FILES: enabled
SECRET_KEY_BASE:          【シークレットキー】
MAINTENANCE_PAGE_URLが表示されて設定されている事がわかる。

メンテナンスモードという設定とは関連性が理解できなかった。
以下コマンドで確認してもoffという表示となる。
# heroku maintenance -a 【アプリ名】
off

また、コントロールパネル上以下の様に表示されているが、MAINTENANCE_PAGE_URLへのリダイレクトは有効となっているので、注意する必要がある。
参考としたURL https://www.tam-tam.co.jp/tipsnote/program/post14102.html http://info-i.net/heroku-maintainance

2018年5月1日火曜日

ロリポップマネージドクラウド備忘録2 環境構築

ロリポップマネージドクラウドはubuntuベースのコンテナとなっている。

$ uname -a
Linux gitpush-ruby-damp-ebino-4504.lolipop.io-7e078f8235 4.4.0-119-generic #143-Ubuntu SMP Mon Apr 2 16:08:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
よって手元の開発環境もできればubuntuで準備した方が望ましいだろう。
ただubuntuであれば使い慣れていない、頻繁なアップデートがあっていちいちマネージドクラウドとバージョンを合わせないといけない等の煩わしさが伴う。
そこで少しでも多くの開発環境の選択があった方が望ましいと考えてCentOS7を用意した。
厳密にはcentos-release-7-3.1611.el7.centos.x86_64での開発環境構築となる。

# rpm -qa centos-release
centos-release-7-3.1611.el7.centos.x86_64
epelとsclでの構成として以下rpmをインストールした。

GeoIP-1.5.0-11.el7.x86_64
NetworkManager-1.4.0-12.el7.x86_64
NetworkManager-libnm-1.4.0-12.el7.x86_64
NetworkManager-team-1.4.0-12.el7.x86_64
NetworkManager-tui-1.4.0-12.el7.x86_64
NetworkManager-wifi-1.4.0-12.el7.x86_64
acl-2.2.51-12.el7.x86_64
aic94xx-firmware-30-6.el7.noarch
alsa-firmware-1.0.28-2.el7.noarch
alsa-lib-1.1.1-1.el7.x86_64
alsa-tools-firmware-1.1.0-1.el7.x86_64
audit-2.6.5-3.el7.x86_64
audit-libs-2.6.5-3.el7.x86_64
audit-libs-python-2.6.5-3.el7.x86_64
authconfig-6.2.8-14.el7.x86_64
autoconf-2.69-11.el7.noarch
automake-1.13.4-3.el7.noarch
basesystem-10.0-7.el7.centos.noarch
bash-4.2.46-20.el7_2.x86_64
bind-libs-lite-9.9.4-37.el7.x86_64
bind-license-9.9.4-37.el7.noarch
binutils-2.25.1-22.base.el7.x86_64
biosdevname-0.7.2-1.el7.x86_64
btrfs-progs-4.4.1-1.el7.x86_64
bzip2-libs-1.0.6-13.el7.x86_64
ca-certificates-2015.2.6-73.el7.noarch
centos-logos-70.0.6-3.el7.centos.noarch
centos-release-7-3.1611.el7.centos.x86_64
centos-release-scl-2-2.el7.centos.noarch
centos-release-scl-rh-2-2.el7.centos.noarch
checkpolicy-2.5-4.el7.x86_64
chkconfig-1.7.2-1.el7.x86_64
chrony-2.1.1-3.el7.centos.x86_64
coreutils-8.22-18.el7.x86_64
cpio-2.11-24.el7.x86_64
cpp-4.8.5-11.el7.x86_64
cracklib-2.9.0-11.el7.x86_64
cracklib-dicts-2.9.0-11.el7.x86_64
cronie-1.4.11-14.el7_2.1.x86_64
cronie-anacron-1.4.11-14.el7_2.1.x86_64
crontabs-1.11-6.20121102git.el7.noarch
cryptsetup-libs-1.7.2-1.el7.x86_64
curl-7.29.0-35.el7.centos.x86_64
cyrus-sasl-lib-2.1.26-20.el7_2.x86_64
dbus-1.6.12-17.el7.x86_64
dbus-glib-0.100-7.el7.x86_64
dbus-libs-1.6.12-17.el7.x86_64
dbus-python-1.1.1-9.el7.x86_64
device-mapper-1.02.135-1.el7.x86_64
device-mapper-event-1.02.135-1.el7.x86_64
device-mapper-event-libs-1.02.135-1.el7.x86_64
device-mapper-libs-1.02.135-1.el7.x86_64
device-mapper-persistent-data-0.6.3-1.el7.x86_64
dhclient-4.2.5-47.el7.centos.x86_64
dhcp-common-4.2.5-47.el7.centos.x86_64
dhcp-libs-4.2.5-47.el7.centos.x86_64
diffutils-3.3-4.el7.x86_64
dmidecode-3.0-2.el7.x86_64
dnsmasq-2.66-21.el7.x86_64
dracut-033-463.el7.x86_64
dracut-config-rescue-033-463.el7.x86_64
dracut-network-033-463.el7.x86_64
e2fsprogs-1.42.9-10.el7.x86_64
e2fsprogs-libs-1.42.9-10.el7.x86_64
ebtables-2.0.10-15.el7.x86_64
elfutils-libelf-0.166-2.el7.x86_64
elfutils-libs-0.166-2.el7.x86_64
epel-release-7-9.noarch
ethtool-4.5-3.el7.x86_64
expat-2.1.0-8.el7.x86_64
file-5.11-33.el7.x86_64
file-libs-5.11-33.el7.x86_64
filesystem-3.2-21.el7.x86_64
findutils-4.5.11-5.el7.x86_64
fipscheck-1.4.1-5.el7.x86_64
fipscheck-lib-1.4.1-5.el7.x86_64
firewalld-0.4.3.2-8.el7.noarch
firewalld-filesystem-0.4.3.2-8.el7.noarch
fontconfig-2.10.95-10.el7.x86_64
fontpackages-filesystem-1.44-8.el7.noarch
freetype-2.4.11-12.el7.x86_64
fxload-2002_04_11-16.el7.x86_64
gawk-4.0.2-4.el7.x86_64
gcc-4.8.5-11.el7.x86_64
gcc-c++-4.8.5-11.el7.x86_64
gd-2.0.35-26.el7.x86_64
gdbm-1.10-8.el7.x86_64
gettext-0.18.2.1-4.el7.x86_64
gettext-libs-0.18.2.1-4.el7.x86_64
git-1.8.3.1-6.el7_2.1.x86_64
glib-networking-2.42.0-1.el7.x86_64
glib2-2.46.2-4.el7.x86_64
glibc-2.17-157.el7.x86_64
glibc-common-2.17-157.el7.x86_64
glibc-devel-2.17-157.el7.x86_64
glibc-headers-2.17-157.el7.x86_64
gmp-6.0.0-12.el7_1.x86_64
gnupg2-2.0.22-4.el7.x86_64
gnutls-3.3.24-1.el7.x86_64
gobject-introspection-1.42.0-1.el7.x86_64
gperftools-libs-2.4-8.el7.x86_64
gpg-pubkey-352c64e5-52ae6884
gpg-pubkey-f2ee9d55-560cfc0a
gpg-pubkey-f4a80eb5-53a7ff4b
gpgme-1.3.2-5.el7.x86_64
gpm-libs-1.20.7-5.el7.x86_64
grep-2.20-2.el7.x86_64
groff-base-1.22.2-8.el7.x86_64
grub2-2.02-0.44.el7.centos.x86_64
grub2-tools-2.02-0.44.el7.centos.x86_64
grubby-8.28-18.el7.x86_64
gsettings-desktop-schemas-3.14.2-1.el7.x86_64
gzip-1.5-8.el7.x86_64
hardlink-1.0-19.el7.x86_64
hostname-3.13-3.el7.x86_64
hwdata-0.252-8.4.el7.x86_64
info-5.1-4.el7.x86_64
initscripts-9.49.37-1.el7.x86_64
iproute-3.10.0-74.el7.x86_64
iprutils-2.4.13.1-1.el7.x86_64
ipset-6.19-6.el7.x86_64
ipset-libs-6.19-6.el7.x86_64
iptables-1.4.21-17.el7.x86_64
iputils-20160308-8.el7.x86_64
irqbalance-1.0.7-6.el7.x86_64
ivtv-firmware-20080701-26.el7.noarch
iwl100-firmware-39.31.5.1-49.el7.noarch
iwl1000-firmware-39.31.5.1-49.el7.noarch
iwl105-firmware-18.168.6.1-49.el7.noarch
iwl135-firmware-18.168.6.1-49.el7.noarch
iwl2000-firmware-18.168.6.1-49.el7.noarch
iwl2030-firmware-18.168.6.1-49.el7.noarch
iwl3160-firmware-22.0.7.0-49.el7.noarch
iwl3945-firmware-15.32.2.9-49.el7.noarch
iwl4965-firmware-228.61.2.24-49.el7.noarch
iwl5000-firmware-8.83.5.1_1-49.el7.noarch
iwl5150-firmware-8.24.2.2-49.el7.noarch
iwl6000-firmware-9.221.4.1-49.el7.noarch
iwl6000g2a-firmware-17.168.5.3-49.el7.noarch
iwl6000g2b-firmware-17.168.5.2-49.el7.noarch
iwl6050-firmware-41.28.5.1-49.el7.noarch
iwl7260-firmware-22.0.7.0-49.el7.noarch
iwl7265-firmware-22.0.7.0-49.el7.noarch
jansson-2.4-6.el7.x86_64
json-c-0.11-4.el7_0.x86_64
kbd-1.15.5-12.el7.x86_64
kbd-legacy-1.15.5-12.el7.noarch
kbd-misc-1.15.5-12.el7.noarch
kernel-3.10.0-514.el7.x86_64
kernel-headers-3.10.0-514.el7.x86_64
kernel-tools-3.10.0-514.el7.x86_64
kernel-tools-libs-3.10.0-514.el7.x86_64
kexec-tools-2.0.7-50.el7.x86_64
keyutils-libs-1.5.8-3.el7.x86_64
keyutils-libs-devel-1.5.8-3.el7.x86_64
kmod-20-9.el7.x86_64
kmod-libs-20-9.el7.x86_64
kpartx-0.4.9-99.el7.x86_64
krb5-devel-1.15.1-8.el7.x86_64
krb5-libs-1.15.1-8.el7.x86_64
less-458-9.el7.x86_64
libX11-1.6.3-3.el7.x86_64
libX11-common-1.6.3-3.el7.noarch
libXau-1.0.8-2.1.el7.x86_64
libXpm-3.5.11-3.el7.x86_64
libacl-2.2.51-12.el7.x86_64
libaio-0.3.109-13.el7.x86_64
libassuan-2.1.0-3.el7.x86_64
libattr-2.4.46-12.el7.x86_64
libblkid-2.23.2-33.el7.x86_64
libcap-2.22-8.el7.x86_64
libcap-ng-0.7.5-4.el7.x86_64
libcgroup-0.41-11.el7.x86_64
libcom_err-1.42.9-10.el7.x86_64
libcom_err-devel-1.42.9-10.el7.x86_64
libcroco-0.6.8-5.el7.x86_64
libcurl-7.29.0-35.el7.centos.x86_64
libdaemon-0.14-7.el7.x86_64
libdb-5.3.21-19.el7.x86_64
libdb-utils-5.3.21-19.el7.x86_64
libdrm-2.4.67-3.el7.x86_64
libedit-3.0-12.20121213cvs.el7.x86_64
libestr-0.1.9-2.el7.x86_64
libevent-2.0.21-4.el7.x86_64
libffi-3.0.13-18.el7.x86_64
libffi-devel-3.0.13-18.el7.x86_64
libgcc-4.8.5-11.el7.x86_64
libgcrypt-1.5.3-12.el7_1.1.x86_64
libgnome-keyring-3.8.0-3.el7.x86_64
libgomp-4.8.5-11.el7.x86_64
libgpg-error-1.12-3.el7.x86_64
libgudev1-219-30.el7.x86_64
libicu-50.1.2-15.el7.x86_64
libidn-1.28-4.el7.x86_64
libjpeg-turbo-1.2.90-5.el7.x86_64
libkadm5-1.15.1-8.el7.x86_64
libmnl-1.0.3-7.el7.x86_64
libmodman-2.0.1-8.el7.x86_64
libmount-2.23.2-33.el7.x86_64
libmpc-1.0.1-3.el7.x86_64
libndp-1.2-7.el7.x86_64
libnetfilter_conntrack-1.0.4-2.el7.x86_64
libnfnetlink-1.0.1-4.el7.x86_64
libnl3-3.2.28-2.el7.x86_64
libnl3-cli-3.2.28-2.el7.x86_64
libpcap-1.5.3-8.el7.x86_64
libpciaccess-0.13.4-2.el7.x86_64
libpipeline-1.2.3-3.el7.x86_64
libpng-1.5.13-7.el7_2.x86_64
libproxy-0.4.11-10.el7.x86_64
libpwquality-1.2.3-4.el7.x86_64
libselinux-2.5-11.el7.x86_64
libselinux-devel-2.5-11.el7.x86_64
libselinux-python-2.5-11.el7.x86_64
libselinux-utils-2.5-11.el7.x86_64
libsemanage-2.5-4.el7.x86_64
libsemanage-python-2.5-4.el7.x86_64
libsepol-2.5-6.el7.x86_64
libsepol-devel-2.5-6.el7.x86_64
libsoup-2.48.1-6.el7.x86_64
libss-1.42.9-10.el7.x86_64
libssh2-1.4.3-10.el7_2.1.x86_64
libstdc++-4.8.5-11.el7.x86_64
libstdc++-devel-4.8.5-11.el7.x86_64
libsysfs-2.1.0-16.el7.x86_64
libtasn1-3.8-3.el7.x86_64
libteam-1.25-4.el7.x86_64
libunistring-0.9.3-9.el7.x86_64
libunwind-1.1-5.el7_2.2.x86_64
libuser-0.60-7.el7_1.x86_64
libutempter-1.1.6-4.el7.x86_64
libuuid-2.23.2-33.el7.x86_64
libuv-1.10.2-1.el7.x86_64
libverto-0.2.5-4.el7.x86_64
libverto-devel-0.2.5-4.el7.x86_64
libxcb-1.11-4.el7.x86_64
libxml2-2.9.1-6.el7_2.3.x86_64
libxslt-1.1.28-5.el7.x86_64
libyaml-0.1.4-11.el7_0.x86_64
linux-firmware-20160830-49.git7534e19.el7.noarch
logrotate-3.8.6-12.el7.x86_64
lsscsi-0.27-4.el7.x86_64
lua-5.1.4-15.el7.x86_64
lvm2-2.02.166-1.el7.x86_64
lvm2-libs-2.02.166-1.el7.x86_64
lzo-2.06-8.el7.x86_64
m4-1.4.16-10.el7.x86_64
make-3.82-23.el7.x86_64
man-db-2.6.3-9.el7.x86_64
microcode_ctl-2.1-16.el7.x86_64
mozjs17-17.0.0-19.el7.x86_64
mpfr-3.1.1-4.el7.x86_64
mysql-community-client-5.7.21-1.el7.x86_64
mysql-community-common-5.7.21-1.el7.x86_64
mysql-community-devel-5.7.21-1.el7.x86_64
mysql-community-libs-5.7.21-1.el7.x86_64
mysql-community-libs-compat-5.7.21-1.el7.x86_64
mysql-community-server-5.7.21-1.el7.x86_64
ncurses-5.9-13.20130511.el7.x86_64
ncurses-base-5.9-13.20130511.el7.noarch
ncurses-libs-5.9-13.20130511.el7.x86_64
net-tools-2.0-0.22.20131004git.el7.x86_64
nettle-2.7.1-8.el7.x86_64
newt-0.52.15-4.el7.x86_64
newt-python-0.52.15-4.el7.x86_64
nginx-1.10.2-1.el7.x86_64
nginx-all-modules-1.10.2-1.el7.noarch
nginx-filesystem-1.10.2-1.el7.noarch
nginx-mod-http-geoip-1.10.2-1.el7.x86_64
nginx-mod-http-image-filter-1.10.2-1.el7.x86_64
nginx-mod-http-perl-1.10.2-1.el7.x86_64
nginx-mod-http-xslt-filter-1.10.2-1.el7.x86_64
nginx-mod-mail-1.10.2-1.el7.x86_64
nginx-mod-stream-1.10.2-1.el7.x86_64
nodejs-6.10.1-2.el7.x86_64
npm-3.10.10-1.6.10.1.2.el7.x86_64
nspr-4.11.0-1.el7_2.x86_64
nss-3.21.0-17.el7.x86_64
nss-softokn-3.16.2.3-14.4.el7.x86_64
nss-softokn-freebl-3.16.2.3-14.4.el7.x86_64
nss-sysinit-3.21.0-17.el7.x86_64
nss-tools-3.21.0-17.el7.x86_64
nss-util-3.21.0-2.2.el7_2.x86_64
numactl-libs-2.0.9-6.el7_2.x86_64
openldap-2.4.40-13.el7.x86_64
openssh-6.6.1p1-31.el7.x86_64
openssh-clients-6.6.1p1-31.el7.x86_64
openssh-server-6.6.1p1-31.el7.x86_64
openssl-1.0.2k-8.el7.x86_64
openssl-devel-1.0.2k-8.el7.x86_64
openssl-libs-1.0.2k-8.el7.x86_64
os-prober-1.58-9.el7.x86_64
p11-kit-0.20.7-3.el7.x86_64
p11-kit-trust-0.20.7-3.el7.x86_64
pam-1.1.8-18.el7.x86_64
parted-3.1-28.el7.x86_64
passwd-0.79-4.el7.x86_64
pciutils-3.5.1-1.el7.x86_64
pciutils-libs-3.5.1-1.el7.x86_64
pcre-8.32-17.el7.x86_64
pcre-devel-8.32-17.el7.x86_64
perl-5.16.3-291.el7.x86_64
perl-Carp-1.26-244.el7.noarch
perl-Data-Dumper-2.145-3.el7.x86_64
perl-Encode-2.51-7.el7.x86_64
perl-Error-0.17020-2.el7.noarch
perl-Exporter-5.68-3.el7.noarch
perl-File-Path-2.09-2.el7.noarch
perl-File-Temp-0.23.01-3.el7.noarch
perl-Filter-1.49-3.el7.x86_64
perl-Getopt-Long-2.40-2.el7.noarch
perl-Git-1.8.3.1-6.el7_2.1.noarch
perl-HTTP-Tiny-0.033-3.el7.noarch
perl-PathTools-3.40-5.el7.x86_64
perl-Pod-Escapes-1.04-291.el7.noarch
perl-Pod-Perldoc-3.20-4.el7.noarch
perl-Pod-Simple-3.28-4.el7.noarch
perl-Pod-Usage-1.63-3.el7.noarch
perl-Scalar-List-Utils-1.27-248.el7.x86_64
perl-Socket-2.010-4.el7.x86_64
perl-Storable-2.45-3.el7.x86_64
perl-TermReadKey-2.30-20.el7.x86_64
perl-Test-Harness-3.28-3.el7.noarch
perl-Text-ParseWords-3.29-4.el7.noarch
perl-Thread-Queue-3.02-2.el7.noarch
perl-Time-HiRes-1.9725-3.el7.x86_64
perl-Time-Local-1.2300-2.el7.noarch
perl-constant-1.27-2.el7.noarch
perl-libs-5.16.3-291.el7.x86_64
perl-macros-5.16.3-291.el7.x86_64
perl-parent-0.225-244.el7.noarch
perl-podlators-2.5.1-3.el7.noarch
perl-threads-1.87-4.el7.x86_64
perl-threads-shared-1.43-6.el7.x86_64
pinentry-0.8.1-17.el7.x86_64
pkgconfig-0.27.1-4.el7.x86_64
plymouth-0.8.9-0.26.20140113.el7.centos.x86_64
plymouth-core-libs-0.8.9-0.26.20140113.el7.centos.x86_64
plymouth-scripts-0.8.9-0.26.20140113.el7.centos.x86_64
policycoreutils-2.5-8.el7.x86_64
policycoreutils-python-2.5-8.el7.x86_64
polkit-0.112-9.el7.x86_64
polkit-pkla-compat-0.1-4.el7.x86_64
popt-1.13-16.el7.x86_64
postfix-2.10.1-6.el7.x86_64
postgresql-9.2.21-1.el7.x86_64
postgresql-contrib-9.2.21-1.el7.x86_64
postgresql-devel-9.2.21-1.el7.x86_64
postgresql-libs-9.2.21-1.el7.x86_64
postgresql-server-9.2.21-1.el7.x86_64
ppp-2.4.5-33.el7.x86_64
procps-ng-3.3.10-10.el7.x86_64
pth-2.0.7-23.el7.x86_64
pygobject3-base-3.14.0-3.el7.x86_64
pygpgme-0.3-9.el7.x86_64
pyliblzma-0.5.3-11.el7.x86_64
python-2.7.5-48.el7.x86_64
python-IPy-0.75-6.el7.noarch
python-configobj-4.7.2-7.el7.noarch
python-decorator-3.4.0-3.el7.noarch
python-firewall-0.4.3.2-8.el7.noarch
python-iniparse-0.4-9.el7.noarch
python-libs-2.7.5-48.el7.x86_64
python-perf-3.10.0-514.el7.x86_64
python-pycurl-7.19.0-19.el7.x86_64
python-pyudev-0.15-7.el7_2.1.noarch
python-slip-0.4.0-2.el7.noarch
python-slip-dbus-0.4.0-2.el7.noarch
python-urlgrabber-3.10-8.el7.noarch
pyxattr-0.5.1-5.el7.x86_64
qrencode-libs-3.4.1-3.el7.x86_64
rdma-7.3_4.7_rc2-5.el7.noarch
readline-6.2-9.el7.x86_64
rh-ror42-rubygem-actionmailer-4.2.6-1.el7.noarch
rh-ror42-rubygem-actionpack-4.2.6-3.el7.noarch
rh-ror42-rubygem-actionview-4.2.6-3.el7.noarch
rh-ror42-rubygem-activejob-4.2.6-1.el7.noarch
rh-ror42-rubygem-activemodel-4.2.6-1.el7.noarch
rh-ror42-rubygem-activerecord-4.2.6-3.el7.noarch
rh-ror42-rubygem-activesupport-4.2.6-1.el7.noarch
rh-ror42-rubygem-arel-6.0.3-3.el7.noarch
rh-ror42-rubygem-builder-3.2.2-7.el7.noarch
rh-ror42-rubygem-erubis-2.7.0-15.el7.noarch
rh-ror42-rubygem-globalid-0.3.3-4.el7.noarch
rh-ror42-rubygem-i18n-0.7.0-4.el7.noarch
rh-ror42-rubygem-loofah-2.0.3-3.el7.noarch
rh-ror42-rubygem-mail-2.6.3-4.el7.noarch
rh-ror42-rubygem-mime-types-1.25.1-4.el7.noarch
rh-ror42-rubygem-nokogiri-1.6.7.2-2.el7.x86_64
rh-ror42-rubygem-rack-1.6.2-3.el7.noarch
rh-ror42-rubygem-rack-test-0.6.3-4.el7.noarch
rh-ror42-rubygem-rails-4.2.6-1.el7.noarch
rh-ror42-rubygem-rails-deprecated_sanitizer-1.0.3-6.el7.noarch
rh-ror42-rubygem-rails-dom-testing-1.0.5-4.el7.noarch
rh-ror42-rubygem-rails-html-sanitizer-1.0.3-3.el7.noarch
rh-ror42-rubygem-railties-4.2.6-3.el7.noarch
rh-ror42-rubygem-sprockets-3.2.0-4.el7.noarch
rh-ror42-rubygem-sprockets-rails-2.3.2-3.el7.noarch
rh-ror42-rubygem-thor-0.19.1-6.el7.noarch
rh-ror42-rubygem-thread_safe-0.3.5-5.el7.noarch
rh-ror42-rubygem-tzinfo-1.2.2-5.el7.noarch
rh-ror42-runtime-2.2-7.el7.x86_64
rh-ror50-rubygem-actioncable-5.0.1-1.el7.noarch
rh-ror50-rubygem-actionmailer-5.0.1-1.el7.noarch
rh-ror50-rubygem-actionpack-5.0.1-1.el7.noarch
rh-ror50-rubygem-actionview-5.0.1-3.el7.noarch
rh-ror50-rubygem-activejob-5.0.1-1.el7.noarch
rh-ror50-rubygem-activemodel-5.0.1-1.el7.noarch
rh-ror50-rubygem-activerecord-5.0.1-4.el7.noarch
rh-ror50-rubygem-activesupport-5.0.1-3.el7.noarch
rh-ror50-rubygem-arel-7.1.4-1.el7.noarch
rh-ror50-rubygem-builder-3.2.3-1.el7.noarch
rh-ror50-rubygem-concurrent-ruby-1.0.4-1.el7.noarch
rh-ror50-rubygem-erubis-2.7.0-17.el7.noarch
rh-ror50-rubygem-globalid-0.3.6-2.el7.noarch
rh-ror50-rubygem-i18n-0.7.0-5.el7.noarch
rh-ror50-rubygem-loofah-2.0.3-3.el7.noarch
rh-ror50-rubygem-mail-2.6.4-2.el7.noarch
rh-ror50-rubygem-method_source-0.8.2-4.el7.noarch
rh-ror50-rubygem-mime-types-3.1-1.el7.noarch
rh-ror50-rubygem-mime-types-data-3.2016.0521-1.el7.noarch
rh-ror50-rubygem-nio4r-1.2.1-3.el7.x86_64
rh-ror50-rubygem-nokogiri-1.7.0.1-1.el7.x86_64
rh-ror50-rubygem-rack-2.0.1-1.el7.noarch
rh-ror50-rubygem-rack-cache-1.6.1-1.el7.noarch
rh-ror50-rubygem-rack-test-0.6.3-5.el7.noarch
rh-ror50-rubygem-rails-5.0.1-1.el7.noarch
rh-ror50-rubygem-rails-dom-testing-2.0.2-1.el7.noarch
rh-ror50-rubygem-rails-html-sanitizer-1.0.3-4.el7.noarch
rh-ror50-rubygem-railties-5.0.1-4.el7.noarch
rh-ror50-rubygem-sprockets-3.7.1-1.el7.noarch
rh-ror50-rubygem-sprockets-rails-3.2.0-3.el7.noarch
rh-ror50-rubygem-thor-0.19.1-8.el7.noarch
rh-ror50-rubygem-thread_safe-0.3.5-6.el7.noarch
rh-ror50-rubygem-tzinfo-1.2.2-6.el7.noarch
rh-ror50-rubygem-websocket-driver-0.6.4-1.el7.x86_64
rh-ror50-rubygem-websocket-extensions-0.1.2-2.el7.noarch
rh-ror50-runtime-5.0-5.el7.x86_64
rh-ruby23-ruby-2.3.1-64.el7.x86_64
rh-ruby23-ruby-devel-2.3.1-64.el7.x86_64
rh-ruby23-ruby-irb-2.3.1-64.el7.noarch
rh-ruby23-ruby-libs-2.3.1-64.el7.x86_64
rh-ruby23-rubygem-bigdecimal-1.2.8-64.el7.x86_64
rh-ruby23-rubygem-bundler-1.10.6-4.el7.noarch
rh-ruby23-rubygem-did_you_mean-1.0.0-64.el7.x86_64
rh-ruby23-rubygem-io-console-0.4.5-64.el7.x86_64
rh-ruby23-rubygem-json-1.8.3-64.el7.x86_64
rh-ruby23-rubygem-minitest-5.8.3-64.el7.noarch
rh-ruby23-rubygem-psych-2.0.17-64.el7.x86_64
rh-ruby23-rubygem-rake-10.4.2-64.el7.noarch
rh-ruby23-rubygem-rdoc-4.2.1-64.el7.noarch
rh-ruby23-rubygems-2.5.1-64.el7.noarch
rh-ruby23-rubygems-devel-2.5.1-64.el7.noarch
rh-ruby23-runtime-2.2-7.el7.x86_64
rh-ruby24-ruby-2.4.0-75.el7.x86_64
rh-ruby24-ruby-devel-2.4.0-75.el7.x86_64
rh-ruby24-ruby-irb-2.4.0-75.el7.noarch
rh-ruby24-ruby-libs-2.4.0-75.el7.x86_64
rh-ruby24-rubygem-bigdecimal-1.3.0-75.el7.x86_64
rh-ruby24-rubygem-bundler-1.13.7-1.el7.noarch
rh-ruby24-rubygem-did_you_mean-1.1.0-75.el7.x86_64
rh-ruby24-rubygem-io-console-0.4.6-75.el7.x86_64
rh-ruby24-rubygem-json-2.0.2-75.el7.x86_64
rh-ruby24-rubygem-minitest-5.10.1-75.el7.noarch
rh-ruby24-rubygem-openssl-2.0.2-75.el7.x86_64
rh-ruby24-rubygem-psych-2.2.2-75.el7.x86_64
rh-ruby24-rubygem-rake-12.0.0-75.el7.noarch
rh-ruby24-rubygem-rdoc-5.0.0-75.el7.noarch
rh-ruby24-rubygems-2.6.8-75.el7.noarch
rh-ruby24-rubygems-devel-2.6.8-75.el7.noarch
rh-ruby24-runtime-2.4-2.el7.x86_64
rootfiles-8.1-11.el7.noarch
rpm-4.11.3-21.el7.x86_64
rpm-build-libs-4.11.3-21.el7.x86_64
rpm-libs-4.11.3-21.el7.x86_64
rpm-python-4.11.3-21.el7.x86_64
rsync-3.0.9-17.el7.x86_64
rsyslog-7.4.7-16.el7.x86_64
scl-utils-20130529-17.el7_1.x86_64
screen-4.1.0-0.23.20120314git3c2946.el7_2.x86_64
sed-4.2.2-5.el7.x86_64
selinux-policy-3.13.1-102.el7.noarch
selinux-policy-targeted-3.13.1-102.el7.noarch
setools-libs-3.3.8-1.1.el7.x86_64
setup-2.8.71-7.el7.noarch
shadow-utils-4.1.5.1-24.el7.x86_64
shared-mime-info-1.1-9.el7.x86_64
slang-2.2.4-11.el7.x86_64
snappy-1.1.0-3.el7.x86_64
sqlite-3.7.17-8.el7.x86_64
sqlite-devel-3.7.17-8.el7.x86_64
sudo-1.8.6p7-20.el7.x86_64
systemd-219-30.el7.x86_64
systemd-libs-219-30.el7.x86_64
systemd-sysv-219-30.el7.x86_64
sysvinit-tools-2.88-14.dsf.el7.x86_64
tar-1.26-31.el7.x86_64
tcp_wrappers-libs-7.6-77.el7.x86_64
teamd-1.25-4.el7.x86_64
trousers-0.3.13-1.el7.x86_64
tuned-2.7.1-3.el7.noarch
tzdata-2016g-2.el7.noarch
ustr-1.0.4-16.el7.x86_64
util-linux-2.23.2-33.el7.x86_64
uuid-1.6.2-26.el7.x86_64
vim-common-7.4.160-1.el7.x86_64
vim-enhanced-7.4.160-1.el7.x86_64
vim-filesystem-7.4.160-1.el7.x86_64
vim-minimal-7.4.160-1.el7.x86_64
virt-what-1.13-8.el7.x86_64
which-2.20-7.el7.x86_64
wpa_supplicant-2.0-20.el7.x86_64
xfsprogs-4.5.0-8.el7.x86_64
xz-5.2.2-1.el7.x86_64
xz-libs-5.2.2-1.el7.x86_64
yum-3.4.3-150.el7.centos.noarch
yum-metadata-parser-1.1.4-10.el7.x86_64
yum-plugin-fastestmirror-1.1.31-40.el7.noarch
zlib-1.2.7-17.el7.x86_64
zlib-devel-1.2.7-17.el7.x86_64
なおここではrailsのみの開発環境としている。
DBはpostgresでもmysqlでもいいと思う。
しかしsclにあるrh-mysql57ではgemのmysql2がインストールできなかった。
回避策としてoracleのmysql-community-server、
mysql-community-server-5.7.22-1.el7.x86_64.rpm 
を利用した。
当然合わせて
mysql-community-common-5.7.21-1.el7.x86_64
mysql-community-client-5.7.21-1.el7.x86_64
mysql-community-devel-5.7.21-1.el7.x86_64
mysql-community-libs-5.7.21-1.el7.x86_64
mysql-community-libs-compat-5.7.21-1.el7.x86_64
を併用する事になる。

他の開発言語でも動作した方がいれば本postにコメントをいただきたい。
このpostを書いている2018年05月01日の段階では異常なくデプロイできている。

関連記事
ロリポップマネージドクラウド備忘録1
ロリポップマネージドクラウド備忘録3 DBダンプ

2018年4月22日日曜日

ロリポップマネージドクラウド備忘録1

ロリポップマネージドクラウドをrailsで利用する際に必要となる初期構築作業がいくつかある。
個人的な備忘録として書いておく。

DBの削除

rake db:dropは出来ない。
mysqlからdrop databaseする。

$ mysql -u 【ユーザー名】 -D 【DB名】 -h 【mysqlホスト名】.mc.lolipop.lan -p
Enter password: 
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12528207
Server version: 5.7.20-0ubuntu0.16.04.1-log (Ubuntu)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> drop database 【DB名】;
seedデータの投入

seed.rbファイルは手元の開発環境であらかじめ作成。
scpなりでコンテナ側に転送しておく。
sshにてコンテナにログインした後、RAILS_ENVを指定してrake db:seed

 $ cd ~/current
 $ RAILS_ENV=production bundle exec rake db:seed
静的ファイル配信

config/environments/production.rbにて設定
config.public_file_server.enabled = true

カスタムドメインとSSL設定

任意のDNSでドメインにAレコードを設定
設定したドメインをコントロールパネルで指定。
Let's encryptもコントロールパネルから指定するだけ。
関連記事
ロリポップマネージドクラウド備忘録2 環境構築
ロリポップマネージドクラウド備忘録3 DBダンプ

2018年4月21日土曜日

【とりあえず1.7.2で回避する】ロリポップマネージドクラウドにてnokogiri 1.8.2がインストールできない

先日、ロリポップマネージドクラウドが正式にリリースされた。
https://mc.lolipop.jp/
しかしタイトルの通り、nokogiri 1.8.2がインストールできない。

仕方がないので1.7.2をインストールする。
取り急ぎ、2018年4月21日の段階での解決方法を記載しておく。
nokogiro 1.7.2をGemfileで指定してgit pushしても以下の様になる。
これは1.8.2でもほぼ同等なエラーとなる。
 (バージョン番号を変えたものと認識していただいて良い。)

# git push lolipop master
Counting objects: 7, done.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 465 bytes | 0 bytes/s, done.
Total 4 (delta 3), reused 0 (delta 0)
remote: Run rails build process...
remote: Fetching gem metadata from https://rubygems.org/......
remote: Fetching rake 12.3.1
remote: Installing rake 12.3.1
remote: Fetching concurrent-ruby 1.0.5
remote: Installing concurrent-ruby 1.0.5
remote: Fetching i18n 1.0.1
remote: Installing i18n 1.0.1
remote: Fetching minitest 5.11.3
remote: Installing minitest 5.11.3
remote: Fetching thread_safe 0.3.6
remote: Installing thread_safe 0.3.6
remote: Fetching tzinfo 1.2.5
remote: Installing tzinfo 1.2.5
remote: Fetching activesupport 5.1.6
remote: Installing activesupport 5.1.6
remote: Fetching builder 3.2.3
remote: Installing builder 3.2.3
remote: Fetching erubi 1.7.1
remote: Installing erubi 1.7.1
remote: Fetching mini_portile2 2.1.0
remote: Installing mini_portile2 2.1.0
remote: Fetching nokogiri 1.7.2
remote: Installing nokogiri 1.7.2 with native extensions
remote: Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote: 
remote: current directory:
remote: /tmp/d20180420-24-1qbhkw4/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.7.2/ext/nokogiri
remote: /usr/local/bin/ruby -r ./siteconf20180420-96-1a39264.rb extconf.rb
remote: checking if the C compiler accepts ... yes
remote: Building nokogiri using packaged libraries.
remote: Using mini_portile version 2.1.0
remote: checking for gzdopen() in -lz... yes
remote: checking for iconv... yes
remote: ************************************************************************
remote: IMPORTANT NOTICE:
remote: 
remote: Building Nokogiri with a packaged version of libxml2-2.9.4
remote: with the following patches applied:
remote:  - 0001-Fix-comparison-with-root-node-in-xmlXPathCmpNodes.patch
remote:  - 0002-Fix-XPointer-paths-beginning-with-range-to.patch
remote:  - 0003-Disallow-namespace-nodes-in-XPointer-ranges.patch
remote: 
remote: Team Nokogiri will keep on doing their best to provide security
remote: updates in a timely manner, but if this is a concern for you and want
remote: to use the system library instead; abort this installation process and
remote: reinstall nokogiri as follows:
remote: 
remote:     gem install nokogiri -- --use-system-libraries
remote:         [--with-xml2-config=/path/to/xml2-config]
remote:         [--with-xslt-config=/path/to/xslt-config]
remote: 
remote: If you are using Bundler, tell it to use the option:
remote: 
remote:     bundle config build.nokogiri --use-system-libraries
remote:     bundle install
remote: 
remote: Note, however, that nokogiri is not fully compatible with arbitrary
remote: versions of libxml2 provided by OS/package vendors.
remote: ************************************************************************
remote: Extracting libxml2-2.9.4.tar.gz into
remote: tmp/x86_64-pc-linux-gnu/ports/libxml2/2.9.4... OK
remote: Running git apply with
remote: /tmp/d20180420-24-1qbhkw4/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.7.2/patches/libxml2/0001-Fix-comparison-with-root-node-in-xmlXPathCmpNodes.patch...
remote: OK
remote: Running git apply with
remote: /tmp/d20180420-24-1qbhkw4/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.7.2/patches/libxml2/0002-Fix-XPointer-paths-beginning-with-range-to.patch...
remote: OK
remote: Running git apply with
remote: /tmp/d20180420-24-1qbhkw4/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.7.2/patches/libxml2/0003-Disallow-namespace-nodes-in-XPointer-ranges.patch...
remote: OK
remote: Running 'configure' for libxml2 2.9.4... OK
remote: Running 'compile' for libxml2 2.9.4... ERROR, review
remote: '/tmp/d20180420-24-1qbhkw4/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.7.2/ext/nokogiri/tmp/x86_64-pc-linux-gnu/ports/libxml2/2.9.4/compile.log'
remote: to see what happened. Last lines are:
remote: ========================================================================
remote: Making all in examples
remote: make[3]: Entering directory
remote: '/tmp/d20180420-24-1qbhkw4/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.7.2/ext/nokogiri/tmp/x86_64-pc-linux-gnu/ports/libxml2/2.9.4/libxml2-2.9.4/doc/examples'
remote:   CC       io1.o
remote:   CCLD     io1
remote:   CC       io2.o
remote:   CCLD     io2
remote:   CC       parse1.o
remote:   CCLD     parse1
remote: collect2: error: ld returned 1 exit status
remote: Makefile:613: recipe for target 'parse1' failed
remote: make[3]: *** [parse1] Error 1
remote: make[3]: Leaving directory
remote: '/tmp/d20180420-24-1qbhkw4/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.7.2/ext/nokogiri/tmp/x86_64-pc-linux-gnu/ports/libxml2/2.9.4/libxml2-2.9.4/doc/examples'
remote: Makefile:779: recipe for target 'all-recursive' failed
remote: make[2]: *** [all-recursive] Error 1
remote: make[2]: Leaving directory
remote: '/tmp/d20180420-24-1qbhkw4/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.7.2/ext/nokogiri/tmp/x86_64-pc-linux-gnu/ports/libxml2/2.9.4/libxml2-2.9.4/doc'
remote: Makefile:1440: recipe for target 'all-recursive' failed
remote: make[1]: *** [all-recursive] Error 1
remote: make[1]: Leaving directory
remote: '/tmp/d20180420-24-1qbhkw4/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.7.2/ext/nokogiri/tmp/x86_64-pc-linux-gnu/ports/libxml2/2.9.4/libxml2-2.9.4'
remote: Makefile:859: recipe for target 'all' failed
remote: make: *** [all] Error 2
remote: ========================================================================
remote: *** extconf.rb failed ***
remote: Could not create Makefile due to some reason, probably lack of necessary
remote: libraries and/or headers.  Check the mkmf.log file for more details.  You may
remote: need configuration options.
remote: 
remote: Provided configuration options:
remote:  --with-opt-dir
remote:  --without-opt-dir
remote:  --with-opt-include
remote:  --without-opt-include=${opt-dir}/include
remote:  --with-opt-lib
remote:  --without-opt-lib=${opt-dir}/lib
remote:  --with-make-prog
remote:  --without-make-prog
remote:  --srcdir=.
remote:  --curdir
remote:  --ruby=/usr/local/bin/$(RUBY_BASE_NAME)
remote:  --help
remote:  --clean
remote:  --use-system-libraries
remote:  --enable-static
remote:  --disable-static
remote:  --with-zlib-dir
remote:  --without-zlib-dir
remote:  --with-zlib-include
remote:  --without-zlib-include=${zlib-dir}/include
remote:  --with-zlib-lib
remote:  --without-zlib-lib=${zlib-dir}/lib
remote:  --enable-cross-build
remote:  --disable-cross-build
remote: /tmp/d20180420-24-1qbhkw4/vendor/bundle/ruby/2.5.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:366:in
remote: `block in execute': Failed to complete compile task (RuntimeError)
remote: from
remote: /tmp/d20180420-24-1qbhkw4/vendor/bundle/ruby/2.5.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:337:in
remote: `chdir'
remote: from
remote: /tmp/d20180420-24-1qbhkw4/vendor/bundle/ruby/2.5.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:337:in
remote: `execute'
remote: from
remote: /tmp/d20180420-24-1qbhkw4/vendor/bundle/ruby/2.5.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:111:in
remote: `compile'
remote: from
remote: /tmp/d20180420-24-1qbhkw4/vendor/bundle/ruby/2.5.0/gems/mini_portile2-2.1.0/lib/mini_portile2/mini_portile.rb:150:in
remote: `cook'
remote:  from extconf.rb:364:in `block (2 levels) in process_recipe'
remote:  from extconf.rb:257:in `block in chdir_for_build'
remote:  from extconf.rb:256:in `chdir'
remote:  from extconf.rb:256:in `chdir_for_build'
remote:  from extconf.rb:363:in `block in process_recipe'
remote:  from extconf.rb:262:in `tap'
remote:  from extconf.rb:262:in `process_recipe'
remote:  from extconf.rb:547:in `
' remote: remote: To see why this extension failed to compile, please check the mkmf.log which can remote: be found here: remote: remote: /tmp/d20180420-24-1qbhkw4/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.7.2/mkmf.log remote: remote: extconf failed, exit code 1 remote: remote: Gem files will remain installed in remote: /tmp/d20180420-24-1qbhkw4/vendor/bundle/ruby/2.5.0/gems/nokogiri-1.7.2 for remote: inspection. remote: Results logged to remote: /tmp/d20180420-24-1qbhkw4/vendor/bundle/ruby/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.7.2/gem_make.out remote: remote: An error occurred while installing nokogiri (1.7.2), and Bundler cannot remote: continue. remote: Make sure that `gem install nokogiri -v '1.7.2'` succeeds before bundling. remote: remote: In Gemfile: remote: rails was resolved to 5.1.6, which depends on remote: actioncable was resolved to 5.1.6, which depends on remote: actionpack was resolved to 5.1.6, which depends on remote: actionview was resolved to 5.1.6, which depends on remote: rails-dom-testing was resolved to 2.0.3, which depends on remote: nokogiri remote: Build seems to be failed. Abort
解決方法はlolipopのコンテナにログインして、bundle config build.nokogiri --use-system-librariesを実行する。
 (もちろんその後ログアウトする。)
以下の様に操作する。
(ssh以降の【ポート番号】、【ユーザー名】は適宜、御自身の環境に合わせていただきたい。)

# ssh -p 【ポート番号】【ユーザー名】@ssh-1.mc.lolipop.jp
Last login: Fri Apr 20 15:53:56 2018 from 10.1.0.1
  __  __  ____   _          _ _                   
 |  \/  |/ ___| | |    ___ | (_)_ __   ___  _ __  
 | |\/| | |     | |   / _ \| | | '_ \ / _ \| '_ \ 
 | |  | | |___ _| |__| (_) | | | |_) | (_) | |_) |
 |_|  |_|\____(_)_____\___/|_|_| .__/ \___/| .__/ 
                               |_|         |_|

******* Welcome to Lolipop! Managed Cloud *******

$ bundle config build.nokogiri --use-system-libraries
$ logout
後はgit push lolipop masterすれば良い。

参考
https://qiita.com/south37/items/63c938474bf35b30c988

2018年3月10日土曜日

nifcloud初心者が気をつけたい2の事

nifty cloudを利用できる機会をいただいた。
使い始めて気になった点があったのでまとめておく。

1. ファイアーウォールの設定で気をつけたい点
nifty cloudではサーバに対しファイアーウォールを設定できる。
サーバ1台毎に設定できる。
また、1つのファイアーウォールに対し複数のサーバを割り当てる事もできる。
サーバを構築した後にファイアーウォールを付け直す事もできる。
使い勝手がいい。
(cloudのタイプにより、ゾーンを設定する必要があるが、インポートなどで後から変更して対応できる。)
簡素なUIで操作に迷う事はない。

しかし、一旦作成したファイアーウォールグループにINルールを追加する時に注意したい事がある。
接続元種別のプルダウンメニューで、接続しているIPアドレスを選んだ時に必ずしも今利用している、IPアドレスが選択されない事象がある。
これは、wifiなどを利用していて一度ファイアーウォールの画面を表示した後、wifiを切りかえる事で接続元が変わってしまうと、今利用しているIPアドレスがブラウザ上に正しく反映されない。
すなわちINルールが正しく生成できない。

これはブラウザの仕組み上、回避できないだろう。
慌てずブラウザをリロードするしかない。

追加するルールのIP/CIDR・グループの項目に正しい値が表示されているかを確認するには、
確認君などでgatewayを確かめるのが手軽だ。

2 クラウド上で電源停止をする時haltコマンドを使わない。 
サーバでの作業を終えたので、haltコマンドを使いたくなる。
一見ターミナル上では問題がないかの様に見られる。
しかし、更新中の表示が続いた後、コントロールパネル上では異常ありとなってしまう。

解決策は一旦サーバを再起動する。
サーバを選択して、選択したサーバの操作から、サーバ再起動を選択する。
 この際、強制を選択する。
マック以外であれば上記の方法以外にもコンソール起動という回避策もありそうだが、windows環境が手元にないので未確認となっている。 サーバを停止する場合はコントロールパネルから停止するのが良さそうだ。

まとめ
1. INルールを作る時はwifiの切りかえ等が行われない事を確認する。
2. haltコマンドは使わない。

2017年7月15日土曜日

Compiling from C language to WebAssembly on Centos7 2/2

先の投稿にて、VirtualBOX上のCentOS7にWebAssemblyの環境を構築した。
この環境でweb上にある、simple programを実行してみる。
手順的には
1)ソースの作成。
2)コンパイル
3)ブラウザでの確認
となる。

1)ソースの作成
任意のディレクトリを作成して、よくあるHello worldを作成する。

# mkdir helloworld
# cd helloworld
# echo '#include ' > hello.c
# echo 'int main(int argc, char ** argv) {' >> hello.c
# echo 'printf("Hello, world!\n");' >> hello.c
# echo '}' >> hello.c
短いながら、hello.cというソースを作成した。
# cat hello.c
#include 
int main(int argc, char ** argv) {
printf("Hello, world!\n");
}
2)コンパイル 先ほどのhello.cをコンパイルする。 
# emcc hello.c -s WASM=1 -o hello.html
hello.c以外に以下の3ファイルが作成される。
右にファイルサイズを併記しておく。
hello.html 101K
hello.js 95K
hello.wasm 47K

3)ブラウザでの確認 emrunはビルトインサーバがある様なのでこれを利用する。
# emrun --no_browser --port 8080 .
Web server root directory: /root/helloworld
Now listening at http://localhost:8080/
起動した旨のメッセージが表示されている。
この状態で任意のブラウザから閲覧してみる。
当然linux側のfirewall設定とVirtualBOX上のポートフォワードは必要となる。
このサーバはbindの設定など無いようだ。
何処からでも閲覧できるようなので注意。
VirtualBOXのポートフォワードを以下の様に設定した。












Rule2で8888に割り振っている。
Linux側は暫定でfirewalldを停止した。
# systemctl stop firewalld
ブラウザから、http://127.0.0.1:8888へアクセスしたところ、 以下のような表示がされた。










ファイルの一覧が表示される仕様の様だ。
hello.htmlをクリックすると、Hello world!が表示される。














参考 http://webassembly.org/getting-started/developers-guide/

2017年7月5日水曜日

Compiling from C language to WebAssembly on Centos7 1/2

WebAssemblyをブラウザで実行するにあたり、日常的に利用しているMacにLLVM等をインストールしてコンパイル環境を作るのは諸々の事 情があって実行しにくいというケースが多いのではなかろうか。
特にCmakeを利用している環境では手軽にWebAssemblyを試しづらい。
(例えばserverside-swifをビルドする際、cmake3が必要でWebAssemblyと環境を分けたいといったケースが考えられる。)
どうしても、手元のMacの環境上では実行しにくいというケースもあるだろう。

Linux上での実行方法はEmscripten SDKのページに書かれている。
ただしUbuntuベースの手順となっている。
https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html

この投稿はCentOS7上でのWebAssembly実行方法として書きまとめる。
上記ページ等には明記はされていないが、webserverであるemrun自体はVirtualBOX上で実行し、ブラウザ自体はWindowsやMac上のブラウザを利用する事ができる。

ここでは、VirtualBox上のcentos-release-7-3.1611.el7.centos.x86_64で実行した。
# rpm -qa centos-release
centos-release-7-3.1611.el7.centos.x86_64
Virtual Boxは以下のバージョンを使用した。
バージョン 5.1.22 r115126 (Qt5.6.2)

環境構築の為の作業は割と手軽なのでお薦めする。
(LLVM等rpmでインストールしたもので動作した。)
自己責任でお試しいただきたい。
なおVirtualBox上のCentOSでemsdkのビルドにあたりCPUcoreは複数あった方が早く終わる。
ただし、CPUcoreを増やすとメモリも多く必要とする。
(メモリをキャッシュとして使われる様なので、回避策はあるのかも知れない。)
メモリが少ないとリンカが途中で停止する場合がある。
具体的には以下のメッセージが表示され停止する。
fatal error: ld terminated with signal 9 [Killed]
これは、README.mdに記載がある通りメモリ不足に起因する。
git cloneでemsdkのソースを取得した際に一度目を通した方がいい。
何回かビルドたところ目安として、1Coreあたり3G程度のメモリがあった方がいいのだろうか。(必ず比例する訳でもない。)
1Coreでも2時間程度のビルド時間となる。
ハードディスクは35G程度は欲しい。

おおまかな作業としては、
https://developer.mozilla.org/ja/docs/WebAssembly/C_to_wasm
にある通り。
注意点としてはCentOS7ではepelにて提供されている、cmake3を利用する。
また、その際cmake3に対しcmakeとしてシンボリックリンクを張る。
(シンボリックリンクという回避策は快くは思わないが、emsdk内の表記をcmake3に変更する事の方がより難しいと思う。)

なおcmake2系で実行した場合、途中で以下のメッセージが表示され継続できない。
CMake Error at CMakeLists.txt:3 (cmake_minimum_required):
  CMake 3.4.3 or higher is required.  You are running version 2.8.12.2
また、cmake3に対しcmakeというシンボリックリンクを張らない場合は以下のfailとなり中断してしまう。
Running CMake: ['cmake', '-G', 'Unix Makefiles', '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DPYTHON_EXECUTABLE=/usr/bin/python', '-DLLVM_TARGETS_TO_BUILD=X86;JSBackend', '-DLLVM_INCLUDE_EXAMPLES=OFF', '-DCLANG_INCLUDE_EXAMPLES=OFF', '-DLLVM_INCLUDE_TESTS=OFF', '-DCLANG_INCLUDE_TESTS=OFF', '-DLLVM_ENABLE_ASSERTIONS=ON', '/usr/local/src/emsdk/clang/fastcomp/src']
Installation failed!
selinuxは事前に無効とした。
ファイル、/etc/selinux/configのSELINUXの箇所は
SELINUX=disabled
とした。
VirtualBox再起動後
getenforce
で確認する。
# getenforce 
Disabled

実際の環境構築手順としては以下の様になる。

# yum --disablerepo=\* --enablerepo=base install -y git
# yum --disablerepo=\* --enablerepo=base install -y gcc
# yum --disablerepo=\* --enablerepo=base install -y gcc-c++
# yum install -y epel-release
# yum --disablerepo=\* --enablerepo=base,epel install -y cmake3
# ln -s /usr/bin/cmake3 /usr/bin/cmake
# cd /usr/local/src
# git clone https://github.com/juj/emsdk.git
# cd emsdk
# ./emsdk install sdk-incoming-64bit binaryen-master-64bit 
# ./emsdk activate sdk-incoming-64bit binaryen-master-64bit 
サンプルなので/usr/local/src以下にソースを展開したが、当然他のディレクトリで良い。
最後に環境構築変数を設定するシェルを実行する。
# source ./emsdk_env.sh
ここまでの手順でコンパイル環境は整う。
次の投稿にてサンプルにある、hello worldを動かしてみる。

念の為、yumにてrpmをインストールした際のインストールログも記載しておく。 今後の動作しない場合等の参考となればと思う。

git
 
# yum --disablerepo=\* --enablerepo=base install -y git

Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: ftp.jaist.ac.jp
No package 2 available.
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.8.3.1-6.el7_2.1 will be installed
--> Processing Dependency: perl-Git = 1.8.3.1-6.el7_2.1 for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: perl >= 5.008 for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: rsync for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: perl(warnings) for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: perl(vars) for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: perl(strict) for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: perl(lib) for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: perl(Term::ReadKey) for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: perl(Git) for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: perl(Getopt::Long) for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: perl(File::stat) for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: perl(File::Temp) for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: perl(File::Spec) for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: perl(File::Path) for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: perl(File::Find) for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: perl(File::Copy) for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: perl(File::Basename) for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: perl(Exporter) for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: perl(Error) for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: /usr/bin/perl for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Processing Dependency: libgnome-keyring.so.0()(64bit) for package: git-1.8.3.1-6.el7_2.1.x86_64
--> Running transaction check
---> Package libgnome-keyring.x86_64 0:3.8.0-3.el7 will be installed
---> Package perl.x86_64 4:5.16.3-291.el7 will be installed
--> Processing Dependency: perl-libs = 4:5.16.3-291.el7 for package: 4:perl-5.16.3-291.el7.x86_64
--> Processing Dependency: perl(Socket) >= 1.3 for package: 4:perl-5.16.3-291.el7.x86_64
--> Processing Dependency: perl(Scalar::Util) >= 1.10 for package: 4:perl-5.16.3-291.el7.x86_64
--> Processing Dependency: perl-macros for package: 4:perl-5.16.3-291.el7.x86_64
--> Processing Dependency: perl-libs for package: 4:perl-5.16.3-291.el7.x86_64
--> Processing Dependency: perl(threads::shared) for package: 4:perl-5.16.3-291.el7.x86_64
--> Processing Dependency: perl(threads) for package: 4:perl-5.16.3-291.el7.x86_64
--> Processing Dependency: perl(constant) for package: 4:perl-5.16.3-291.el7.x86_64
--> Processing Dependency: perl(Time::Local) for package: 4:perl-5.16.3-291.el7.x86_64
--> Processing Dependency: perl(Time::HiRes) for package: 4:perl-5.16.3-291.el7.x86_64
--> Processing Dependency: perl(Storable) for package: 4:perl-5.16.3-291.el7.x86_64
--> Processing Dependency: perl(Socket) for package: 4:perl-5.16.3-291.el7.x86_64
--> Processing Dependency: perl(Scalar::Util) for package: 4:perl-5.16.3-291.el7.x86_64
--> Processing Dependency: perl(Pod::Simple::XHTML) for package: 4:perl-5.16.3-291.el7.x86_64
--> Processing Dependency: perl(Pod::Simple::Search) for package: 4:perl-5.16.3-291.el7.x86_64
--> Processing Dependency: perl(Filter::Util::Call) for package: 4:perl-5.16.3-291.el7.x86_64
--> Processing Dependency: perl(Carp) for package: 4:perl-5.16.3-291.el7.x86_64
--> Processing Dependency: libperl.so()(64bit) for package: 4:perl-5.16.3-291.el7.x86_64
---> Package perl-Error.noarch 1:0.17020-2.el7 will be installed
---> Package perl-Exporter.noarch 0:5.68-3.el7 will be installed
---> Package perl-File-Path.noarch 0:2.09-2.el7 will be installed
---> Package perl-File-Temp.noarch 0:0.23.01-3.el7 will be installed
---> Package perl-Getopt-Long.noarch 0:2.40-2.el7 will be installed
--> Processing Dependency: perl(Pod::Usage) >= 1.14 for package: perl-Getopt-Long-2.40-2.el7.noarch
--> Processing Dependency: perl(Text::ParseWords) for package: perl-Getopt-Long-2.40-2.el7.noarch
---> Package perl-Git.noarch 0:1.8.3.1-6.el7_2.1 will be installed
---> Package perl-PathTools.x86_64 0:3.40-5.el7 will be installed
---> Package perl-TermReadKey.x86_64 0:2.30-20.el7 will be installed
---> Package rsync.x86_64 0:3.0.9-17.el7 will be installed
--> Running transaction check
---> Package perl-Carp.noarch 0:1.26-244.el7 will be installed
---> Package perl-Filter.x86_64 0:1.49-3.el7 will be installed
---> Package perl-Pod-Simple.noarch 1:3.28-4.el7 will be installed
--> Processing Dependency: perl(Pod::Escapes) >= 1.04 for package: 1:perl-Pod-Simple-3.28-4.el7.noarch
--> Processing Dependency: perl(Encode) for package: 1:perl-Pod-Simple-3.28-4.el7.noarch
---> Package perl-Pod-Usage.noarch 0:1.63-3.el7 will be installed
--> Processing Dependency: perl(Pod::Text) >= 3.15 for package: perl-Pod-Usage-1.63-3.el7.noarch
--> Processing Dependency: perl-Pod-Perldoc for package: perl-Pod-Usage-1.63-3.el7.noarch
---> Package perl-Scalar-List-Utils.x86_64 0:1.27-248.el7 will be installed
---> Package perl-Socket.x86_64 0:2.010-4.el7 will be installed
---> Package perl-Storable.x86_64 0:2.45-3.el7 will be installed
---> Package perl-Text-ParseWords.noarch 0:3.29-4.el7 will be installed
---> Package perl-Time-HiRes.x86_64 4:1.9725-3.el7 will be installed
---> Package perl-Time-Local.noarch 0:1.2300-2.el7 will be installed
---> Package perl-constant.noarch 0:1.27-2.el7 will be installed
---> Package perl-libs.x86_64 4:5.16.3-291.el7 will be installed
---> Package perl-macros.x86_64 4:5.16.3-291.el7 will be installed
---> Package perl-threads.x86_64 0:1.87-4.el7 will be installed
---> Package perl-threads-shared.x86_64 0:1.43-6.el7 will be installed
--> Running transaction check
---> Package perl-Encode.x86_64 0:2.51-7.el7 will be installed
---> Package perl-Pod-Escapes.noarch 1:1.04-291.el7 will be installed
---> Package perl-Pod-Perldoc.noarch 0:3.20-4.el7 will be installed
--> Processing Dependency: perl(parent) for package: perl-Pod-Perldoc-3.20-4.el7.noarch
--> Processing Dependency: perl(HTTP::Tiny) for package: perl-Pod-Perldoc-3.20-4.el7.noarch
---> Package perl-podlators.noarch 0:2.5.1-3.el7 will be installed
--> Running transaction check
---> Package perl-HTTP-Tiny.noarch 0:0.033-3.el7 will be installed
---> Package perl-parent.noarch 1:0.225-244.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                     Arch        Version                Repository
                                                                           Size
================================================================================
Installing:
 git                         x86_64      1.8.3.1-6.el7_2.1      base      4.4 M
Installing for dependencies:
 libgnome-keyring            x86_64      3.8.0-3.el7            base      109 k
 perl                        x86_64      4:5.16.3-291.el7       base      8.0 M
 perl-Carp                   noarch      1.26-244.el7           base       19 k
 perl-Encode                 x86_64      2.51-7.el7             base      1.5 M
 perl-Error                  noarch      1:0.17020-2.el7        base       32 k
 perl-Exporter               noarch      5.68-3.el7             base       28 k
 perl-File-Path              noarch      2.09-2.el7             base       26 k
 perl-File-Temp              noarch      0.23.01-3.el7          base       56 k
 perl-Filter                 x86_64      1.49-3.el7             base       76 k
 perl-Getopt-Long            noarch      2.40-2.el7             base       56 k
 perl-Git                    noarch      1.8.3.1-6.el7_2.1      base       53 k
 perl-HTTP-Tiny              noarch      0.033-3.el7            base       38 k
 perl-PathTools              x86_64      3.40-5.el7             base       82 k
 perl-Pod-Escapes            noarch      1:1.04-291.el7         base       51 k
 perl-Pod-Perldoc            noarch      3.20-4.el7             base       87 k
 perl-Pod-Simple             noarch      1:3.28-4.el7           base      216 k
 perl-Pod-Usage              noarch      1.63-3.el7             base       27 k
 perl-Scalar-List-Utils      x86_64      1.27-248.el7           base       36 k
 perl-Socket                 x86_64      2.010-4.el7            base       49 k
 perl-Storable               x86_64      2.45-3.el7             base       77 k
 perl-TermReadKey            x86_64      2.30-20.el7            base       31 k
 perl-Text-ParseWords        noarch      3.29-4.el7             base       14 k
 perl-Time-HiRes             x86_64      4:1.9725-3.el7         base       45 k
 perl-Time-Local             noarch      1.2300-2.el7           base       24 k
 perl-constant               noarch      1.27-2.el7             base       19 k
 perl-libs                   x86_64      4:5.16.3-291.el7       base      688 k
 perl-macros                 x86_64      4:5.16.3-291.el7       base       43 k
 perl-parent                 noarch      1:0.225-244.el7        base       12 k
 perl-podlators              noarch      2.5.1-3.el7            base      112 k
 perl-threads                x86_64      1.87-4.el7             base       49 k
 perl-threads-shared         x86_64      1.43-6.el7             base       39 k
 rsync                       x86_64      3.0.9-17.el7           base      360 k

Transaction Summary
================================================================================
Install  1 Package (+32 Dependent packages)

Total download size: 16 M
Installed size: 60 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/base/packages/perl-Carp-1.26-244.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for perl-Carp-1.26-244.el7.noarch.rpm is not installed
--------------------------------------------------------------------------------
Total                                              1.1 MB/s |  16 MB  00:15     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) "
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-3.1611.el7.centos.x86_64 (@anaconda)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:perl-parent-0.225-244.el7.noarch                          1/33 
  Installing : perl-HTTP-Tiny-0.033-3.el7.noarch                           2/33 
  Installing : perl-podlators-2.5.1-3.el7.noarch                           3/33 
  Installing : perl-Pod-Perldoc-3.20-4.el7.noarch                          4/33 
  Installing : 1:perl-Pod-Escapes-1.04-291.el7.noarch                      5/33 
  Installing : perl-Encode-2.51-7.el7.x86_64                               6/33 
  Installing : perl-Text-ParseWords-3.29-4.el7.noarch                      7/33 
  Installing : perl-Pod-Usage-1.63-3.el7.noarch                            8/33 
  Installing : perl-Storable-2.45-3.el7.x86_64                             9/33 
  Installing : perl-Exporter-5.68-3.el7.noarch                            10/33 
  Installing : perl-constant-1.27-2.el7.noarch                            11/33 
  Installing : perl-Time-Local-1.2300-2.el7.noarch                        12/33 
  Installing : perl-Socket-2.010-4.el7.x86_64                             13/33 
  Installing : perl-Carp-1.26-244.el7.noarch                              14/33 
  Installing : 4:perl-Time-HiRes-1.9725-3.el7.x86_64                      15/33 
  Installing : perl-PathTools-3.40-5.el7.x86_64                           16/33 
  Installing : perl-Scalar-List-Utils-1.27-248.el7.x86_64                 17/33 
  Installing : 4:perl-libs-5.16.3-291.el7.x86_64                          18/33 
  Installing : 4:perl-macros-5.16.3-291.el7.x86_64                        19/33 
  Installing : 1:perl-Pod-Simple-3.28-4.el7.noarch                        20/33 
  Installing : perl-File-Temp-0.23.01-3.el7.noarch                        21/33 
  Installing : perl-File-Path-2.09-2.el7.noarch                           22/33 
  Installing : perl-threads-shared-1.43-6.el7.x86_64                      23/33 
  Installing : perl-threads-1.87-4.el7.x86_64                             24/33 
  Installing : perl-Filter-1.49-3.el7.x86_64                              25/33 
  Installing : perl-Getopt-Long-2.40-2.el7.noarch                         26/33 
  Installing : 4:perl-5.16.3-291.el7.x86_64                               27/33 
  Installing : 1:perl-Error-0.17020-2.el7.noarch                          28/33 
  Installing : perl-TermReadKey-2.30-20.el7.x86_64                        29/33 
  Installing : rsync-3.0.9-17.el7.x86_64                                  30/33 
  Installing : libgnome-keyring-3.8.0-3.el7.x86_64                        31/33 
  Installing : perl-Git-1.8.3.1-6.el7_2.1.noarch                          32/33 
  Installing : git-1.8.3.1-6.el7_2.1.x86_64                               33/33 
  Verifying  : perl-HTTP-Tiny-0.033-3.el7.noarch                           1/33 
  Verifying  : perl-threads-shared-1.43-6.el7.x86_64                       2/33 
  Verifying  : perl-Storable-2.45-3.el7.x86_64                             3/33 
  Verifying  : perl-Exporter-5.68-3.el7.noarch                             4/33 
  Verifying  : perl-constant-1.27-2.el7.noarch                             5/33 
  Verifying  : perl-PathTools-3.40-5.el7.x86_64                            6/33 
  Verifying  : 1:perl-Pod-Escapes-1.04-291.el7.noarch                      7/33 
  Verifying  : 1:perl-parent-0.225-244.el7.noarch                          8/33 
  Verifying  : perl-TermReadKey-2.30-20.el7.x86_64                         9/33 
  Verifying  : perl-File-Temp-0.23.01-3.el7.noarch                        10/33 
  Verifying  : 1:perl-Pod-Simple-3.28-4.el7.noarch                        11/33 
  Verifying  : perl-Time-Local-1.2300-2.el7.noarch                        12/33 
  Verifying  : perl-Pod-Perldoc-3.20-4.el7.noarch                         13/33 
  Verifying  : perl-Git-1.8.3.1-6.el7_2.1.noarch                          14/33 
  Verifying  : perl-Socket-2.010-4.el7.x86_64                             15/33 
  Verifying  : perl-Carp-1.26-244.el7.noarch                              16/33 
  Verifying  : 1:perl-Error-0.17020-2.el7.noarch                          17/33 
  Verifying  : 4:perl-Time-HiRes-1.9725-3.el7.x86_64                      18/33 
  Verifying  : perl-Scalar-List-Utils-1.27-248.el7.x86_64                 19/33 
  Verifying  : 4:perl-libs-5.16.3-291.el7.x86_64                          20/33 
  Verifying  : 4:perl-macros-5.16.3-291.el7.x86_64                        21/33 
  Verifying  : libgnome-keyring-3.8.0-3.el7.x86_64                        22/33 
  Verifying  : perl-Pod-Usage-1.63-3.el7.noarch                           23/33 
  Verifying  : perl-Encode-2.51-7.el7.x86_64                              24/33 
  Verifying  : perl-podlators-2.5.1-3.el7.noarch                          25/33 
  Verifying  : perl-Getopt-Long-2.40-2.el7.noarch                         26/33 
  Verifying  : perl-File-Path-2.09-2.el7.noarch                           27/33 
  Verifying  : 4:perl-5.16.3-291.el7.x86_64                               28/33 
  Verifying  : perl-threads-1.87-4.el7.x86_64                             29/33 
  Verifying  : perl-Filter-1.49-3.el7.x86_64                              30/33 
  Verifying  : perl-Text-ParseWords-3.29-4.el7.noarch                     31/33 
  Verifying  : git-1.8.3.1-6.el7_2.1.x86_64                               32/33 
  Verifying  : rsync-3.0.9-17.el7.x86_64                                  33/33 

Installed:
  git.x86_64 0:1.8.3.1-6.el7_2.1                                                

Dependency Installed:
  libgnome-keyring.x86_64 0:3.8.0-3.el7                                         
  perl.x86_64 4:5.16.3-291.el7                                                  
  perl-Carp.noarch 0:1.26-244.el7                                               
  perl-Encode.x86_64 0:2.51-7.el7                                               
  perl-Error.noarch 1:0.17020-2.el7                                             
  perl-Exporter.noarch 0:5.68-3.el7                                             
  perl-File-Path.noarch 0:2.09-2.el7                                            
  perl-File-Temp.noarch 0:0.23.01-3.el7                                         
  perl-Filter.x86_64 0:1.49-3.el7                                               
  perl-Getopt-Long.noarch 0:2.40-2.el7                                          
  perl-Git.noarch 0:1.8.3.1-6.el7_2.1                                           
  perl-HTTP-Tiny.noarch 0:0.033-3.el7                                           
  perl-PathTools.x86_64 0:3.40-5.el7                                            
  perl-Pod-Escapes.noarch 1:1.04-291.el7                                        
  perl-Pod-Perldoc.noarch 0:3.20-4.el7                                          
  perl-Pod-Simple.noarch 1:3.28-4.el7                                           
  perl-Pod-Usage.noarch 0:1.63-3.el7                                            
  perl-Scalar-List-Utils.x86_64 0:1.27-248.el7                                  
  perl-Socket.x86_64 0:2.010-4.el7                                              
  perl-Storable.x86_64 0:2.45-3.el7                                             
  perl-TermReadKey.x86_64 0:2.30-20.el7                                         
  perl-Text-ParseWords.noarch 0:3.29-4.el7                                      
  perl-Time-HiRes.x86_64 4:1.9725-3.el7                                         
  perl-Time-Local.noarch 0:1.2300-2.el7                                         
  perl-constant.noarch 0:1.27-2.el7                                             
  perl-libs.x86_64 4:5.16.3-291.el7                                             
  perl-macros.x86_64 4:5.16.3-291.el7                                           
  perl-parent.noarch 1:0.225-244.el7                                            
  perl-podlators.noarch 0:2.5.1-3.el7                                           
  perl-threads.x86_64 0:1.87-4.el7                                              
  perl-threads-shared.x86_64 0:1.43-6.el7                                       
  rsync.x86_64 0:3.0.9-17.el7                                                   

Complete!
gcc
 
# yum --disablerepo=\* --enablerepo=base install -y gcc
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.jaist.ac.jp
No package 2 available.
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.8.5-11.el7 will be installed
--> Processing Dependency: cpp = 4.8.5-11.el7 for package: gcc-4.8.5-11.el7.x86_64
--> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-11.el7.x86_64
--> Processing Dependency: libmpfr.so.4()(64bit) for package: gcc-4.8.5-11.el7.x86_64
--> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-4.8.5-11.el7.x86_64
--> Running transaction check
---> Package cpp.x86_64 0:4.8.5-11.el7 will be installed
---> Package glibc-devel.x86_64 0:2.17-157.el7 will be installed
--> Processing Dependency: glibc-headers = 2.17-157.el7 for package: glibc-devel-2.17-157.el7.x86_64
--> Processing Dependency: glibc-headers for package: glibc-devel-2.17-157.el7.x86_64
---> Package libmpc.x86_64 0:1.0.1-3.el7 will be installed
---> Package mpfr.x86_64 0:3.1.1-4.el7 will be installed
--> Running transaction check
---> Package glibc-headers.x86_64 0:2.17-157.el7 will be installed
--> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-157.el7.x86_64
--> Processing Dependency: kernel-headers for package: glibc-headers-2.17-157.el7.x86_64
--> Running transaction check
---> Package kernel-headers.x86_64 0:3.10.0-514.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package               Arch          Version                  Repository   Size
================================================================================
Installing:
 gcc                   x86_64        4.8.5-11.el7             base         16 M
Installing for dependencies:
 cpp                   x86_64        4.8.5-11.el7             base        5.9 M
 glibc-devel           x86_64        2.17-157.el7             base        1.1 M
 glibc-headers         x86_64        2.17-157.el7             base        668 k
 kernel-headers        x86_64        3.10.0-514.el7           base        4.8 M
 libmpc                x86_64        1.0.1-3.el7              base         51 k
 mpfr                  x86_64        3.1.1-4.el7              base        203 k

Transaction Summary
================================================================================
Install  1 Package (+6 Dependent packages)

Total download size: 29 M
Installed size: 60 M
Downloading packages:
--------------------------------------------------------------------------------
Total                                              719 kB/s |  29 MB  00:41     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : mpfr-3.1.1-4.el7.x86_64                                      1/7 
  Installing : libmpc-1.0.1-3.el7.x86_64                                    2/7 
  Installing : cpp-4.8.5-11.el7.x86_64                                      3/7 
  Installing : kernel-headers-3.10.0-514.el7.x86_64                         4/7 
  Installing : glibc-headers-2.17-157.el7.x86_64                            5/7 
  Installing : glibc-devel-2.17-157.el7.x86_64                              6/7 
  Installing : gcc-4.8.5-11.el7.x86_64                                      7/7 
  Verifying  : glibc-devel-2.17-157.el7.x86_64                              1/7 
  Verifying  : kernel-headers-3.10.0-514.el7.x86_64                         2/7 
  Verifying  : mpfr-3.1.1-4.el7.x86_64                                      3/7 
  Verifying  : cpp-4.8.5-11.el7.x86_64                                      4/7 
  Verifying  : gcc-4.8.5-11.el7.x86_64                                      5/7 
  Verifying  : glibc-headers-2.17-157.el7.x86_64                            6/7 
  Verifying  : libmpc-1.0.1-3.el7.x86_64                                    7/7 

Installed:
  gcc.x86_64 0:4.8.5-11.el7                                                     

Dependency Installed:
  cpp.x86_64 0:4.8.5-11.el7             glibc-devel.x86_64 0:2.17-157.el7       
  glibc-headers.x86_64 0:2.17-157.el7   kernel-headers.x86_64 0:3.10.0-514.el7  
  libmpc.x86_64 0:1.0.1-3.el7           mpfr.x86_64 0:3.1.1-4.el7               

Complete!
gcc-c++
 
# yum --disablerepo=\* --enablerepo=base install -y gcc-c++
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.jaist.ac.jp
No package 2 available.
Resolving Dependencies
--> Running transaction check
---> Package gcc-c++.x86_64 0:4.8.5-11.el7 will be installed
--> Processing Dependency: libstdc++-devel = 4.8.5-11.el7 for package: gcc-c++-4.8.5-11.el7.x86_64
--> Running transaction check
---> Package libstdc++-devel.x86_64 0:4.8.5-11.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                 Arch           Version              Repository    Size
================================================================================
Installing:
 gcc-c++                 x86_64         4.8.5-11.el7         base         7.2 M
Installing for dependencies:
 libstdc++-devel         x86_64         4.8.5-11.el7         base         1.5 M

Transaction Summary
================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 8.7 M
Installed size: 25 M
Downloading packages:
--------------------------------------------------------------------------------
Total                                              2.0 MB/s | 8.7 MB  00:04
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libstdc++-devel-4.8.5-11.el7.x86_64                          1/2
  Installing : gcc-c++-4.8.5-11.el7.x86_64                                  2/2
  Verifying  : gcc-c++-4.8.5-11.el7.x86_64                                  1/2
  Verifying  : libstdc++-devel-4.8.5-11.el7.x86_64                          2/2

Installed:
  gcc-c++.x86_64 0:4.8.5-11.el7

Dependency Installed:
  libstdc++-devel.x86_64 0:4.8.5-11.el7

Complete!
epel-release
 

cmake3
 
# yum --disablerepo=\* --enablerepo=base,epel install -y cmake3
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
No package 2 available.
Resolving Dependencies
--> Running transaction check
---> Package cmake.x86_64 0:2.8.12.2-2.el7 will be installed
--> Processing Dependency: libarchive.so.13()(64bit) for package: cmake-2.8.12.2-2.el7.x86_64
--> Running transaction check
---> Package libarchive.x86_64 0:3.1.2-10.el7_2 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package            Arch           Version                   Repository    Size
================================================================================
Installing:
 cmake              x86_64         2.8.12.2-2.el7            base         7.1 M
Installing for dependencies:
 libarchive         x86_64         3.1.2-10.el7_2            base         318 k

Transaction Summary
================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 7.4 M
Installed size: 27 M
Downloading packages:
--------------------------------------------------------------------------------
Total                                              2.4 MB/s | 7.4 MB  00:03     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libarchive-3.1.2-10.el7_2.x86_64                             1/2 
  Installing : cmake-2.8.12.2-2.el7.x86_64                                  2/2 
  Verifying  : cmake-2.8.12.2-2.el7.x86_64                                  1/2 
  Verifying  : libarchive-3.1.2-10.el7_2.x86_64                             2/2 

Installed:
  cmake.x86_64 0:2.8.12.2-2.el7                                                 

Dependency Installed:
  libarchive.x86_64 0:3.1.2-10.el7_2                                            

Complete!
参考
http://webassembly.org/getting-started/developers-guide/