Aug 31 17:13:54 centos7 kernel: FS-Cache: Loaded
Aug 31 17:13:54 centos7 kernel: FS-Cache: Netfs 'nfs' registered for caching
Aug 31 17:13:54 centos7 kernel: Key type dns_resolver registered
Aug 31 17:13:55 centos7 kernel: NFS: Registering the id_resolver key type
Aug 31 17:13:55 centos7 kernel: Key type id_resolver registered
Aug 31 17:13:55 centos7 kernel: Key type id_legacy registered
Aug 31 17:13:55 centos7 nfsidmap[1748]: nss_getpwnam: name 'root@defaultv4iddomain.com' does not map into domain 'adosakana.local'
Aug 31 17:13:55 centos7 nfsidmap[1750]: nss_name_to_gid: name 'root@defaultv4iddomain.com' does not map into domain 'adosakana.local'
Aug 31 17:13:55 centos7 kernel: nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[root@openeuler ~]# cat /etc/yum.repos.d/openEuler_x86_64.repo
#Copyright (c) [2019] Huawei Technologies Co., Ltd.
#generic-repos is licensed under the Mulan PSL v1.
#You can use this software according to the terms and conditions of the Mulan PSL v1.
#You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL
#THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
#PURPOSE.
#See the Mulan PSL v1 for more details.
[osrepo]
name=osrepo
baseurl=https://repo.openeuler.org/openEuler-20.03-LTS/OS/x86_64/
enabled=1
gpgcheck=1
gpgkey=https://repo.openeuler.org/openEuler-20.03-LTS/OS/x86_64/RPM-GPG-KEY-openEuler
[update]
name=update
baseurl=https://repo.openeuler.org/openEuler-20.03-LTS/update/x86_64/
enabled=1
gpgcheck=0
[EPOL]
name=EPOL
baseurl=https://repo.openeuler.org/openEuler-20.03-LTS/EPOL/x86_64/
enabled=1
gpgcheck=0
[root@openeuler ~]#
これを設定することで「yum update -y」でパッケージアップデートが完了した。
なお、アップデート後はレポジトリファイルがちゃんと設定されて、以下のようになった。
[root@openeuler ~]# cat /etc/yum.repos.d/openEuler.repo
#generic-repos is licensed under the Mulan PSL v2.
#You can use this software according to the terms and conditions of the Mulan PSL v2.
#You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
#THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
#PURPOSE.
#See the Mulan PSL v2 for more details.
[OS]
name=OS
baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/OS/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/OS/$basearch/RPM-GPG-KEY-openEuler
[everything]
name=everything
baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/everything/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/everything/$basearch/RPM-GPG-KEY-openEuler
[EPOL]
name=EPOL
baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/EPOL/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/OS/$basearch/RPM-GPG-KEY-openEuler
[debuginfo]
name=debuginfo
baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/debuginfo/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/debuginfo/$basearch/RPM-GPG-KEY-openEuler
[source]
name=source
baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/source/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/source/RPM-GPG-KEY-openEuler
[update]
name=update
baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/update/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/OS/$basearch/RPM-GPG-KEY-openEuler
[root@openeuler ~]#
この間、Oracle Linux 7ベースのOracle Autonomouse Linux 環境にWordPressサーバを建てる手順を書いたけど、そういえばベースとなるCent OS 7(Oracle Linux 7)環境でWordpressサーバを建てる手順を書いたことなかったな、と書いてみる。
前準備
CentOS7として基本的な設定を行っていく。
準備1:パッケージのアップデート
インストール済みのパッケージを最新にするため「yum update」を実行する
$ sudo yum update -y
準備2:日本時間にする
日本に住んでいる場合、日本時間表記の方が使いやすいので、OSも日本時間表示に設定する。
$ sudo timedatectl set-timezone Japan
変更されたことを確認するには「timedatectl」を実行する。
$ timedatectl
Local time: Tue 2020-07-07 10:04:40 JST
Universal time: Tue 2020-07-07 01:04:40 UTC
RTC time: Tue 2020-07-07 01:04:38
Time zone: Japan (JST, +0900)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
$
# Whether updates should be applied when they are available. Note
# that download_updates must also be yes for the update to be applied.
apply_updates = yes
/etc/yum.repos.d/oracle-php.repo というファイルを作って下記を記載する。(sudo vi /etc/yum.repos.d/oracle-php.repo )
[ol7_developer_php74]
name=Oracle Linux $releasever PHP 7.4 Packages for Development and test ($basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/developer/php74/$basearch/
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=0
enabled=1
[ol7_addons]
name=Oracle Linux $releasever Add ons ($basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/addons/$basearch/
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=0
enabled=1
$ sudo yum install php php-json php-bcmath php-pear-Net-Curl php-gd php-mbstring
<略>
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
php x86_64 7.4.7-1.0.1.el7 ol7_developer_php74 3.4 M
php-bcmath x86_64 7.4.7-1.0.1.el7 ol7_developer_php74 56 k
php-gd x86_64 7.4.7-1.0.1.el7 ol7_developer_php74 72 k
php-json x86_64 7.4.7-1.0.1.el7 ol7_developer_php74 58 k
php-pear-Net-Curl noarch 1.2.5-10.el7 epel 13 k
php-mbstring x86_64 7.4.7-1.0.1.el7 ol7_developer_php74 500 k
Installing for dependencies:
apr x86_64 1.4.8-5.el7 base 103 k
apr-util x86_64 1.5.2-6.el7 base 92 k
dejavu-fonts-common noarch 2.33-6.el7 base 64 k
dejavu-sans-fonts noarch 2.33-6.el7 base 1.4 M
fontconfig x86_64 2.13.0-4.3.el7 base 254 k
fontpackages-filesystem noarch 1.44-8.el7 base 9.9 k
gd-last x86_64 2.1.1-2.el7 ol7_developer_php74 140 k
httpd x86_64 2.4.6-93.el7.centos base 2.7 M
httpd-tools x86_64 2.4.6-93.el7.centos base 92 k
jbigkit-libs x86_64 2.0-11.el7 base 46 k
libX11 x86_64 1.6.7-2.el7 base 607 k
libX11-common noarch 1.6.7-2.el7 base 164 k
libXau x86_64 1.0.8-2.1.el7 base 29 k
libXpm x86_64 3.5.12-1.el7 base 55 k
libjpeg-turbo x86_64 1.2.90-8.el7 base 135 k
libtiff x86_64 4.0.3-32.el7 base 171 k
libvpx x86_64 1.3.0-5.el7_0 base 498 k
libxcb x86_64 1.13-1.el7 base 214 k
libxslt x86_64 1.1.28-5.el7 base 242 k
mailcap noarch 2.1.41-2.el7 base 31 k
php-cli x86_64 7.4.7-1.0.1.el7 ol7_developer_php74 5.1 M
php-common x86_64 7.4.7-1.0.1.el7 ol7_developer_php74 1.1 M
php-pear noarch 1:1.9.4-21.el7 base 357 k
php-process x86_64 7.4.7-1.0.1.el7 ol7_developer_php74 76 k
php-xml x86_64 7.4.7-1.0.1.el7 ol7_developer_php74 185 k
oniguruma x86_64 5.9.5-3.el7 ol7_addons 128 k
Transaction Summary
================================================================================
Install 6 Packages (+26 Dependent packages)
Total download size: 17 M
Installed size: 68 M
Is this ok [y/d/N]: y
<略>
$
「/etc/yum.repos.d/mariadb.repo」というファイルを作り、以下の内容を入力。(sudo vi /etc/yum.repos.d/mariadb.repo)
# MariaDB 10.5 CentOS repository list - created 2020-07-07 02:24 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
そして、mariadb-serverをインストールします。
$ sudo yum install MariaDB-server MariaDB-client
<略>
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
MariaDB-client x86_64 10.5.4-1.el7.centos mariadb 13 M
MariaDB-compat x86_64 10.5.4-1.el7.centos mariadb 2.2 M
replacing mariadb-libs.x86_64 1:5.5.65-1.el7
MariaDB-server x86_64 10.5.4-1.el7.centos mariadb 26 M
Installing for dependencies:
MariaDB-common x86_64 10.5.4-1.el7.centos mariadb 81 k
boost-program-options x86_64 1.53.0-28.el7 base 156 k
galera-4 x86_64 26.4.5-1.el7.centos mariadb 9.5 M
pcre2 x86_64 10.23-2.el7 base 201 k
perl-Compress-Raw-Bzip2 x86_64 2.061-3.el7 base 32 k
perl-Compress-Raw-Zlib x86_64 1:2.061-4.el7 base 57 k
perl-DBI x86_64 1.627-4.el7 base 802 k
perl-Data-Dumper x86_64 2.145-3.el7 base 47 k
perl-IO-Compress noarch 2.061-2.el7 base 260 k
perl-Net-Daemon noarch 0.48-5.el7 base 51 k
perl-PlRPC noarch 0.2020-14.el7 base 36 k
socat x86_64 1.7.3.2-2.el7 base 290 k
Transaction Summary
================================================================================
Install 3 Packages (+12 Dependent packages)
Total download size: 52 M
Is this ok [y/d/N]: y
<略>
$
MariaDBサーバの自動起動を設定します。
$ systemctl list-unit-files|grep mariadb
mariadb.service disabled
mariadb@.service disabled
$ sudo systemctl enable mariadb.service
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
$ systemctl list-unit-files|grep mariadb
mariadb.service enabled
mariadb@.service disabled
$
$ sudo mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 10.5.4-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database DB名 character set utf8;
Query OK, 1 row affected (0.000 sec)
MariaDB [(none)]> grant all on DB名.* to wordpress@localhost identified by 'パスワード';
Query OK, 0 rows affected (0.002 sec)
MariaDB [(none)]> quit
Bye
$
http://~/.well-known/acme-challenge でアクセスした時に上記ディレクトリが開くようApacheの設定を /etc/httpd/conf.d/dehydrated.conf として作成します。(sudo vi /etc/httpd/conf.d/dehydrated.conf )
Alias /.well-known/acme-challenge /var/www/dehydrated
<Directory /var/www/dehydrated/>
</Directory>
Webサーバが自動起動するように設定します。
$ systemctl list-unit-files |grep http
httpd.service disabled
$ sudo systemctl enable httpd.service
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
$ systemctl list-unit-files |grep http
httpd.service enabled
$
続いてWebサーバを起動します。
$ systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: inactive (dead)
Docs: man:httpd(8)
man:apachectl(8)
$ sudo systemctl start httpd.service
$ systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2020-07-07 10:55:23 JST; 14s ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 30854 (httpd)
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"
CGroup: /system.slice/httpd.service
tq30854 /usr/sbin/httpd -DFOREGROUND
tq30855 /usr/sbin/httpd -DFOREGROUND
tq30856 /usr/sbin/httpd -DFOREGROUND
tq30857 /usr/sbin/httpd -DFOREGROUND
tq30858 /usr/sbin/httpd -DFOREGROUND
mq30859 /usr/sbin/httpd -DFOREGROUND
Jul 07 10:55:22 phoenix-websa-jp systemd[1]: Starting The Apache HTTP Server...
Jul 07 10:55:23 phoenix-websa-jp systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.
$
SSL証明書を発行するホスト名を /etc/dehydrated/domains.txt に記載する。(sudo vi /etc/dehydrated/domains.txt)
1行に複数のホスト名を記載するとaliasになります。
登録作業を開始します。
$ sudo dehydrated --register
# INFO: Using main config file /etc/dehydrated/config
# INFO: Using additional config file /etc/dehydrated/conf.d/local.sh
To use dehydrated with this certificate authority you have to agree to their terms of service which you can find here: https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf
To accept these terms of service run `/bin/dehydrated --register --accept-terms`.
$
$ sudo dehydrated --register --accept-terms
# INFO: Using main config file /etc/dehydrated/config
# INFO: Using additional config file /etc/dehydrated/conf.d/local.sh
+ Generating account key...
+ Registering account key with ACME server...
+ Fetching account ID...
+ Done!
$
初回のSSL証明書発行処理を実行します。
$ sudo dehydrated --cron
# INFO: Using main config file /etc/dehydrated/config
# INFO: Using additional config file /etc/dehydrated/conf.d/local.sh
+ Creating chain cache directory /etc/dehydrated/chains
Processing phoenix.websa.jp
+ Creating new directory /etc/dehydrated/certs/phoenix.websa.jp ...
+ Signing domains...
+ Generating private key...
+ Generating signing request...
+ Requesting new certificate order from CA...
+ Received 1 authorizations URLs from the CA
+ Handling authorization for phoenix.websa.jp
+ 1 pending challenge(s)
+ Deploying challenge tokens...
+ Responding to challenge for phoenix.websa.jp authorization...
+ Challenge is valid!
+ Cleaning challenge tokens...
+ Requesting certificate...
+ Checking certificate...
+ Done!
+ Creating fullchain.pem...
+ Done!
$
[ol7_developer_php74]
name=Oracle Linux $releasever PHP 7.4 Packages for Development and test ($basearch)
baseurl=https://yum$ociregion.oracle.com/repo/OracleLinux/OL7/developer/php74/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
そしてphpをインストール
# yum install php
<略>
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
php x86_64 7.4.7-1.0.1.el7 ol7_developer_php74 3.4 M
Installing for dependencies:
apr x86_64 1.4.8-5.el7 al7 103 k
apr-util x86_64 1.5.2-6.0.1.el7 al7 91 k
httpd x86_64 2.4.6-93.0.1.el7 al7 1.2 M
httpd-tools x86_64 2.4.6-93.0.1.el7 al7 92 k
mailcap noarch 2.1.41-2.el7 al7 30 k
php-cli x86_64 7.4.7-1.0.1.el7 ol7_developer_php74 5.1 M
php-common x86_64 7.4.7-1.0.1.el7 ol7_developer_php74 1.1 M
Transaction Summary
================================================================================
Install 1 Package (+7 Dependent packages)
Total download size: 11 M
Installed size: 47 M
Is this ok [y/d/N]: y
<略>
Installed:
php.x86_64 0:7.4.7-1.0.1.el7
Dependency Installed:
apr.x86_64 0:1.4.8-5.el7 apr-util.x86_64 0:1.5.2-6.0.1.el7
httpd.x86_64 0:2.4.6-93.0.1.el7 httpd-tools.x86_64 0:2.4.6-93.0.1.el7
mailcap.noarch 0:2.1.41-2.el7 php-cli.x86_64 0:7.4.7-1.0.1.el7
php-common.x86_64 0:7.4.7-1.0.1.el7
Complete!
#
# yum install MariaDB-server MariaDB-client
<中略>
---> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed
--> Finished Dependency Resolution
Error: Package: MariaDB-client-10.5.4-1.el7.centos.x86_64 (mariadb)
Requires: libpcre2-8.so.0()(64bit)
Error: Package: galera-4-26.4.5-1.el7.centos.x86_64 (mariadb)
Requires: socat
Error: Package: MariaDB-server-10.5.4-1.el7.centos.x86_64 (mariadb)
Requires: libpcre2-8.so.0()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
#
どうやら「pcre2」と「socat」がOracle Autonomous Linuxでは提供されていないパッケージであるようだ。(標準のOralce Linux 7.8ではol7_latestレポジトリに含まれている)
先ほど指定したmariadbレポジトリはRedHat Enterprise Linux 7用だったので、CentOS7用(baseurl=http://yum.mariadb.org/10.5/centos7-amd64 )に変更しても状況は変わらず。
では、とバージョンを10.4に下げてみると成功。成功時のmariadb.repoは以下
# MariaDB 10.4 RedHat repository list - created 2020-06-26 06:01 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/rhel7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
# yum install MariaDB-server MariaDB-client
<略>
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository
Size
================================================================================
Installing:
MariaDB-client x86_64 10.4.13-1.el7.centos mariadb 12 M
MariaDB-compat x86_64 10.4.13-1.el7.centos mariadb 2.2 M
replacing mariadb-libs.x86_64 1:5.5.65-1.el7
MariaDB-server x86_64 10.4.13-1.el7.centos mariadb 26 M
Installing for dependencies:
MariaDB-common x86_64 10.4.13-1.el7.centos mariadb 81 k
boost-program-options x86_64 1.53.0-28.el7 al7 156 k
galera-4 x86_64 26.4.4-1.rhel7.el7.centos mariadb 9.5 M
perl-Compress-Raw-Bzip2 x86_64 2.061-3.el7 al7 32 k
perl-Compress-Raw-Zlib x86_64 1:2.061-4.el7 al7 57 k
perl-DBI x86_64 1.627-4.el7 al7 801 k
perl-Data-Dumper x86_64 2.145-3.el7 al7 47 k
perl-IO-Compress noarch 2.061-2.el7 al7 259 k
perl-Net-Daemon noarch 0.48-5.el7 al7 50 k
perl-PlRPC noarch 0.2020-14.el7 al7 35 k
Transaction Summary
================================================================================
Install 3 Packages (+10 Dependent packages)
Total download size: 51 M
Is this ok [y/d/N]: y
<略>
Installed:
MariaDB-client.x86_64 0:10.4.13-1.el7.centos
MariaDB-compat.x86_64 0:10.4.13-1.el7.centos
MariaDB-server.x86_64 0:10.4.13-1.el7.centos
Dependency Installed:
MariaDB-common.x86_64 0:10.4.13-1.el7.centos
boost-program-options.x86_64 0:1.53.0-28.el7
galera-4.x86_64 0:26.4.4-1.rhel7.el7.centos
perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7
perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7
perl-DBI.x86_64 0:1.627-4.el7
perl-Data-Dumper.x86_64 0:2.145-3.el7
perl-IO-Compress.noarch 0:2.061-2.el7
perl-Net-Daemon.noarch 0:0.48-5.el7
perl-PlRPC.noarch 0:0.2020-14.el7
Replaced:
mariadb-libs.x86_64 1:5.5.65-1.el7
Complete!
#
# systemctl enable mariadb.service
Created symlink from /etc/systemd/system/mysql.service to /usr/lib/systemd/system/mariadb.service.
Created symlink from /etc/systemd/system/mysqld.service to /usr/lib/systemd/system/mariadb.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
#
# systemctl start mariadb
# systemctl status mariadb -l
● mariadb.service - MariaDB 10.4.13 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/mariadb.service.d
mqmigrated-from-my.cnf-settings.conf
Active: active (running) since Fri 2020-06-26 15:08:58 JST; 37s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 9464 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Process: 9419 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
Process: 9417 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
Main PID: 9430 (mysqld)
Status: "Taking your SQL requests now..."
CGroup: /system.slice/mariadb.service
mq9430 /usr/sbin/mysqld
Jun 26 15:08:57 oci.adosakana.local mysqld[9430]: 2020-06-26 15:08:57 0 [Note] InnoDB: 10.4.13 started; log sequence number 60972; transaction id 21
Jun 26 15:08:57 oci.adosakana.local mysqld[9430]: 2020-06-26 15:08:57 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
Jun 26 15:08:57 oci.adosakana.local mysqld[9430]: 2020-06-26 15:08:57 0 [Note] InnoDB: Buffer pool(s) load completed at 200626 15:08:57
Jun 26 15:08:57 oci.adosakana.local mysqld[9430]: 2020-06-26 15:08:57 0 [Note] Plugin 'FEEDBACK' is disabled.
Jun 26 15:08:57 oci.adosakana.local mysqld[9430]: 2020-06-26 15:08:57 0 [Note] Server socket created on IP: '::'.
Jun 26 15:08:58 oci.adosakana.local mysqld[9430]: 2020-06-26 15:08:58 0 [Note] Reading of all Master_info entries succeeded
Jun 26 15:08:58 oci.adosakana.local mysqld[9430]: 2020-06-26 15:08:58 0 [Note] Added new Master_info '' to hash table
Jun 26 15:08:58 oci.adosakana.local mysqld[9430]: 2020-06-26 15:08:58 0 [Note] /usr/sbin/mysqld: ready for connections.
Jun 26 15:08:58 oci.adosakana.local mysqld[9430]: Version: '10.4.13-MariaDB' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server
Jun 26 15:08:58 oci.adosakana.local systemd[1]: Started MariaDB 10.4.13 database server.
#
MariaDB上にWordpress用のデータベースを作成する。
# mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.4.13-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database DB名 character set utf8;
Query OK, 1 row affected (0.000 sec)
MariaDB [(none)]> grant all on DB名.* to wordpress@localhost identified by 'w@rdpress';
Query OK, 0 rows affected (0.002 sec)
MariaDB [(none)]> quit
Bye
#
firewall設定
まずfirewallを開ける。
現状のポート開放状況を確認するため「firewall-cmd –list-all」を実行
# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: ens3
sources:
services: dhcpv6-client ssh
ports:
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
#
# ystemctl enable nginx.service
Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.
# systemctl start nginx.service
# systemctl status nginx.service -l
● nginx.service - nginx - high performance web server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled; vendor preset: disabled)
Active: active (running) since Fri 2020-06-26 15:58:01 JST; 5s ago
Docs: http://nginx.org/en/docs/
Process: 10409 ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf (code=exited, status=0/SUCCESS)
Main PID: 10410 (nginx)
CGroup: /system.slice/nginx.service
tq10410 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.con
mq10411 nginx: worker process
Jun 26 15:58:01 oci.adosakana.local systemd[1]: Starting nginx - high performance web server...
Jun 26 15:58:01 oci.adosakana.local systemd[1]: Can't open PID file /var/run/nginx.pid (yet?) after start: No such file or directory
Jun 26 15:58:01 oci.adosakana.local systemd[1]: Started nginx - high performance web server.
#
location ^~ /.well-known/acme-challenge {
alias /var/www/dehydrated;
break;
}
そして、nginx再起動
# systemctl restart nginx
#
準備が出来たのでdehydratedで登録を開始。
# dehydrated --register
# INFO: Using main config file /usr/local/etc/dehydrated/config
To use dehydrated with this certificate authority you have to agree to their terms of service which you can find here: https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf
To accept these terms of service run `/usr/local/sbin/dehydrated --register --accept-terms`.
# /usr/local/sbin/dehydrated --register --accept-terms
# INFO: Using main config file /usr/local/etc/dehydrated/config
+ Generating account key...
+ Registering account key with ACME server...
+ Fetching account URL...
+ Done!
#
前処理が完了したので、実際のSSL証明書発行処理を実施。
# /usr/local/sbin/dehydrated --cron
# INFO: Using main config file /usr/local/etc/dehydrated/config
Processing oci.adosakana.local
+ Creating new directory /usr/local/etc/dehydrated/certs/oci.adosakana.local ...
+ Signing domains...
+ Generating private key...
+ Generating signing request...
+ Requesting new certificate order from CA...
+ Received 1 authorizations URLs from the CA
+ Handling authorization for oci.adosakana.local
+ 1 pending challenge(s)
+ Deploying challenge tokens...
+ Responding to challenge for oci.adosakana.local authorization...
+ Challenge is valid!
+ Cleaning challenge tokens...
+ Requesting certificate...
+ Checking certificate...
+ Done!
+ Creating fullchain.pem...
+ Done!
#
# curl https://ssl-config.mozilla.org/ffdhe2048.txt > /usr/local/etc/dehydrated/certs/dhparam
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 423 100 423 0 0 680 0 --:--:-- --:--:-- --:--:-- 681
#
そして、nginxを再起動します。
# systemctl restart nginx
#
ブラウザからhttpアクセスすると、httpsアクセスに変換された上で404 Not Found表示となることを確認します。
; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; http://php.net/post-max-size
;post_max_size = 8M
post_max_size = 10M
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
;upload_max_filesize = 2M
upload_max_filesize = 20M