diff-eq.comスケールアップマイグレーション2
diff-eq.comスケールアップマイグレーション2
前回からの続きになります。この度のマイグレーションは運用を始めてから2か月弱ほどたっていないという異例の速さになりますがその理由は微分方程式いろいろを運用し始めてわかったことですが、たとえVPSであってもCentOS7という古いイメージによることの脆弱性、レイテンシ問題があったからになります。初めからやり直しているのはログの取得や手順の再確認、それ以外にも私はWordPressに関してはほぼ素人なのでその練度の向上なんかを目的にやっています。なのでかなり冗長な内容になっているのでそのへんはご承知おきください。
Apache+PHP+PostgreSQL+MariaDB+VIMのインストール
dnf install -y httpd mod_ssl httpd-tools httpd-devel httpd-manual php php-cli php-gd php-pdo php-mbstring mariadb mariadb-server vim
dnf install -y httpd mod_ssl httpd-tools httpd-devel httpd-manual php php-cli php-gd php-pdo php-mbstring mariadb mariadb-server vim
dnf install -y httpd mod_ssl httpd-tools httpd-devel httpd-manual php php-cli php-gd php-pdo php-mbstring mariadb mariadb-server vim
以下のように表示されることを確認します。
・・・・・
pkgconf-m4-1.7.3-10.el9.noarch
pkgconf-pkg-config-1.7.3-10.el9.x86_64
sscg-3.0.0-7.el9.x86_64
vim-common-2:8.2.2637-20.el9.x86_64
vim-enhanced-2:8.2.2637-20.el9.x86_64
vim-filesystem-2:8.2.2637-20.el9.noarch
xml-common-0.6.3-58.el9.noarch
Complete!
[root@ik1-123-46789 centos]#
・・・・・
pkgconf-m4-1.7.3-10.el9.noarch
pkgconf-pkg-config-1.7.3-10.el9.x86_64
sscg-3.0.0-7.el9.x86_64
vim-common-2:8.2.2637-20.el9.x86_64
vim-enhanced-2:8.2.2637-20.el9.x86_64
vim-filesystem-2:8.2.2637-20.el9.noarch
xml-common-0.6.3-58.el9.noarch
Complete!
[root@ik1-123-46789 centos]#
・・・・・ pkgconf-m4-1.7.3-10.el9.noarch pkgconf-pkg-config-1.7.3-10.el9.x86_64 sscg-3.0.0-7.el9.x86_64 vim-common-2:8.2.2637-20.el9.x86_64 vim-enhanced-2:8.2.2637-20.el9.x86_64 vim-filesystem-2:8.2.2637-20.el9.noarch xml-common-0.6.3-58.el9.noarch Complete! [root@ik1-123-46789 centos]#
httpdの起動
systemctl enable --now httpd
systemctl enable --now httpd
systemctl enable --now httpd
ファイアウォールの起動
systemctl start firewalld
systemctl enable firewalld
systemctl start firewalld
systemctl enable firewalld
systemctl start firewalld systemctl enable firewalld
Firewallでhttpとhttpsを許可
firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --zone=public --add-service=https --permanent
firewall-cmd --reload
firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --zone=public --add-service=https --permanent
firewall-cmd --reload
firewall-cmd --zone=public --add-service=http --permanent firewall-cmd --zone=public --add-service=https --permanent firewall-cmd --reload
ブラウザに入って以下のように表示されるのを確認します。

再起動させます。
systemctl restart firewalld
systemctl restart firewalld
systemctl restart firewalld
次回サーバ起動時にhttpdも起動させるために次のように入力してEnter。
systemctl enable httpd
systemctl enable httpd
systemctl enable httpd
設定の確認をするために次のように入力してEnter。
systemctl list-unit-files -t service
systemctl list-unit-files -t service
systemctl list-unit-files -t service
httpd.serviceがenableになっているのを確認する。
htcacheclean.service static -
httpd-init.service static -
httpd.service enabled disabled
httpd@.service disabled disabled
initrd-cleanup.service static -
initrd-parse-etc.service static -
initrd-switch-root.service static -
htcacheclean.service static -
httpd-init.service static -
httpd.service enabled disabled
httpd@.service disabled disabled
initrd-cleanup.service static -
initrd-parse-etc.service static -
initrd-switch-root.service static -
htcacheclean.service static - httpd-init.service static - httpd.service enabled disabled httpd@.service disabled disabled initrd-cleanup.service static - initrd-parse-etc.service static - initrd-switch-root.service static -
権限の変更
権限がないとアップロードができないのでその権限の変更を行います。
[root@ik1-123-45678 centos]# cd /var/www
[root@ik1-123-45678 www]# ls -l
total 8
drwxr-xr-x. 2 root root 4096 Feb 14 21:32 cgi-bin
drwxr-xr-x. 2 root root 4096 Feb 14 21:32 html
[root@ik1-123-45678 www]#
[root@ik1-123-45678 centos]# cd /var/www
[root@ik1-123-45678 www]# ls -l
total 8
drwxr-xr-x. 2 root root 4096 Feb 14 21:32 cgi-bin
drwxr-xr-x. 2 root root 4096 Feb 14 21:32 html
[root@ik1-123-45678 www]#
[root@ik1-123-45678 centos]# cd /var/www [root@ik1-123-45678 www]# ls -l total 8 drwxr-xr-x. 2 root root 4096 Feb 14 21:32 cgi-bin drwxr-xr-x. 2 root root 4096 Feb 14 21:32 html [root@ik1-123-45678 www]#
所有者をapacheにして所有グループを一般ユーザのvpsuserに変更する。管理者権限でパーミッションを変更します。
次のように入力します。
chown apache:vpsuser html
chmod 775 html
chown apache:vpsuser html
chmod 775 html
chown apache:vpsuser html chmod 775 html
Snapdのインストール(Let’s Encryptに必要)
dnf -y install epel-release
dnf -y install epel-release
dnf -y install epel-release
Installed:
epel-next-release-9-7.el9.noarch epel-release-9-7.el9.noarch
Complete!
[root@ik1-123-45678 www]#
Installed:
epel-next-release-9-7.el9.noarch epel-release-9-7.el9.noarch
Complete!
[root@ik1-123-45678 www]#
Installed: epel-next-release-9-7.el9.noarch epel-release-9-7.el9.noarch Complete! [root@ik1-123-45678 www]#
インストール
systemctl enable --now snapd.service snapd.socket
systemctl enable --now snapd.service snapd.socket
systemctl enable --now snapd.service snapd.socket
ln -s /var/lib/snapd/snap /snap
ln -s /var/lib/snapd/snap /snap
ln -s /var/lib/snapd/snap /snap
Warning: /var/lib/snapd/snap/bin was not found in your $PATH. If you've not
restarted your session since you installed snapd, try doing that.
Please see https://forum.snapcraft.io/t/9469 for more details.
core 16-2.61.2 from Canonical✓ installed
[root@ik1-123-45678 www]#
Warning: /var/lib/snapd/snap/bin was not found in your $PATH. If you've not
restarted your session since you installed snapd, try doing that.
Please see https://forum.snapcraft.io/t/9469 for more details.
core 16-2.61.2 from Canonical✓ installed
[root@ik1-123-45678 www]#
Warning: /var/lib/snapd/snap/bin was not found in your $PATH. If you've not restarted your session since you installed snapd, try doing that. Please see https://forum.snapcraft.io/t/9469 for more details. core 16-2.61.2 from Canonical✓ installed [root@ik1-123-45678 www]#
証明書インストールcertbot
snap install --classic certbot
snap install --classic certbot
snap install --classic certbot
ln -s /snap/bin/certbot /usr/bin/certbot
ln -s /snap/bin/certbot /usr/bin/certbot
ln -s /snap/bin/certbot /usr/bin/certbot
PHPのインストール
dnf --enablerepo=epel install -y phpMyAdmin
dnf --enablerepo=epel install -y phpMyAdmin
dnf --enablerepo=epel install -y phpMyAdmin
以下のように表示されるのを確認します。
Installed:
libicu-67.1-9.el9.x86_64 libzip-1.7.3-8.el9.x86_64
php-intl-8.0.30-1.el9.x86_64 php-mysqlnd-8.0.30-1.el9.x86_64
php-pecl-zip-1.19.2-6.el9.x86_64 php-process-8.0.30-1.el9.x86_64
phpMyAdmin-5.2.1-1.el9.noarch
Complete!
[root@ik1-123-45678 www]#
Installed:
libicu-67.1-9.el9.x86_64 libzip-1.7.3-8.el9.x86_64
php-intl-8.0.30-1.el9.x86_64 php-mysqlnd-8.0.30-1.el9.x86_64
php-pecl-zip-1.19.2-6.el9.x86_64 php-process-8.0.30-1.el9.x86_64
phpMyAdmin-5.2.1-1.el9.noarch
Complete!
[root@ik1-123-45678 www]#
Installed: libicu-67.1-9.el9.x86_64 libzip-1.7.3-8.el9.x86_64 php-intl-8.0.30-1.el9.x86_64 php-mysqlnd-8.0.30-1.el9.x86_64 php-pecl-zip-1.19.2-6.el9.x86_64 php-process-8.0.30-1.el9.x86_64 phpMyAdmin-5.2.1-1.el9.noarch Complete! [root@ik1-123-45678 www]#
phpバージョンの確認
php -v
php -v
php -v
[root@ik1-123-45678 www]# php -v
PHP 8.0.30 (cli) (built: Aug 3 2023 17:13:08) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.30, Copyright (c) Zend Technologies
with Zend OPcache v8.0.30, Copyright (c), by Zend Technologies
[root@ik1-123-45678 www]#
[root@ik1-123-45678 www]# php -v
PHP 8.0.30 (cli) (built: Aug 3 2023 17:13:08) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.30, Copyright (c) Zend Technologies
with Zend OPcache v8.0.30, Copyright (c), by Zend Technologies
[root@ik1-123-45678 www]#
[root@ik1-123-45678 www]# php -v PHP 8.0.30 (cli) (built: Aug 3 2023 17:13:08) ( NTS gcc x86_64 ) Copyright (c) The PHP Group Zend Engine v4.0.30, Copyright (c) Zend Technologies with Zend OPcache v8.0.30, Copyright (c), by Zend Technologies [root@ik1-123-45678 www]#
PHPのファイルアップロード上限サイズの変更
cd /etc
vim php.ini
cd /etc
vim php.ini
cd /etc vim php.ini
以下のように128Mに変更します。
なお検索する場合は最初に“/”を入力してuploadなどと入力してEnterを押下すればその場所に移動して編集ができます。
upload_max_filesize = 128M
upload_max_filesize = 128M
upload_max_filesize = 128M

post_max_size = 128M
post_max_size = 128M
post_max_size = 128M

diff-eq.comスケールアップマイグレーション3へ続きます。
-
分散共分散行列
続きを読む
-
平行軸定理と慣性モーメント
続きを読む
-
線形代数 – 補遺
続きを読む
-
その他重要な性質
続きを読む
-
電磁気学への応用
続きを読む
-
ベクトル場回転問題の答え
続きを読む