[root@esxiserver:~] vmkfstools -Ph /vmfs/volumes/nfsv4test
NFS41-4.01 (Raw Major Version: 0) file system spanning 1 partitions.
File system label (if any): nfsv4test
Mode: public
Capacity 50 GB, 48.0 GB available, file block size 4 KB, max supported file size 16.0 TB
Disk Block Size: 512/512/0
UUID: a135f63e-34806068-0000-000000000000
Partitions spanned (on "notDCS"):
NFS41:a135f63e-34806068-0000-000000000000
NAS VAAI Supported: NO
Is Native Snapshot Capable: NO
[root@esxiserver:~]
ESXi shellからVAAIプラグインをインストールする。
[root@esxiserver:~] esxcli software vib install -d /vmfs/volumes/software/netapp
/nfs_plugin_VAAI/1.1.2/NetAppNasPlugin.v23.zip
Installation Result
Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.
Reboot Required: true
VIBs Installed: NetApp_bootbank_NetAppNasPlugin_1.1.2-3
VIBs Removed:
VIBs Skipped:
[root@esxiserver:~]
この間、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!
$