投稿者アーカイブ

Debian9 stretch MySQLのインストール

Debian9 stretch MySQLのインストール

# apt-get install mysql-server
パッケージリストを読み込んでいます… 完了
依存関係ツリーを作成しています
状態情報を読み取っています… 完了
以下の追加パッケージがインストールされます:
default-mysql-server galera-3 gawk libaio1 libdbi-perl libjemalloc1 libmpfr4
libreadline5 libsigsegv2 mariadb-client-10.1 mariadb-client-core-10.1
mariadb-common mariadb-server-10.1 mariadb-server-core-10.1 mysql-common
rsync socat
提案パッケージ:
gawk-doc libclone-perl libmldbm-perl libnet-daemon-perl
libsql-statement-perl mailx mariadb-test netcat-openbsd tinyca
推奨パッケージ:
libdbd-mysql-perl libterm-readkey-perl libhtml-template-perl
以下のパッケージが新たにインストールされます:
default-mysql-server galera-3 gawk libaio1 libdbi-perl libjemalloc1 libmpfr4
libreadline5 libsigsegv2 mariadb-client-10.1 mariadb-client-core-10.1
mariadb-common mariadb-server-10.1 mariadb-server-core-10.1 mysql-common
mysql-server rsync socat
アップグレード: 0 個、新規インストール: 18 個、削除: 0 個、保留: 5 個。
25.3 MB のアーカイブを取得する必要があります。
この操作後に追加で 187 MB のディスク容量が消費されます。
続行しますか? [Y/n]
取得:1 http://ftp.jp.debian.org/debian stretch/main amd64 libmpfr4 amd64 3.1.5-1 [556 kB]
取得:2 http://ftp.jp.debian.org/debian stretch/main amd64 libsigsegv2 amd64 2.10-5 [28.9 kB]
取得:3 http://ftp.jp.debian.org/debian stretch/main amd64 gawk amd64 1:4.1.4+dfsg-1 [571 kB]
取得:4 http://ftp.jp.debian.org/debian stretch/main amd64 mysql-common all 5.8+1.0.2 [5,608 B]
取得:5 http://ftp.jp.debian.org/debian stretch/main amd64 mariadb-common all 10.1.26-0+deb9u1 [27.3 kB]
取得:6 http://ftp.jp.debian.org/debian stretch/main amd64 galera-3 amd64 25.3.19-2 [955 kB]
取得:7 http://ftp.jp.debian.org/debian stretch/main amd64 libdbi-perl amd64 1.636-1+b1 [766 kB]
取得:8 http://ftp.jp.debian.org/debian stretch/main amd64 libaio1 amd64 0.3.110-3 [9,412 B]
取得:9 http://ftp.jp.debian.org/debian stretch/main amd64 libreadline5 amd64 5.2+dfsg-3+b1 [119 kB]
取得:10 http://ftp.jp.debian.org/debian stretch/main amd64 mariadb-client-core-10.1 amd64 10.1.26-0+deb9u1 [5,042 kB]
取得:11 http://ftp.jp.debian.org/debian stretch/main amd64 libjemalloc1 amd64 3.6.0-9.1 [89.8 kB]
取得:12 http://ftp.jp.debian.org/debian stretch/main amd64 mariadb-client-10.1 amd64 10.1.26-0+deb9u1 [5,841 kB]
取得:13 http://ftp.jp.debian.org/debian stretch/main amd64 mariadb-server-core-10.1 amd64 10.1.26-0+deb9u1 [5,177 kB]
取得:14 http://ftp.jp.debian.org/debian stretch/main amd64 rsync amd64 3.1.2-1+deb9u1 [393 kB]
取得:15 http://ftp.jp.debian.org/debian stretch/main amd64 socat amd64 1.7.3.1-2+deb9u1 [353 kB]
取得:16 http://ftp.jp.debian.org/debian stretch/main amd64 mariadb-server-10.1 amd64 10.1.26-0+deb9u1 [5,333 kB]
取得:17 http://ftp.jp.debian.org/debian stretch/main amd64 default-mysql-server all 1.0.2 [3,048 B]
取得:18 http://ftp.jp.debian.org/debian stretch/main amd64 mysql-server amd64 5.5.9999+default [1,706 B]
25.3 MB を 3秒 で取得しました (6,759 kB/s)
パッケージを事前設定しています …
以前に未選択のパッケージ libmpfr4:amd64 を選択しています。
(データベースを読み込んでいます … 現在 32005 個のファイルとディレクトリがインストールされています。)
…/libmpfr4_3.1.5-1_amd64.deb を展開する準備をしています …
libmpfr4:amd64 (3.1.5-1) を展開しています…
以前に未選択のパッケージ libsigsegv2:amd64 を選択しています。
…/libsigsegv2_2.10-5_amd64.deb を展開する準備をしています …
libsigsegv2:amd64 (2.10-5) を展開しています…
libmpfr4:amd64 (3.1.5-1) を設定しています …
libsigsegv2:amd64 (2.10-5) を設定しています …
以前に未選択のパッケージ gawk を選択しています。
(データベースを読み込んでいます … 現在 32027 個のファイルとディレクトリがインストールされています。)
…/00-gawk_1%3a4.1.4+dfsg-1_amd64.deb を展開する準備をしています …
gawk (1:4.1.4+dfsg-1) を展開しています…
以前に未選択のパッケージ mysql-common を選択しています。
…/01-mysql-common_5.8+1.0.2_all.deb を展開する準備をしています …
mysql-common (5.8+1.0.2) を展開しています…
以前に未選択のパッケージ mariadb-common を選択しています。
…/02-mariadb-common_10.1.26-0+deb9u1_all.deb を展開する準備をしています …
mariadb-common (10.1.26-0+deb9u1) を展開しています…
以前に未選択のパッケージ galera-3 を選択しています。
…/03-galera-3_25.3.19-2_amd64.deb を展開する準備をしています …
galera-3 (25.3.19-2) を展開しています…
以前に未選択のパッケージ libdbi-perl を選択しています。
…/04-libdbi-perl_1.636-1+b1_amd64.deb を展開する準備をしています …
libdbi-perl (1.636-1+b1) を展開しています…
以前に未選択のパッケージ libaio1:amd64 を選択しています。
…/05-libaio1_0.3.110-3_amd64.deb を展開する準備をしています …
libaio1:amd64 (0.3.110-3) を展開しています…
以前に未選択のパッケージ libreadline5:amd64 を選択しています。
…/06-libreadline5_5.2+dfsg-3+b1_amd64.deb を展開する準備をしています …
libreadline5:amd64 (5.2+dfsg-3+b1) を展開しています…
以前に未選択のパッケージ mariadb-client-core-10.1 を選択しています。
…/07-mariadb-client-core-10.1_10.1.26-0+deb9u1_amd64.deb を展開する準備をしています …
mariadb-client-core-10.1 (10.1.26-0+deb9u1) を展開しています…
以前に未選択のパッケージ libjemalloc1 を選択しています。
…/08-libjemalloc1_3.6.0-9.1_amd64.deb を展開する準備をしています …
libjemalloc1 (3.6.0-9.1) を展開しています…
以前に未選択のパッケージ mariadb-client-10.1 を選択しています。
…/09-mariadb-client-10.1_10.1.26-0+deb9u1_amd64.deb を展開する準備をしています …
mariadb-client-10.1 (10.1.26-0+deb9u1) を展開しています…
以前に未選択のパッケージ mariadb-server-core-10.1 を選択しています。
…/10-mariadb-server-core-10.1_10.1.26-0+deb9u1_amd64.deb を展開する準備をしています …
mariadb-server-core-10.1 (10.1.26-0+deb9u1) を展開しています…
以前に未選択のパッケージ rsync を選択しています。
…/11-rsync_3.1.2-1+deb9u1_amd64.deb を展開する準備をしています …
rsync (3.1.2-1+deb9u1) を展開しています…
以前に未選択のパッケージ socat を選択しています。
…/12-socat_1.7.3.1-2+deb9u1_amd64.deb を展開する準備をしています …
socat (1.7.3.1-2+deb9u1) を展開しています…
mysql-common (5.8+1.0.2) を設定しています …
update-alternatives: /etc/mysql/my.cnf (my.cnf) を提供するために自動モードで /etc/mysql/my.cnf.fallback を使います
mariadb-common (10.1.26-0+deb9u1) を設定しています …
update-alternatives: /etc/mysql/my.cnf (my.cnf) を提供するために自動モードで /etc/mysql/mariadb.cnf を使います
以前に未選択のパッケージ mariadb-server-10.1 を選択しています。
(データベースを読み込んでいます … 現在 32607 個のファイルとディレクトリがインストールされています。)
…/mariadb-server-10.1_10.1.26-0+deb9u1_amd64.deb を展開する準備をしています …
mariadb-server-10.1 (10.1.26-0+deb9u1) を展開しています…
以前に未選択のパッケージ default-mysql-server を選択しています。
…/default-mysql-server_1.0.2_all.deb を展開する準備をしています …
default-mysql-server (1.0.2) を展開しています…
以前に未選択のパッケージ mysql-server を選択しています。
…/mysql-server_5.5.9999+default_amd64.deb を展開する準備をしています …
mysql-server (5.5.9999+default) を展開しています…
libjemalloc1 (3.6.0-9.1) を設定しています …
socat (1.7.3.1-2+deb9u1) を設定しています …
gawk (1:4.1.4+dfsg-1) を設定しています …
rsync (3.1.2-1+deb9u1) を設定しています …
Created symlink /etc/systemd/system/multi-user.target.wants/rsync.service → /lib/systemd/system/rsync.service.
libc-bin (2.24-11+deb9u3) のトリガを処理しています …
libaio1:amd64 (0.3.110-3) を設定しています …
galera-3 (25.3.19-2) を設定しています …
systemd (232-25+deb9u4) のトリガを処理しています …
man-db (2.7.6.1-2) のトリガを処理しています …
libreadline5:amd64 (5.2+dfsg-3+b1) を設定しています …
libdbi-perl (1.636-1+b1) を設定しています …
mariadb-server-core-10.1 (10.1.26-0+deb9u1) を設定しています …
mariadb-client-core-10.1 (10.1.26-0+deb9u1) を設定しています …
mariadb-client-10.1 (10.1.26-0+deb9u1) を設定しています …
mariadb-server-10.1 (10.1.26-0+deb9u1) を設定しています …
Created symlink /etc/systemd/system/mysql.service → /lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /lib/systemd/system/mariadb.service.
default-mysql-server (1.0.2) を設定しています …
mysql-server (5.5.9999+default) を設定しています …
libc-bin (2.24-11+deb9u3) のトリガを処理しています …
systemd (232-25+deb9u4) のトリガを処理しています …
#

phpでmysqlを利用する場合は、php-mysqlもインストールする。

# apt-get install php-mysql
パッケージリストを読み込んでいます… 完了
依存関係ツリーを作成しています
状態情報を読み取っています… 完了
以下の追加パッケージがインストールされます:
php7.0-mysql
以下のパッケージが新たにインストールされます:
php-mysql php7.0-mysql
アップグレード: 0 個、新規インストール: 2 個、削除: 0 個、保留: 5 個。
129 kB のアーカイブを取得する必要があります。
この操作後に追加で 502 kB のディスク容量が消費されます。
続行しますか? [Y/n] y
取得:1 http://ftp.jp.debian.org/debian stretch/main amd64 php7.0-mysql amd64 7.0.30-0+deb9u1 [124 kB]
取得:2 http://ftp.jp.debian.org/debian stretch/main amd64 php-mysql all 1:7.0+49 [5,052 B]
129 kB を 0秒 で取得しました (273 kB/s)
以前に未選択のパッケージ php7.0-mysql を選択しています。
(データベースを読み込んでいます … 現在 32751 個のファイルとディレクトリがインストールされています。)
…/php7.0-mysql_7.0.30-0+deb9u1_amd64.deb を展開する準備をしています …
php7.0-mysql (7.0.30-0+deb9u1) を展開しています…
以前に未選択のパッケージ php-mysql を選択しています。
…/php-mysql_1%3a7.0+49_all.deb を展開する準備をしています …
php-mysql (1:7.0+49) を展開しています…
php7.0-mysql (7.0.30-0+deb9u1) を設定しています …

Creating config file /etc/php/7.0/mods-available/mysqlnd.ini with new version

Creating config file /etc/php/7.0/mods-available/mysqli.ini with new version

Creating config file /etc/php/7.0/mods-available/pdo_mysql.ini with new version
libapache2-mod-php7.0 (7.0.30-0+deb9u1) のトリガを処理しています …
php-mysql (1:7.0+49) を設定しています …
#

管理者

Debian9 stretch PostgreSQLのインストール

Debian9 stretchにPostgreSQLをインストールする。

本体価格今なら0円!!【novas WiMAX】


# apt-get install postgresql
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
以下の追加パッケージがインストールされます:
libpq5 postgresql-9.6 postgresql-client-9.6 postgresql-client-common postgresql-common ssl-cert
提案パッケージ:
postgresql-doc locales-all postgresql-doc-9.6 openssl-blacklist
推奨パッケージ:
postgresql-contrib-9.6 sysstat
以下のパッケージが新たにインストールされます:
libpq5 postgresql postgresql-9.6 postgresql-client-9.6 postgresql-client-common postgresql-common ssl-cert
アップグレード: 0 個、新規インストール: 7 個、削除: 0 個、保留: 5 個。
6,135 kB のアーカイブを取得する必要があります。
この操作後に追加で 28.8 MB のディスク容量が消費されます。
続行しますか? [Y/n]
取得:1 http://security.debian.org/debian-security stretch/updates/main amd64 libpq5 amd64 9.6.10-0+deb9u1 [136 kB]
取得:2 http://security.debian.org/debian-security stretch/updates/main amd64 postgresql-client-9.6 amd64 9.6.10-0+deb9u1 [1,279 kB]
取得:3 http://ftp.jp.debian.org/debian stretch/main amd64 postgresql-client-common all 181+deb9u2 [79.2 kB]
取得:4 http://ftp.jp.debian.org/debian stretch/main amd64 ssl-cert all 1.0.39 [20.8 kB]
取得:5 http://ftp.jp.debian.org/debian stretch/main amd64 postgresql-common all 181+deb9u2 [217 kB]
取得:6 http://ftp.jp.debian.org/debian stretch/main amd64 postgresql all 9.6+181+deb9u2 [55.8 kB]
取得:7 http://security.debian.org/debian-security stretch/updates/main amd64 postgresql-9.6 amd64 9.6.10-0+deb9u1 [4,348 kB]
6,135 kB を 1秒 で取得しました (5,654 kB/s)
パッケージを事前設定しています ...
以前に未選択のパッケージ libpq5:amd64 を選択しています。
(データベースを読み込んでいます ... 現在 31346 個のファイルとディレクトリがインストールされています。)
.../0-libpq5_9.6.10-0+deb9u1_amd64.deb を展開する準備をしています ...
libpq5:amd64 (9.6.10-0+deb9u1) を展開しています...
以前に未選択のパッケージ postgresql-client-common を選択しています。
.../1-postgresql-client-common_181+deb9u2_all.deb を展開する準備をしています ...
postgresql-client-common (181+deb9u2) を展開しています...
以前に未選択のパッケージ postgresql-client-9.6 を選択しています。
.../2-postgresql-client-9.6_9.6.10-0+deb9u1_amd64.deb を展開する準備をしています ...
postgresql-client-9.6 (9.6.10-0+deb9u1) を展開しています...
以前に未選択のパッケージ ssl-cert を選択しています。
.../3-ssl-cert_1.0.39_all.deb を展開する準備をしています ...
ssl-cert (1.0.39) を展開しています...
以前に未選択のパッケージ postgresql-common を選択しています。
.../4-postgresql-common_181+deb9u2_all.deb を展開する準備をしています ...
'postgresql-common による /usr/bin/pg_config から /usr/bin/pg_config.libpq-dev への退避 (divert)' を追加しています
postgresql-common (181+deb9u2) を展開しています...
以前に未選択のパッケージ postgresql-9.6 を選択しています。
.../5-postgresql-9.6_9.6.10-0+deb9u1_amd64.deb を展開する準備をしています ...
postgresql-9.6 (9.6.10-0+deb9u1) を展開しています...
以前に未選択のパッケージ postgresql を選択しています。
.../6-postgresql_9.6+181+deb9u2_all.deb を展開する準備をしています ...
postgresql (9.6+181+deb9u2) を展開しています...
ssl-cert (1.0.39) を設定しています ...
libpq5:amd64 (9.6.10-0+deb9u1) を設定しています ...
libc-bin (2.24-11+deb9u3) のトリガを処理しています ...
postgresql-client-common (181+deb9u2) を設定しています ...
systemd (232-25+deb9u4) のトリガを処理しています ...
postgresql-common (181+deb9u2) を設定しています ...
ユーザ postgres をグループ ssl-cert に追加

Creating config file /etc/postgresql-common/createcluster.conf with new version

Creating config file /etc/logrotate.d/postgresql-common with new version
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql.service → /lib/systemd/system/postgresql.service.
man-db (2.7.6.1-2) のトリガを処理しています ...
postgresql-client-9.6 (9.6.10-0+deb9u1) を設定しています ...
update-alternatives: /usr/share/man/man1/psql.1.gz (psql.1.gz) を提供するために自動モードで /usr/share/postgresql/9.6/man/man1/psql.1.gz を使います
postgresql-9.6 (9.6.10-0+deb9u1) を設定しています ...
Creating new cluster 9.6/main ...
config /etc/postgresql/9.6/main
data /var/lib/postgresql/9.6/main
locale ja_JP.UTF-8
socket /var/run/postgresql
port 5432
update-alternatives: /usr/share/man/man1/postmaster.1.gz (postmaster.1.gz) を提供するために自動モードで /usr/share/postgresql/9.6/man/man1/postmaster.1.gz を使います
postgresql (9.6+181+deb9u2) を設定しています ...
systemd (232-25+deb9u4) のトリガを処理しています ...
#

管理者

Debian9 stretchでifconfigを使う

Debian9 stretchでは、標準ではifconfigが利用できない。

net-tools というパッケージを入れるとifconfigが利用できるようになる。


# apt-get install net-tools
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています
状態情報を読み取っています... 完了
以下のパッケージが新たにインストールされます:
net-tools
アップグレード: 0 個、新規インストール: 1 個、削除: 0 個、保留: 5 個。
248 kB のアーカイブを取得する必要があります。
この操作後に追加で 963 kB のディスク容量が消費されます。
取得:1 http://ftp.jp.debian.org/debian stretch/main amd64 net-tools amd64 1.60+git20161116.90da8a0-1 [248 kB]
248 kB を 0秒 で取得しました (497 kB/s)
以前に未選択のパッケージ net-tools を選択しています。
(データベースを読み込んでいます ... 現在 31290 個のファイルとディレクトリがインストールされています。)
.../net-tools_1.60+git20161116.90da8a0-1_amd64.deb を展開する準備をしています ...
net-tools (1.60+git20161116.90da8a0-1) を展開しています...
man-db (2.7.6.1-2) のトリガを処理しています ...
net-tools (1.60+git20161116.90da8a0-1) を設定しています ...
#

これで、ifconfigやnettoolsが利用できる。

WordPressを使うならロリポップ!
簡単インストール完備で楽々スタート!

管理者

Debian9 apache2.4+php7の導入

apache2.4のインストール
# apt-get install apache2

php7のインストール
# pat-get install php7



管理者

Debian9 stretch スクリーンショット

shutterをインストールする
# apt-get install shutter

アクセサリ→スクリーンショット
で起動する。

管理者

Debian9 Stretch Windowsにリモートデスクトップ接続

freerdp-x11をインストールする
# apt -y install freerdp-x11

freerdpを起動する
$ xfreerdp -g 800×600 -u [ユーザー名] [IPアドレス]

管理者

Debian9 Stretch タッチパッドのタップを可能にする

synapticsタッチパッドのタップをONにする設定

ディレクトリを移動
# cd /usr/share/X11/xorg.conf.d

エディタで 40-libinput.conf を編集する。

下記のように、
「Option “Tapping” “on”」の1行を追加する。

Section “InputClass”
Identifier “libinput touchpad catchall
MatchIsTouchPad “on”
MatchDevicePath “/dev/input/event*”
Driver “libinput”
Option “Tapping” “on”
EndSection

管理者

AWStats 再集計

集計ファイルを作成します。

/var/www/awstats/awstats.pl -updates -config=[FQDN] -logfile=[ログファイル名]

管理者

AWStats ログファイルのマージ

マージファイルを作成します。

logresolvemerge.pl [アクセスログファイルA] [アクセスログファイルB] > [出力ファイル]

アクセスログ ・・・ ApacheなどのWebサーバのアクセスログ

出力ファイル ・・・ 出力したい場所とファイル名を指定

ワイルドカードで複数のファイルを指定することもできる。

# logresolvemerge.pl /var/log/httpd/sitename/access_log* /var/log/httpd/sitename/ssl_access_log* > /var/lib/awstats/merge.log

管理者

Redmine3.3のインストール(CentOS7.3)

Red Hat Software Collections (RHSCL)

Ruby 2.3 をパッケージでインストールするために RHSCL 2.3 相当の centos-sclo-rh リポジトリを追加

# yum install -y centos-release-scl-rh
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.iij.ad.jp
* centosplus: ftp.iij.ad.jp
* extras: ftp.iij.ad.jp
* updates: ftp.iij.ad.jp
Resolving Dependencies
–> Running transaction check
—> Package centos-release-scl-rh.noarch 0:2-2.el7.centos will be installed
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
centos-release-scl-rh noarch 2-2.el7.centos extras 12 k

Transaction Summary
================================================================================
Install 1 Package

Total download size: 12 k
Installed size: 19 k
Downloading packages:
centos-release-scl-rh-2-2.el7.centos.noarch.rpm | 12 kB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : centos-release-scl-rh-2-2.el7.centos.noarch 1/1
Verifying : centos-release-scl-rh-2-2.el7.centos.noarch 1/1

Installed:
centos-release-scl-rh.noarch 0:2-2.el7.centos

Complete!

Ruby2.3をインストール

# yum -y install rh-ruby23 && source scl_source enable $_
echo -e ‘#!/bin/bash\nsource scl_source enable rh-ruby23’ > /etc/profile.d/rh-ruby23.sh

Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : scl-utils-20130529-17.el7_1.x86_64 1/13
Installing : rh-ruby23-runtime-2.2-7.el7.x86_64 2/13
Installing : rh-ruby23-ruby-libs-2.3.1-64.el7.x86_64 3/13
Installing : rh-ruby23-rubygem-io-console-0.4.5-64.el7.x86_64 4/13
Installing : rh-ruby23-rubygem-did_you_mean-1.0.0-64.el7.x86_64 5/13
Installing : rh-ruby23-rubygem-psych-2.0.17-64.el7.x86_64 6/13
Installing : rh-ruby23-ruby-irb-2.3.1-64.el7.noarch 7/13
Installing : rh-ruby23-ruby-2.3.1-64.el7.x86_64 8/13
Installing : rh-ruby23-rubygem-bigdecimal-1.2.8-64.el7.x86_64 9/13
Installing : rh-ruby23-rubygems-2.5.1-64.el7.noarch 10/13
Installing : rh-ruby23-rubygem-json-1.8.3-64.el7.x86_64 11/13
Installing : rh-ruby23-rubygem-rdoc-4.2.1-64.el7.noarch 12/13
Installing : rh-ruby23-2.2-7.el7.x86_64 13/13
Verifying : rh-ruby23-rubygem-json-1.8.3-64.el7.x86_64 1/13
Verifying : rh-ruby23-rubygem-io-console-0.4.5-64.el7.x86_64 2/13
Verifying : rh-ruby23-ruby-2.3.1-64.el7.x86_64 3/13
Verifying : rh-ruby23-rubygem-rdoc-4.2.1-64.el7.noarch 4/13
Verifying : rh-ruby23-rubygem-did_you_mean-1.0.0-64.el7.x86_64 5/13
Verifying : rh-ruby23-2.2-7.el7.x86_64 6/13
Verifying : rh-ruby23-ruby-irb-2.3.1-64.el7.noarch 7/13
Verifying : rh-ruby23-rubygem-psych-2.0.17-64.el7.x86_64 8/13
Verifying : rh-ruby23-ruby-libs-2.3.1-64.el7.x86_64 9/13
Verifying : rh-ruby23-rubygem-bigdecimal-1.2.8-64.el7.x86_64 10/13
Verifying : rh-ruby23-runtime-2.2-7.el7.x86_64 11/13
Verifying : rh-ruby23-rubygems-2.5.1-64.el7.noarch 12/13
Verifying : scl-utils-20130529-17.el7_1.x86_64 13/13

Installed:
rh-ruby23.x86_64 0:2.2-7.el7

Dependency Installed:
rh-ruby23-ruby.x86_64 0:2.3.1-64.el7
rh-ruby23-ruby-irb.noarch 0:2.3.1-64.el7
rh-ruby23-ruby-libs.x86_64 0:2.3.1-64.el7
rh-ruby23-rubygem-bigdecimal.x86_64 0:1.2.8-64.el7
rh-ruby23-rubygem-did_you_mean.x86_64 0:1.0.0-64.el7
rh-ruby23-rubygem-io-console.x86_64 0:0.4.5-64.el7
rh-ruby23-rubygem-json.x86_64 0:1.8.3-64.el7
rh-ruby23-rubygem-psych.x86_64 0:2.0.17-64.el7
rh-ruby23-rubygem-rdoc.noarch 0:4.2.1-64.el7
rh-ruby23-rubygems.noarch 0:2.5.1-64.el7
rh-ruby23-runtime.x86_64 0:2.2-7.el7
scl-utils.x86_64 0:20130529-17.el7_1

Complete!

Phusion Passenger のインストール

ln -s /opt/rh/rh-ruby23/root/usr/lib64/libruby.so.2.3 /usr/lib64/
yum -y install rh-passenger40 rh-passenger40-mod_passenger && source scl_source enable rh-passenger40
echo -e ‘#!/bin/bash\nsource scl_source enable rh-passenger40’ > /etc/profile.d/rh-passenger40.sh

rh-passenger40 は rh-ruby22 までしか対応していないが、rh-ruby22 だと bundle exec rake generate_secret_token を実行した際に何故か Could not find rake in any of the sources というエラーでこけるため、rh-ruby23 / rh-passenger40 の組合せ。

Git

yum -y install rh-git29 && source scl_source enable $_
echo -e ‘#!/bin/bash\nsource scl_source enable rh-git29’ > /etc/profile.d/rh-git29.sh

base リポジトリだと 1.8.3 がインストールされるため RHSCL の rh-git29 コレクションを利用する。

必要ライブラリのインストール

# yum install -y rh-ruby23-{ruby-devel,rubygem-bundler}
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.iij.ad.jp
* centosplus: ftp.iij.ad.jp
* extras: ftp.iij.ad.jp
* updates: ftp.iij.ad.jp
Resolving Dependencies
–> Running transaction check
—> Package rh-ruby23-ruby-devel.x86_64 0:2.3.1-64.el7 will be installed
—> Package rh-ruby23-rubygem-bundler.noarch 0:1.10.6-4.el7 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================
Package Arch Version Repository Size
==================================================================================================
Installing:
rh-ruby23-ruby-devel x86_64 2.3.1-64.el7 centos-sclo-rh 110 k
rh-ruby23-rubygem-bundler noarch 1.10.6-4.el7 centos-sclo-rh 229 k

Transaction Summary
==================================================================================================
Install 2 Packages

Total download size: 338 k
Installed size: 964 k
Downloading packages:
(1/2): rh-ruby23-ruby-devel-2.3.1-64.el7.x86_64.rpm | 110 kB 00:00:01
(2/2): rh-ruby23-rubygem-bundler-1.10.6-4.el7.noarch.rpm | 229 kB 00:00:01
————————————————————————————————–
Total 182 kB/s | 338 kB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : rh-ruby23-rubygem-bundler-1.10.6-4.el7.noarch 1/2
Installing : rh-ruby23-ruby-devel-2.3.1-64.el7.x86_64 2/2
Verifying : rh-ruby23-ruby-devel-2.3.1-64.el7.x86_64 1/2
Verifying : rh-ruby23-rubygem-bundler-1.10.6-4.el7.noarch 2/2

Installed:
rh-ruby23-ruby-devel.x86_64 0:2.3.1-64.el7 rh-ruby23-rubygem-bundler.noarch 0:1.10.6-4.el7

Complete!

# yum install -y gcc {mysql-community,libxml2,libxslt,ImageMagick}-devel ipa-pgothic-fonts
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: ftp.iij.ad.jp
* centosplus: ftp.iij.ad.jp
* extras: ftp.iij.ad.jp
* updates: ftp.iij.ad.jp
Package gcc-4.8.5-11.el7.x86_64 already installed and latest version
No package mysql-community-devel available.
Package libxml2-devel-2.9.1-6.el7_2.3.x86_64 already installed and latest version
Package ImageMagick-devel-6.7.8.9-15.el7_2.x86_64 already installed and latest version
Resolving Dependencies
–> Running transaction check
—> Package ipa-pgothic-fonts.noarch 0:003.03-5.el7 will be installed
—> Package libxslt-devel.x86_64 0:1.1.28-5.el7 will be installed
–> Processing Dependency: libgcrypt-devel for package: libxslt-devel-1.1.28-5.el7.x86_64
–> Running transaction check
—> Package libgcrypt-devel.x86_64 0:1.5.3-13.el7_3.1 will be installed
–> Processing Dependency: libgpg-error-devel for package: libgcrypt-devel-1.5.3-13.el7_3.1.x86_64
–> Running transaction check
—> Package libgpg-error-devel.x86_64 0:1.12-3.el7 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

==================================================================================================
Package Arch Version Repository Size
==================================================================================================
Installing:
ipa-pgothic-fonts noarch 003.03-5.el7 base 3.5 M
libxslt-devel x86_64 1.1.28-5.el7 base 309 k
Installing for dependencies:
libgcrypt-devel x86_64 1.5.3-13.el7_3.1 updates 129 k
libgpg-error-devel x86_64 1.12-3.el7 base 16 k

Transaction Summary
==================================================================================================
Install 2 Packages (+2 Dependent packages)

Total download size: 4.0 M
Installed size: 8.6 M
Downloading packages:
(1/4): libgcrypt-devel-1.5.3-13.el7_3.1.x86_64.rpm | 129 kB 00:00:00
(2/4): libgpg-error-devel-1.12-3.el7.x86_64.rpm | 16 kB 00:00:00
(3/4): ipa-pgothic-fonts-003.03-5.el7.noarch.rpm | 3.5 MB 00:00:00
(4/4): libxslt-devel-1.1.28-5.el7.x86_64.rpm | 309 kB 00:00:00
————————————————————————————————–
Total 6.1 MB/s | 4.0 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : libgpg-error-devel-1.12-3.el7.x86_64 1/4
Installing : libgcrypt-devel-1.5.3-13.el7_3.1.x86_64 2/4
Installing : libxslt-devel-1.1.28-5.el7.x86_64 3/4
Installing : ipa-pgothic-fonts-003.03-5.el7.noarch 4/4
Verifying : ipa-pgothic-fonts-003.03-5.el7.noarch 1/4
Verifying : libgpg-error-devel-1.12-3.el7.x86_64 2/4
Verifying : libxslt-devel-1.1.28-5.el7.x86_64 3/4
Verifying : libgcrypt-devel-1.5.3-13.el7_3.1.x86_64 4/4

Installed:
ipa-pgothic-fonts.noarch 0:003.03-5.el7 libxslt-devel.x86_64 0:1.1.28-5.el7

Dependency Installed:
libgcrypt-devel.x86_64 0:1.5.3-13.el7_3.1 libgpg-error-devel.x86_64 0:1.12-3.el7

Complete!

Redmine のインストール

cd /var/www && git clone https://github.com/redmine/redmine.git && cd redmine
git checkout `git tag | tail -n 1`
bundle config build.nokogiri –local –use-system-libraries
cat << "_EOF_" > config/database.yml
production:
adapter: mysql2
database: redmine
host: localhost
username: root
password: P@ssw0rd
encoding: utf8
_EOF_
bundle install –without development test
bundle exec rake generate_secret_token
bundle exec rake db:migrate RAILS_ENV=production
bundle exec rake redmine:load_default_data RAILS_ENV=production REDMINE_LANG=ja
chown -R apache. /var/www/redmine
chmod -R 755 files log tmp public/plugin_assets
setenforce 0 #TODO: SELinux Settings

そのままだと nokogiri のインストール時に An error occurred while installing nokogiri, and Bundler cannot continue. とエラーが出るので、–use-system-libraries オプションを事前に指定してやる。

rh-ror42-rubygem-bundler 以外にも rubygem パッケージがあるが、バージョンが足りないものやパッケージ化されていないものもあり、また検証した結果不具合が生じるのでパッケージ利用を断念。

bundle exec rails server webrick -e production -b 192.168.56.101 を実行すると簡易的に http://192.168.56.101:3000/ でアクセスできるようになるので、切り分けが必要なときなどに利用する。

管理者