
CentOS5のPHP7更新を断念したので、Web開発に必要な PHP7 系 apache サーバを VMware ESXi 6.7ホスト上に仮想マシンとして、 Ubuntu 20.04 Serverで新たに構築しました。
Ubuntu 20.04 Server インストール
VMware ESXi 6.7ホストに次のような小さな構成で仮想マシンを新規作成します。
公式サイトよりサーバインストールイメージをダウンロードします。
1 |
ubuntu-20.04.2-live-server-amd64.iso 2021-02-01 17:58 1.1G |
イメージを仮想光学ドライブにセットし、仮想マシンを起動、CLIベースのサーバ版インストールは初めてでした。ネットワーク設定のサブネット記述にちょっと戸惑い。
ストレージ設定では、デフォルトでチェックの入っていたLVM使用のオプションを外します。LVMであればオンラインのままディスクを連結して容量を増やすことが出来ますが、仮想ディスクが増えてクローニング管理が複雑になってしまいます。今回は開発用なのでシンプルに済ませます。
次に特化された機能を提示されますが、該当無しでスルーするとインストールは始まり、いつの間にか終わって再起動待ちになっていました。
VMware Tools
OSインストール時に特にオプション等有りませんが、勝手にopen-vm-toolsがインストールされるので、後からホスト側からインストールを促す必要はありませんでした。VMXNET3イーサアダプタを即使えるのは助かります。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# apt search open-vm-tools Sorting... Done Full Text Search... Done open-vm-tools/focal-updates,now 2:11.1.5-1~ubuntu20.04.2 amd64 [installed] Open VMware Tools for virtual machines hosted on VMware (CLI) # lsmod | grep vmw vmw_vsock_vmci_transport 32768 1 vsock 36864 2 vmw_vsock_vmci_transport vmw_balloon 24576 0 vmw_vmci 69632 2 vmw_balloon,vmw_vsock_vmci_transport vmwgfx 299008 1 ttm 106496 1 vmwgfx drm_kms_helper 184320 1 vmwgfx drm 491520 4 vmwgfx,drm_kms_helper,ttm # lshw -class network -short H/W path Device Class Description ================================================ /0/100/15/0 ens160 network VMXNET3 Ethernet Controller # ethtool ens160 Settings for ens160: Supported ports: [ TP ] Supported link modes: 1000baseT/Full 10000baseT/Full Supported pause frame use: No Supports auto-negotiation: No Supported FEC modes: Not reported Advertised link modes: Not reported Advertised pause frame use: No Advertised auto-negotiation: No Advertised FEC modes: Not reported Speed: 10000Mb/s Duplex: Full Port: Twisted Pair PHYAD: 0 Transceiver: internal Auto-negotiation: off MDI-X: Unknown Supports Wake-on: uag Wake-on: d Link detected: yes |
IPv6無効化
今回はこちらの記事(Great Tnx!!)に紹介されている方法のうち、修正範囲が最小で済むGRUBファイルに記述する手法を採りました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:55:66:aa:99:bb brd ff:ff:ff:ff:ff:ff inet 192.168.82.73/24 brd 192.168.82.255 scope global ens160 valid_lft forever preferred_lft forever inet6 fe80::250:56ff:fea8:95ab/64 scope link valid_lft forever preferred_lft forever # nano /etc/default/grub #GRUB_CMDLINE_LINUX_DEFAULT="maybe-ubiquity" #GRUB_CMDLINE_LINUX="" GRUB_CMDLINE_LINUX_DEFAULT="quiet splash ipv6.disable=1" GRUB_CMDLINE_LINUX="ipv6.disable=1" # update-grub Sourcing file `/etc/default/grub' Sourcing file `/etc/default/grub.d/init-select.cfg' Generating grub configuration file ... Found linux image: /boot/vmlinuz-5.4.0-65-generic Found initrd image: /boot/initrd.img-5.4.0-65-generic done # reboot # ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever 2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:55:66:aa:99:bb brd ff:ff:ff:ff:ff:ff inet 192.168.82.73/24 brd 192.168.82.255 scope global ens160 valid_lft forever preferred_lft forever |
SNMPデーモンの有効化
素では入っていないのでインストールする必要があります。
1 |
# apt install snmpd |
デフォルト設定のままでは取得出来る項目が控えめなので、View指定解放モードにします。
1 2 3 |
# Read-only access to everyone to the systemonly view #rocommunity public default -V systemonly rocommunity public default |
仮想マシンのマルチパスエラー対策
システムログを確認してみると、次のようなエントリが頻発していました。
1 2 3 4 5 6 7 8 9 10 11 12 13 |
$ tail -f /var/log/syslog Feb 9 15:10:15 apa3 multipathd[604]: sda: add missing path Feb 9 15:10:15 apa3 multipathd[604]: sda: failed to get udev uid: Invalid argument Feb 9 15:10:15 apa3 multipathd[604]: sda: failed to get sysfs uid: Invalid argument Feb 9 15:10:15 apa3 multipathd[604]: sda: failed to get sgio uid: No such file or directory Feb 9 15:10:20 apa3 multipathd[604]: sda: add missing path Feb 9 15:10:20 apa3 multipathd[604]: sda: failed to get udev uid: Invalid argument Feb 9 15:10:20 apa3 multipathd[604]: sda: failed to get sysfs uid: Invalid argument Feb 9 15:10:20 apa3 multipathd[604]: sda: failed to get sgio uid: No such file or directory Feb 9 15:10:25 apa3 multipathd[604]: sda: add missing path Feb 9 15:10:25 apa3 multipathd[604]: sda: failed to get udev uid: Invalid argument Feb 9 15:10:25 apa3 multipathd[604]: sda: failed to get sysfs uid: Invalid argument Feb 9 15:10:25 apa3 multipathd[604]: sda: failed to get sgio uid: No such file or directory |
調べてみるとUbuntu 20.04をVMware ESXiホスト上に作成すると生じる現象で、いくつか対策が提示されていますが、仮想マシン内で完結するvmxファイルの編集で済ませます。仮想マシンをシャットダウンしたら、vmxファイルをローカルにダウンロード、テキストエディタで以下の設定を追記して、アップロードします。
1 2 |
## add the followign line on vmx file; disk.EnableUUID = "TRUE" |
仮想マシンを起動後、当該エントリが消えていることを確認しました。
apache2とPHP7.4のインストール
システムのセットアップを終え、いよいよapache2をインストールします。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
$ sudo apt install apache2 Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libjansson4 liblua5.2-0 ssl-cert Suggested packages: apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser openssl-blacklist The following NEW packages will be installed: apache2 apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libjansson4 liblua5.2-0 ssl-cert 0 upgraded, 11 newly installed, 0 to remove and 0 not upgraded. Need to get 1,865 kB of archives. After this operation, 8,080 kB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libapr1 amd64 1.6.5-1ubuntu1 [91.4 kB] Get:2 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libaprutil1 amd64 1.6.1-4ubuntu2 [84.7 kB] Get:3 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libaprutil1-dbd-sqlite3 amd64 1.6.1-4ubuntu2 [10.5 kB] Get:4 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libaprutil1-ldap amd64 1.6.1-4ubuntu2 [8,736 B] Get:5 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libjansson4 amd64 2.12-1build1 [28.9 kB] Get:6 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 liblua5.2-0 amd64 5.2.4-1.1build3 [106 kB] Get:7 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 apache2-bin amd64 2.4.41-4ubuntu3.1 [1,180 kB] Get:8 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 apache2-data all 2.4.41-4ubuntu3.1 [158 kB] Get:9 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 apache2-utils amd64 2.4.41-4ubuntu3.1 [83.8 kB] Get:10 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 apache2 amd64 2.4.41-4ubuntu3.1 [95.5 kB] Get:11 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 ssl-cert all 1.0.39 [17.0 kB] Fetched 1,865 kB in 2s (938 kB/s) Preconfiguring packages ... Selecting previously unselected package libapr1:amd64. (Reading database ... 71226 files and directories currently installed.) Preparing to unpack .../00-libapr1_1.6.5-1ubuntu1_amd64.deb ... Unpacking libapr1:amd64 (1.6.5-1ubuntu1) ... Selecting previously unselected package libaprutil1:amd64. Preparing to unpack .../01-libaprutil1_1.6.1-4ubuntu2_amd64.deb ... Unpacking libaprutil1:amd64 (1.6.1-4ubuntu2) ... Selecting previously unselected package libaprutil1-dbd-sqlite3:amd64. Preparing to unpack .../02-libaprutil1-dbd-sqlite3_1.6.1-4ubuntu2_amd64.deb ... Unpacking libaprutil1-dbd-sqlite3:amd64 (1.6.1-4ubuntu2) ... Selecting previously unselected package libaprutil1-ldap:amd64. Preparing to unpack .../03-libaprutil1-ldap_1.6.1-4ubuntu2_amd64.deb ... Unpacking libaprutil1-ldap:amd64 (1.6.1-4ubuntu2) ... Selecting previously unselected package libjansson4:amd64. Preparing to unpack .../04-libjansson4_2.12-1build1_amd64.deb ... Unpacking libjansson4:amd64 (2.12-1build1) ... Selecting previously unselected package liblua5.2-0:amd64. Preparing to unpack .../05-liblua5.2-0_5.2.4-1.1build3_amd64.deb ... Unpacking liblua5.2-0:amd64 (5.2.4-1.1build3) ... Selecting previously unselected package apache2-bin. Preparing to unpack .../06-apache2-bin_2.4.41-4ubuntu3.1_amd64.deb ... Unpacking apache2-bin (2.4.41-4ubuntu3.1) ... Selecting previously unselected package apache2-data. Preparing to unpack .../07-apache2-data_2.4.41-4ubuntu3.1_all.deb ... Unpacking apache2-data (2.4.41-4ubuntu3.1) ... Selecting previously unselected package apache2-utils. Preparing to unpack .../08-apache2-utils_2.4.41-4ubuntu3.1_amd64.deb ... Unpacking apache2-utils (2.4.41-4ubuntu3.1) ... Selecting previously unselected package apache2. Preparing to unpack .../09-apache2_2.4.41-4ubuntu3.1_amd64.deb ... Unpacking apache2 (2.4.41-4ubuntu3.1) ... Selecting previously unselected package ssl-cert. Preparing to unpack .../10-ssl-cert_1.0.39_all.deb ... Unpacking ssl-cert (1.0.39) ... Setting up libapr1:amd64 (1.6.5-1ubuntu1) ... Setting up libjansson4:amd64 (2.12-1build1) ... Setting up ssl-cert (1.0.39) ... Setting up liblua5.2-0:amd64 (5.2.4-1.1build3) ... Setting up apache2-data (2.4.41-4ubuntu3.1) ... Setting up libaprutil1:amd64 (1.6.1-4ubuntu2) ... Setting up libaprutil1-ldap:amd64 (1.6.1-4ubuntu2) ... Setting up libaprutil1-dbd-sqlite3:amd64 (1.6.1-4ubuntu2) ... Setting up apache2-utils (2.4.41-4ubuntu3.1) ... Setting up apache2-bin (2.4.41-4ubuntu3.1) ... Setting up apache2 (2.4.41-4ubuntu3.1) ... Enabling module mpm_event. Enabling module authz_core. Enabling module authz_host. Enabling module authn_core. Enabling module auth_basic. Enabling module access_compat. Enabling module authn_file. Enabling module authz_user. Enabling module alias. Enabling module dir. Enabling module autoindex. Enabling module env. Enabling module mime. Enabling module negotiation. Enabling module setenvif. Enabling module filter. Enabling module deflate. Enabling module status. Enabling module reqtimeout. Enabling conf charset. Enabling conf localized-error-pages. Enabling conf other-vhosts-access-log. Enabling conf security. Enabling conf serve-cgi-bin. Enabling site 000-default. Created symlink /etc/systemd/system/multi-user.target.wants/apache2.service → /lib/systemd/system/apache2.service. Created symlink /etc/systemd/system/multi-user.target.wants/apache-htcacheclean.service → /lib/systemd/system/apache-htcacheclean.service. Processing triggers for ufw (0.36-6) ... Processing triggers for systemd (245.4-4ubuntu3.4) ... Processing triggers for man-db (2.9.1-1) ... Processing triggers for libc-bin (2.31-0ubuntu9.2) ... $ sudo systemctl status apache2 ● apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2021-02-09 02:19:37 UTC; 1min 25s ago Docs: https://httpd.apache.org/docs/2.4/ Main PID: 4742 (apache2) Tasks: 55 (limit: 1074) Memory: 5.2M CGroup: /system.slice/apache2.service ├─4742 /usr/sbin/apache2 -k start ├─4743 /usr/sbin/apache2 -k start └─4744 /usr/sbin/apache2 -k start Feb 09 02:19:37 apa3 systemd[1]: Starting The Apache HTTP Server... Feb 09 02:19:37 apa3 apachectl[4731]: AH00558: apache2: Could not reliably determine the server's fully qualified domain > Feb 09 02:19:37 apa3 systemd[1]: Started The Apache HTTP Server. |
続いてPHP7.4をインストール。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 |
$ sudo apt install php libapache2-mod-php Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libapache2-mod-php7.4 php-common php7.4 php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline Suggested packages: php-pear The following NEW packages will be installed: libapache2-mod-php libapache2-mod-php7.4 php php-common php7.4 php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-readline 0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded. Need to get 4,022 kB of archives. After this operation, 18.0 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 php-common all 2:75 [11.9 kB] Get:2 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-common amd64 7.4.3-4ubuntu2.4 [979 kB] Get:3 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-json amd64 7.4.3-4ubuntu2.4 [19.2 kB] Get:4 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-opcache amd64 7.4.3-4ubuntu2.4 [198 kB] Get:5 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-readline amd64 7.4.3-4ubuntu2.4 [12.6 kB] Get:6 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-cli amd64 7.4.3-4ubuntu2.4 [1,422 kB] Get:7 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 libapache2-mod-php7.4 amd64 7.4.3-4ubuntu2.4 [1,364 kB] Get:8 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libapache2-mod-php all 2:7.4+75 [2,836 B] Get:9 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 php7.4 all 7.4.3-4ubuntu2.4 [9,248 B] Get:10 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 php all 2:7.4+75 [2,712 B] Fetched 4,022 kB in 2s (1,842 kB/s) Selecting previously unselected package php-common. (Reading database ... 71951 files and directories currently installed.) Preparing to unpack .../0-php-common_2%3a75_all.deb ... Unpacking php-common (2:75) ... Selecting previously unselected package php7.4-common. Preparing to unpack .../1-php7.4-common_7.4.3-4ubuntu2.4_amd64.deb ... Unpacking php7.4-common (7.4.3-4ubuntu2.4) ... Selecting previously unselected package php7.4-json. Preparing to unpack .../2-php7.4-json_7.4.3-4ubuntu2.4_amd64.deb ... Unpacking php7.4-json (7.4.3-4ubuntu2.4) ... Selecting previously unselected package php7.4-opcache. Preparing to unpack .../3-php7.4-opcache_7.4.3-4ubuntu2.4_amd64.deb ... Unpacking php7.4-opcache (7.4.3-4ubuntu2.4) ... Selecting previously unselected package php7.4-readline. Preparing to unpack .../4-php7.4-readline_7.4.3-4ubuntu2.4_amd64.deb ... Unpacking php7.4-readline (7.4.3-4ubuntu2.4) ... Selecting previously unselected package php7.4-cli. Preparing to unpack .../5-php7.4-cli_7.4.3-4ubuntu2.4_amd64.deb ... Unpacking php7.4-cli (7.4.3-4ubuntu2.4) ... Selecting previously unselected package libapache2-mod-php7.4. Preparing to unpack .../6-libapache2-mod-php7.4_7.4.3-4ubuntu2.4_amd64.deb ... Unpacking libapache2-mod-php7.4 (7.4.3-4ubuntu2.4) ... Selecting previously unselected package libapache2-mod-php. Preparing to unpack .../7-libapache2-mod-php_2%3a7.4+75_all.deb ... Unpacking libapache2-mod-php (2:7.4+75) ... Selecting previously unselected package php7.4. Preparing to unpack .../8-php7.4_7.4.3-4ubuntu2.4_all.deb ... Unpacking php7.4 (7.4.3-4ubuntu2.4) ... Selecting previously unselected package php. Preparing to unpack .../9-php_2%3a7.4+75_all.deb ... Unpacking php (2:7.4+75) ... Setting up php-common (2:75) ... Created symlink /etc/systemd/system/timers.target.wants/phpsessionclean.timer → /lib/systemd/system/phpsessionclean.timer. Setting up php7.4-common (7.4.3-4ubuntu2.4) ... Creating config file /etc/php/7.4/mods-available/calendar.ini with new version Creating config file /etc/php/7.4/mods-available/ctype.ini with new version Creating config file /etc/php/7.4/mods-available/exif.ini with new version Creating config file /etc/php/7.4/mods-available/fileinfo.ini with new version Creating config file /etc/php/7.4/mods-available/ffi.ini with new version Creating config file /etc/php/7.4/mods-available/ftp.ini with new version Creating config file /etc/php/7.4/mods-available/gettext.ini with new version Creating config file /etc/php/7.4/mods-available/iconv.ini with new version Creating config file /etc/php/7.4/mods-available/pdo.ini with new version Creating config file /etc/php/7.4/mods-available/phar.ini with new version Creating config file /etc/php/7.4/mods-available/posix.ini with new version Creating config file /etc/php/7.4/mods-available/shmop.ini with new version Creating config file /etc/php/7.4/mods-available/sockets.ini with new version Creating config file /etc/php/7.4/mods-available/sysvmsg.ini with new version Creating config file /etc/php/7.4/mods-available/sysvsem.ini with new version Creating config file /etc/php/7.4/mods-available/sysvshm.ini with new version Creating config file /etc/php/7.4/mods-available/tokenizer.ini with new version Setting up php7.4-readline (7.4.3-4ubuntu2.4) ... Creating config file /etc/php/7.4/mods-available/readline.ini with new version Setting up php7.4-opcache (7.4.3-4ubuntu2.4) ... Creating config file /etc/php/7.4/mods-available/opcache.ini with new version Setting up php7.4-json (7.4.3-4ubuntu2.4) ... Creating config file /etc/php/7.4/mods-available/json.ini with new version Setting up php7.4-cli (7.4.3-4ubuntu2.4) ... update-alternatives: using /usr/bin/php7.4 to provide /usr/bin/php (php) in auto mode update-alternatives: using /usr/bin/phar7.4 to provide /usr/bin/phar (phar) in auto mode update-alternatives: using /usr/bin/phar.phar7.4 to provide /usr/bin/phar.phar (phar.phar) in auto mode Creating config file /etc/php/7.4/cli/php.ini with new version Setting up libapache2-mod-php7.4 (7.4.3-4ubuntu2.4) ... Creating config file /etc/php/7.4/apache2/php.ini with new version Module mpm_event disabled. Enabling module mpm_prefork. apache2_switch_mpm Switch to prefork apache2_invoke: Enable module php7.4 Setting up php7.4 (7.4.3-4ubuntu2.4) ... Setting up libapache2-mod-php (2:7.4+75) ... Setting up php (2:7.4+75) ... Processing triggers for man-db (2.9.1-1) ... Processing triggers for php7.4-cli (7.4.3-4ubuntu2.4) ... Processing triggers for libapache2-mod-php7.4 (7.4.3-4ubuntu2.4) ... $ php -v PHP 7.4.3 (cli) (built: Oct 6 2020 15:47:56) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies $ sudo apt install php-fpm php-common php-mbstring php-xmlrpc php-gd php-xml php-mysql php-cli php-zip php-curl php-imagick Reading package lists... Done Building dependency tree Reading state information... Done php-common is already the newest version (2:75). php-common set to manually installed. The following additional packages will be installed: fontconfig-config fonts-dejavu-core fonts-droid-fallback fonts-noto-mono fonts-urw-base35 ghostscript gsfonts imagemagick-6-common libavahi-client3 libavahi-common-data libavahi-common3 libcups2 libfftw3-double3 libfontconfig1 libgd3 libgomp1 libgs9 libgs9-common libidn11 libijs-0.35 libjbig0 libjbig2dec0 libjpeg-turbo8 libjpeg8 liblcms2-2 liblqr-1-0 libmagickcore-6.q16-6 libmagickwand-6.q16-6 libonig5 libopenjp2-7 libpaper-utils libpaper1 libtiff5 libwebp6 libwebpmux3 libxmlrpc-epi0 libxpm4 libzip5 php7.4-curl php7.4-fpm php7.4-gd php7.4-mbstring php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-zip poppler-data ttf-dejavu-core Suggested packages: fonts-noto fonts-freefont-otf | fonts-freefont-ttf fonts-texgyre ghostscript-x cups-common libfftw3-bin libfftw3-dev libgd-tools liblcms2-utils libmagickcore-6.q16-6-extra php-pear poppler-utils fonts-japanese-mincho | fonts-ipafont-mincho fonts-japanese-gothic | fonts-ipafont-gothic fonts-arphic-ukai fonts-arphic-uming fonts-nanum The following NEW packages will be installed: fontconfig-config fonts-dejavu-core fonts-droid-fallback fonts-noto-mono fonts-urw-base35 ghostscript gsfonts imagemagick-6-common libavahi-client3 libavahi-common-data libavahi-common3 libcups2 libfftw3-double3 libfontconfig1 libgd3 libgomp1 libgs9 libgs9-common libidn11 libijs-0.35 libjbig0 libjbig2dec0 libjpeg-turbo8 libjpeg8 liblcms2-2 liblqr-1-0 libmagickcore-6.q16-6 libmagickwand-6.q16-6 libonig5 libopenjp2-7 libpaper-utils libpaper1 libtiff5 libwebp6 libwebpmux3 libxmlrpc-epi0 libxpm4 libzip5 php-cli php-curl php-fpm php-gd php-imagick php-mbstring php-mysql php-xml php-xmlrpc php-zip php7.4-curl php7.4-fpm php7.4-gd php7.4-mbstring php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-zip poppler-data ttf-dejavu-core 0 upgraded, 58 newly installed, 0 to remove and 0 not upgraded. Need to get 23.6 MB of archives. After this operation, 84.8 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 fonts-droid-fallback all 1:6.0.1r16-1.1 [1,805 kB] Get:2 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 libgomp1 amd64 10.2.0-5ubuntu1~20.04 [102 kB] Get:3 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libfftw3-double3 amd64 3.3.8-2ubuntu1 [728 kB] Get:4 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 fonts-dejavu-core all 2.37-1 [1,041 kB] Get:5 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 fontconfig-config all 2.13.1-2ubuntu3 [28.8 kB] Get:6 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libfontconfig1 amd64 2.13.1-2ubuntu3 [114 kB] Get:7 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libjbig0 amd64 2.1-3.1build1 [26.7 kB] Get:8 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 libjpeg-turbo8 amd64 2.0.3-0ubuntu1.20.04.1 [117 kB] Get:9 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libjpeg8 amd64 8c-2ubuntu8 [2,194 B] Get:10 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 liblcms2-2 amd64 2.9-4 [140 kB] Get:11 http://hk.archive.ubuntu.com/ubuntu focal/universe amd64 liblqr-1-0 amd64 0.4.2-2.1 [27.7 kB] Get:12 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libwebp6 amd64 0.6.1-2 [185 kB] Get:13 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libtiff5 amd64 4.1.0+git191117-2build1 [161 kB] Get:14 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libwebpmux3 amd64 0.6.1-2 [19.6 kB] Get:15 http://hk.archive.ubuntu.com/ubuntu focal-updates/universe amd64 imagemagick-6-common all 8:6.9.10.23+dfsg-2.1ubuntu11.2 [60.8 kB] Get:16 http://hk.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libmagickcore-6.q16-6 amd64 8:6.9.10.23+dfsg-2.1ubuntu11.2 [1,645 kB] Get:17 http://hk.archive.ubuntu.com/ubuntu focal-updates/universe amd64 libmagickwand-6.q16-6 amd64 8:6.9.10.23+dfsg-2.1ubuntu11.2 [305 kB] Get:18 http://hk.archive.ubuntu.com/ubuntu focal-updates/universe amd64 php7.4-fpm amd64 7.4.3-4ubuntu2.4 [1,433 kB] Get:19 http://hk.archive.ubuntu.com/ubuntu focal/universe amd64 php-imagick amd64 3.4.4-4 [97.3 kB] Get:20 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 poppler-data all 0.4.9-2 [1,475 kB] Get:21 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 fonts-noto-mono all 20200323-1build1~ubuntu20.04.1 [80.6 kB] Get:22 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 fonts-urw-base35 all 20170801.1-3 [6,333 kB] Get:23 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 libgs9-common all 9.50~dfsg-5ubuntu4.2 [681 kB] Get:24 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libavahi-common-data amd64 0.7-4ubuntu7 [21.4 kB] Get:25 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libavahi-common3 amd64 0.7-4ubuntu7 [21.7 kB] Get:26 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libavahi-client3 amd64 0.7-4ubuntu7 [25.5 kB] Get:27 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 libcups2 amd64 2.3.1-9ubuntu1.1 [233 kB] Get:28 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libidn11 amd64 1.33-2.2ubuntu2 [46.2 kB] Get:29 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libijs-0.35 amd64 0.35-15 [15.7 kB] Get:30 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libjbig2dec0 amd64 0.18-1ubuntu1 [60.0 kB] Get:31 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 libopenjp2-7 amd64 2.3.1-1ubuntu4.20.04.1 [141 kB] Get:32 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libpaper1 amd64 1.1.28 [13.0 kB] Get:33 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 libgs9 amd64 9.50~dfsg-5ubuntu4.2 [2,172 kB] Get:34 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 ghostscript amd64 9.50~dfsg-5ubuntu4.2 [51.6 kB] Get:35 http://hk.archive.ubuntu.com/ubuntu focal/universe amd64 gsfonts all 1:8.11+urwcyr1.0.7~pre44-4.4 [3,120 kB] Get:36 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libxpm4 amd64 1:3.5.12-1 [34.0 kB] Get:37 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libgd3 amd64 2.2.5-5.2ubuntu2 [118 kB] Get:38 http://hk.archive.ubuntu.com/ubuntu focal/universe amd64 libonig5 amd64 6.9.4-1 [142 kB] Get:39 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libpaper-utils amd64 1.1.28 [8,400 B] Get:40 http://hk.archive.ubuntu.com/ubuntu focal/universe amd64 libzip5 amd64 1.5.1-0ubuntu1 [46.7 kB] Get:41 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 php-cli all 2:7.4+75 [2,792 B] Get:42 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-curl amd64 7.4.3-4ubuntu2.4 [31.0 kB] Get:43 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 php-curl all 2:7.4+75 [2,000 B] Get:44 http://hk.archive.ubuntu.com/ubuntu focal/universe amd64 php-fpm all 2:7.4+75 [2,792 B] Get:45 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-gd amd64 7.4.3-4ubuntu2.4 [28.0 kB] Get:46 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 php-gd all 2:7.4+75 [2,000 B] Get:47 http://hk.archive.ubuntu.com/ubuntu focal-updates/universe amd64 php7.4-mbstring amd64 7.4.3-4ubuntu2.4 [397 kB] Get:48 http://hk.archive.ubuntu.com/ubuntu focal/universe amd64 php-mbstring all 2:7.4+75 [2,012 B] Get:49 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-mysql amd64 7.4.3-4ubuntu2.4 [121 kB] Get:50 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 php-mysql all 2:7.4+75 [2,000 B] Get:51 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-xml amd64 7.4.3-4ubuntu2.4 [97.6 kB] Get:52 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 php-xml all 2:7.4+75 [2,028 B] Get:53 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 libxmlrpc-epi0 amd64 0.54.2-1.2 [30.5 kB] Get:54 http://hk.archive.ubuntu.com/ubuntu focal-updates/main amd64 php7.4-xmlrpc amd64 7.4.3-4ubuntu2.4 [13.0 kB] Get:55 http://hk.archive.ubuntu.com/ubuntu focal/main amd64 php-xmlrpc all 2:7.4+75 [2,008 B] Get:56 http://hk.archive.ubuntu.com/ubuntu focal-updates/universe amd64 php7.4-zip amd64 7.4.3-4ubuntu2.4 [21.5 kB] Get:57 http://hk.archive.ubuntu.com/ubuntu focal/universe amd64 php-zip all 2:7.4+75 [1,996 B] Get:58 http://hk.archive.ubuntu.com/ubuntu focal/universe amd64 ttf-dejavu-core all 2.37-1 [2,978 B] Fetched 23.6 MB in 4s (5,610 kB/s) Extracting templates from packages: 100% Preconfiguring packages ... Selecting previously unselected package fonts-droid-fallback. (Reading database ... 72093 files and directories currently installed.) Preparing to unpack .../00-fonts-droid-fallback_1%3a6.0.1r16-1.1_all.deb ... Unpacking fonts-droid-fallback (1:6.0.1r16-1.1) ... Selecting previously unselected package libgomp1:amd64. Preparing to unpack .../01-libgomp1_10.2.0-5ubuntu1~20.04_amd64.deb ... Unpacking libgomp1:amd64 (10.2.0-5ubuntu1~20.04) ... Selecting previously unselected package libfftw3-double3:amd64. Preparing to unpack .../02-libfftw3-double3_3.3.8-2ubuntu1_amd64.deb ... Unpacking libfftw3-double3:amd64 (3.3.8-2ubuntu1) ... Selecting previously unselected package fonts-dejavu-core. Preparing to unpack .../03-fonts-dejavu-core_2.37-1_all.deb ... Unpacking fonts-dejavu-core (2.37-1) ... Selecting previously unselected package fontconfig-config. Preparing to unpack .../04-fontconfig-config_2.13.1-2ubuntu3_all.deb ... Unpacking fontconfig-config (2.13.1-2ubuntu3) ... Selecting previously unselected package libfontconfig1:amd64. Preparing to unpack .../05-libfontconfig1_2.13.1-2ubuntu3_amd64.deb ... Unpacking libfontconfig1:amd64 (2.13.1-2ubuntu3) ... Selecting previously unselected package libjbig0:amd64. Preparing to unpack .../06-libjbig0_2.1-3.1build1_amd64.deb ... Unpacking libjbig0:amd64 (2.1-3.1build1) ... Selecting previously unselected package libjpeg-turbo8:amd64. Preparing to unpack .../07-libjpeg-turbo8_2.0.3-0ubuntu1.20.04.1_amd64.deb ... Unpacking libjpeg-turbo8:amd64 (2.0.3-0ubuntu1.20.04.1) ... Selecting previously unselected package libjpeg8:amd64. Preparing to unpack .../08-libjpeg8_8c-2ubuntu8_amd64.deb ... Unpacking libjpeg8:amd64 (8c-2ubuntu8) ... Selecting previously unselected package liblcms2-2:amd64. Preparing to unpack .../09-liblcms2-2_2.9-4_amd64.deb ... Unpacking liblcms2-2:amd64 (2.9-4) ... Selecting previously unselected package liblqr-1-0:amd64. Preparing to unpack .../10-liblqr-1-0_0.4.2-2.1_amd64.deb ... Unpacking liblqr-1-0:amd64 (0.4.2-2.1) ... Selecting previously unselected package libwebp6:amd64. Preparing to unpack .../11-libwebp6_0.6.1-2_amd64.deb ... Unpacking libwebp6:amd64 (0.6.1-2) ... Selecting previously unselected package libtiff5:amd64. Preparing to unpack .../12-libtiff5_4.1.0+git191117-2build1_amd64.deb ... Unpacking libtiff5:amd64 (4.1.0+git191117-2build1) ... Selecting previously unselected package libwebpmux3:amd64. Preparing to unpack .../13-libwebpmux3_0.6.1-2_amd64.deb ... Unpacking libwebpmux3:amd64 (0.6.1-2) ... Selecting previously unselected package imagemagick-6-common. Preparing to unpack .../14-imagemagick-6-common_8%3a6.9.10.23+dfsg-2.1ubuntu11.2_all.deb ... Unpacking imagemagick-6-common (8:6.9.10.23+dfsg-2.1ubuntu11.2) ... Selecting previously unselected package libmagickcore-6.q16-6:amd64. Preparing to unpack .../15-libmagickcore-6.q16-6_8%3a6.9.10.23+dfsg-2.1ubuntu11.2_amd64.deb ... Unpacking libmagickcore-6.q16-6:amd64 (8:6.9.10.23+dfsg-2.1ubuntu11.2) ... Selecting previously unselected package libmagickwand-6.q16-6:amd64. Preparing to unpack .../16-libmagickwand-6.q16-6_8%3a6.9.10.23+dfsg-2.1ubuntu11.2_amd64.deb ... Unpacking libmagickwand-6.q16-6:amd64 (8:6.9.10.23+dfsg-2.1ubuntu11.2) ... Selecting previously unselected package php7.4-fpm. Preparing to unpack .../17-php7.4-fpm_7.4.3-4ubuntu2.4_amd64.deb ... Unpacking php7.4-fpm (7.4.3-4ubuntu2.4) ... Selecting previously unselected package php-imagick. Preparing to unpack .../18-php-imagick_3.4.4-4_amd64.deb ... Unpacking php-imagick (3.4.4-4) ... Selecting previously unselected package poppler-data. Preparing to unpack .../19-poppler-data_0.4.9-2_all.deb ... Unpacking poppler-data (0.4.9-2) ... Selecting previously unselected package fonts-noto-mono. Preparing to unpack .../20-fonts-noto-mono_20200323-1build1~ubuntu20.04.1_all.deb ... Unpacking fonts-noto-mono (20200323-1build1~ubuntu20.04.1) ... Selecting previously unselected package fonts-urw-base35. Preparing to unpack .../21-fonts-urw-base35_20170801.1-3_all.deb ... Unpacking fonts-urw-base35 (20170801.1-3) ... Selecting previously unselected package libgs9-common. Preparing to unpack .../22-libgs9-common_9.50~dfsg-5ubuntu4.2_all.deb ... Unpacking libgs9-common (9.50~dfsg-5ubuntu4.2) ... Selecting previously unselected package libavahi-common-data:amd64. Preparing to unpack .../23-libavahi-common-data_0.7-4ubuntu7_amd64.deb ... Unpacking libavahi-common-data:amd64 (0.7-4ubuntu7) ... Selecting previously unselected package libavahi-common3:amd64. Preparing to unpack .../24-libavahi-common3_0.7-4ubuntu7_amd64.deb ... Unpacking libavahi-common3:amd64 (0.7-4ubuntu7) ... Selecting previously unselected package libavahi-client3:amd64. Preparing to unpack .../25-libavahi-client3_0.7-4ubuntu7_amd64.deb ... Unpacking libavahi-client3:amd64 (0.7-4ubuntu7) ... Selecting previously unselected package libcups2:amd64. Preparing to unpack .../26-libcups2_2.3.1-9ubuntu1.1_amd64.deb ... Unpacking libcups2:amd64 (2.3.1-9ubuntu1.1) ... Selecting previously unselected package libidn11:amd64. Preparing to unpack .../27-libidn11_1.33-2.2ubuntu2_amd64.deb ... Unpacking libidn11:amd64 (1.33-2.2ubuntu2) ... Selecting previously unselected package libijs-0.35:amd64. Preparing to unpack .../28-libijs-0.35_0.35-15_amd64.deb ... Unpacking libijs-0.35:amd64 (0.35-15) ... Selecting previously unselected package libjbig2dec0:amd64. Preparing to unpack .../29-libjbig2dec0_0.18-1ubuntu1_amd64.deb ... Unpacking libjbig2dec0:amd64 (0.18-1ubuntu1) ... Selecting previously unselected package libopenjp2-7:amd64. Preparing to unpack .../30-libopenjp2-7_2.3.1-1ubuntu4.20.04.1_amd64.deb ... Unpacking libopenjp2-7:amd64 (2.3.1-1ubuntu4.20.04.1) ... Selecting previously unselected package libpaper1:amd64. Preparing to unpack .../31-libpaper1_1.1.28_amd64.deb ... Unpacking libpaper1:amd64 (1.1.28) ... Selecting previously unselected package libgs9:amd64. Preparing to unpack .../32-libgs9_9.50~dfsg-5ubuntu4.2_amd64.deb ... Unpacking libgs9:amd64 (9.50~dfsg-5ubuntu4.2) ... Selecting previously unselected package ghostscript. Preparing to unpack .../33-ghostscript_9.50~dfsg-5ubuntu4.2_amd64.deb ... Unpacking ghostscript (9.50~dfsg-5ubuntu4.2) ... Selecting previously unselected package gsfonts. Preparing to unpack .../34-gsfonts_1%3a8.11+urwcyr1.0.7~pre44-4.4_all.deb ... Unpacking gsfonts (1:8.11+urwcyr1.0.7~pre44-4.4) ... Selecting previously unselected package libxpm4:amd64. Preparing to unpack .../35-libxpm4_1%3a3.5.12-1_amd64.deb ... Unpacking libxpm4:amd64 (1:3.5.12-1) ... Selecting previously unselected package libgd3:amd64. Preparing to unpack .../36-libgd3_2.2.5-5.2ubuntu2_amd64.deb ... Unpacking libgd3:amd64 (2.2.5-5.2ubuntu2) ... Selecting previously unselected package libonig5:amd64. Preparing to unpack .../37-libonig5_6.9.4-1_amd64.deb ... Unpacking libonig5:amd64 (6.9.4-1) ... Selecting previously unselected package libpaper-utils. Preparing to unpack .../38-libpaper-utils_1.1.28_amd64.deb ... Unpacking libpaper-utils (1.1.28) ... Selecting previously unselected package libzip5:amd64. Preparing to unpack .../39-libzip5_1.5.1-0ubuntu1_amd64.deb ... Unpacking libzip5:amd64 (1.5.1-0ubuntu1) ... Selecting previously unselected package php-cli. Preparing to unpack .../40-php-cli_2%3a7.4+75_all.deb ... Unpacking php-cli (2:7.4+75) ... Selecting previously unselected package php7.4-curl. Preparing to unpack .../41-php7.4-curl_7.4.3-4ubuntu2.4_amd64.deb ... Unpacking php7.4-curl (7.4.3-4ubuntu2.4) ... Selecting previously unselected package php-curl. Preparing to unpack .../42-php-curl_2%3a7.4+75_all.deb ... Unpacking php-curl (2:7.4+75) ... Selecting previously unselected package php-fpm. Preparing to unpack .../43-php-fpm_2%3a7.4+75_all.deb ... Unpacking php-fpm (2:7.4+75) ... Selecting previously unselected package php7.4-gd. Preparing to unpack .../44-php7.4-gd_7.4.3-4ubuntu2.4_amd64.deb ... Unpacking php7.4-gd (7.4.3-4ubuntu2.4) ... Selecting previously unselected package php-gd. Preparing to unpack .../45-php-gd_2%3a7.4+75_all.deb ... Unpacking php-gd (2:7.4+75) ... Selecting previously unselected package php7.4-mbstring. Preparing to unpack .../46-php7.4-mbstring_7.4.3-4ubuntu2.4_amd64.deb ... Unpacking php7.4-mbstring (7.4.3-4ubuntu2.4) ... Selecting previously unselected package php-mbstring. Preparing to unpack .../47-php-mbstring_2%3a7.4+75_all.deb ... Unpacking php-mbstring (2:7.4+75) ... Selecting previously unselected package php7.4-mysql. Preparing to unpack .../48-php7.4-mysql_7.4.3-4ubuntu2.4_amd64.deb ... Unpacking php7.4-mysql (7.4.3-4ubuntu2.4) ... Selecting previously unselected package php-mysql. Preparing to unpack .../49-php-mysql_2%3a7.4+75_all.deb ... Unpacking php-mysql (2:7.4+75) ... Selecting previously unselected package php7.4-xml. Preparing to unpack .../50-php7.4-xml_7.4.3-4ubuntu2.4_amd64.deb ... Unpacking php7.4-xml (7.4.3-4ubuntu2.4) ... Selecting previously unselected package php-xml. Preparing to unpack .../51-php-xml_2%3a7.4+75_all.deb ... Unpacking php-xml (2:7.4+75) ... Selecting previously unselected package libxmlrpc-epi0:amd64. Preparing to unpack .../52-libxmlrpc-epi0_0.54.2-1.2_amd64.deb ... Unpacking libxmlrpc-epi0:amd64 (0.54.2-1.2) ... Selecting previously unselected package php7.4-xmlrpc. Preparing to unpack .../53-php7.4-xmlrpc_7.4.3-4ubuntu2.4_amd64.deb ... Unpacking php7.4-xmlrpc (7.4.3-4ubuntu2.4) ... Selecting previously unselected package php-xmlrpc. Preparing to unpack .../54-php-xmlrpc_2%3a7.4+75_all.deb ... Unpacking php-xmlrpc (2:7.4+75) ... Selecting previously unselected package php7.4-zip. Preparing to unpack .../55-php7.4-zip_7.4.3-4ubuntu2.4_amd64.deb ... Unpacking php7.4-zip (7.4.3-4ubuntu2.4) ... Selecting previously unselected package php-zip. Preparing to unpack .../56-php-zip_2%3a7.4+75_all.deb ... Unpacking php-zip (2:7.4+75) ... Selecting previously unselected package ttf-dejavu-core. Preparing to unpack .../57-ttf-dejavu-core_2.37-1_all.deb ... Unpacking ttf-dejavu-core (2.37-1) ... Setting up liblcms2-2:amd64 (2.9-4) ... Setting up libpaper1:amd64 (1.1.28) ... Creating config file /etc/papersize with new version Setting up imagemagick-6-common (8:6.9.10.23+dfsg-2.1ubuntu11.2) ... Setting up php7.4-xml (7.4.3-4ubuntu2.4) ... Creating config file /etc/php/7.4/mods-available/dom.ini with new version Creating config file /etc/php/7.4/mods-available/simplexml.ini with new version Creating config file /etc/php/7.4/mods-available/xml.ini with new version Creating config file /etc/php/7.4/mods-available/xmlreader.ini with new version Creating config file /etc/php/7.4/mods-available/xmlwriter.ini with new version Creating config file /etc/php/7.4/mods-available/xsl.ini with new version Setting up fonts-noto-mono (20200323-1build1~ubuntu20.04.1) ... Setting up libxpm4:amd64 (1:3.5.12-1) ... Setting up php7.4-curl (7.4.3-4ubuntu2.4) ... Creating config file /etc/php/7.4/mods-available/curl.ini with new version Setting up php7.4-mysql (7.4.3-4ubuntu2.4) ... Creating config file /etc/php/7.4/mods-available/mysqlnd.ini with new version Creating config file /etc/php/7.4/mods-available/mysqli.ini with new version Creating config file /etc/php/7.4/mods-available/pdo_mysql.ini with new version Setting up php7.4-fpm (7.4.3-4ubuntu2.4) ... Creating config file /etc/php/7.4/fpm/php.ini with new version NOTICE: Not enabling PHP 7.4 FPM by default. NOTICE: To enable PHP 7.4 FPM in Apache2 do: NOTICE: a2enmod proxy_fcgi setenvif NOTICE: a2enconf php7.4-fpm NOTICE: You are seeing this message because you have apache2 package installed. Created symlink /etc/systemd/system/multi-user.target.wants/php7.4-fpm.service → /lib/systemd/system/php7.4-fpm.service. Setting up libzip5:amd64 (1.5.1-0ubuntu1) ... Setting up libijs-0.35:amd64 (0.35-15) ... Setting up libxmlrpc-epi0:amd64 (0.54.2-1.2) ... Setting up libpaper-utils (1.1.28) ... Setting up fonts-urw-base35 (20170801.1-3) ... Setting up libgomp1:amd64 (10.2.0-5ubuntu1~20.04) ... Setting up libjbig0:amd64 (2.1-3.1build1) ... Setting up poppler-data (0.4.9-2) ... Setting up php7.4-zip (7.4.3-4ubuntu2.4) ... Creating config file /etc/php/7.4/mods-available/zip.ini with new version Setting up libjbig2dec0:amd64 (0.18-1ubuntu1) ... Setting up libidn11:amd64 (1.33-2.2ubuntu2) ... Setting up gsfonts (1:8.11+urwcyr1.0.7~pre44-4.4) ... Setting up libavahi-common-data:amd64 (0.7-4ubuntu7) ... Setting up libwebp6:amd64 (0.6.1-2) ... Setting up fonts-dejavu-core (2.37-1) ... Setting up libjpeg-turbo8:amd64 (2.0.3-0ubuntu1.20.04.1) ... Setting up libfftw3-double3:amd64 (3.3.8-2ubuntu1) ... Setting up php-fpm (2:7.4+75) ... Setting up php-cli (2:7.4+75) ... Setting up liblqr-1-0:amd64 (0.4.2-2.1) ... Setting up php-zip (2:7.4+75) ... Setting up libopenjp2-7:amd64 (2.3.1-1ubuntu4.20.04.1) ... Setting up fonts-droid-fallback (1:6.0.1r16-1.1) ... Setting up libwebpmux3:amd64 (0.6.1-2) ... Setting up ttf-dejavu-core (2.37-1) ... Setting up libonig5:amd64 (6.9.4-1) ... Setting up libjpeg8:amd64 (8c-2ubuntu8) ... Setting up libgs9-common (9.50~dfsg-5ubuntu4.2) ... Setting up php-xml (2:7.4+75) ... Setting up php-curl (2:7.4+75) ... Setting up php-mysql (2:7.4+75) ... Setting up php7.4-xmlrpc (7.4.3-4ubuntu2.4) ... Creating config file /etc/php/7.4/mods-available/xmlrpc.ini with new version Setting up fontconfig-config (2.13.1-2ubuntu3) ... Setting up libavahi-common3:amd64 (0.7-4ubuntu7) ... Setting up php7.4-mbstring (7.4.3-4ubuntu2.4) ... Creating config file /etc/php/7.4/mods-available/mbstring.ini with new version Setting up php-mbstring (2:7.4+75) ... Setting up php-xmlrpc (2:7.4+75) ... Setting up libtiff5:amd64 (4.1.0+git191117-2build1) ... Setting up libfontconfig1:amd64 (2.13.1-2ubuntu3) ... Setting up libavahi-client3:amd64 (0.7-4ubuntu7) ... Setting up libmagickcore-6.q16-6:amd64 (8:6.9.10.23+dfsg-2.1ubuntu11.2) ... Setting up libgd3:amd64 (2.2.5-5.2ubuntu2) ... Setting up libcups2:amd64 (2.3.1-9ubuntu1.1) ... Setting up libmagickwand-6.q16-6:amd64 (8:6.9.10.23+dfsg-2.1ubuntu11.2) ... Setting up php-imagick (3.4.4-4) ... Setting up php7.4-gd (7.4.3-4ubuntu2.4) ... Creating config file /etc/php/7.4/mods-available/gd.ini with new version Setting up libgs9:amd64 (9.50~dfsg-5ubuntu4.2) ... Setting up ghostscript (9.50~dfsg-5ubuntu4.2) ... Setting up php-gd (2:7.4+75) ... Processing triggers for libc-bin (2.31-0ubuntu9.2) ... Processing triggers for systemd (245.4-4ubuntu3.4) ... Processing triggers for man-db (2.9.1-1) ... Processing triggers for libapache2-mod-php7.4 (7.4.3-4ubuntu2.4) ... Processing triggers for php7.4-cli (7.4.3-4ubuntu2.4) ... Processing triggers for php7.4-fpm (7.4.3-4ubuntu2.4) ... NOTICE: Not enabling PHP 7.4 FPM by default. NOTICE: To enable PHP 7.4 FPM in Apache2 do: NOTICE: a2enmod proxy_fcgi setenvif NOTICE: a2enconf php7.4-fpm NOTICE: You are seeing this message because you have apache2 package installed. |
Debian系apacheの設定
今まで使っていたCentOS(RedHat系)では、バーチャルホストのポートやパス設定が全て1つの設定ファイルhttpd.confに網羅されていましたが、Debian系では全く違うのでカルチャーショック。その構造と役割を理解するに辺り、こちらのまとめが大変わかりやすくて助かりました。
とその前にサービスステータスをチェックしていると、繰り返し発生しているAH00558エラーを見付けたので対策します。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
$ sudo service apache2 status ● apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2021-02-09 03:11:00 UTC; 37s ago Docs: https://httpd.apache.org/docs/2.4/ Process: 20335 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS) Main PID: 20349 (apache2) Tasks: 6 (limit: 1074) Memory: 14.0M CGroup: /system.slice/apache2.service ├─20352 /usr/sbin/apache2 -k start ├─20353 /usr/sbin/apache2 -k start └─20354 /usr/sbin/apache2 -k start Feb 09 03:11:00 apa3 systemd[1]: Starting The Apache HTTP Server... Feb 09 03:11:00 apa3 apachectl[20348]: AH00558: apache2: Could not reliably determine the server's fully qualified domain> Feb 09 03:11:00 apa3 systemd[1]: Started The Apache HTTP Server. |
これはfqdn.confにhostnameを正しく記述し、その設定を有効にすることで解消します。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
$ sudo nano /etc/apache2/conf-available/fqdn.conf $ sudo a2enconf fqdn Enabling conf fqdn. To activate the new configuration, you need to run: systemctl reload apache2 $ sudo service apache2 restart $ sudo service apache2 status ● apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2021-02-09 03:12:23 UTC; 2s ago Docs: https://httpd.apache.org/docs/2.4/ Process: 20426 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS) Main PID: 20440 (apache2) Tasks: 6 (limit: 1074) Memory: 13.8M CGroup: /system.slice/apache2.service ├─20443 /usr/sbin/apache2 -k start ├─20444 /usr/sbin/apache2 -k start └─20445 /usr/sbin/apache2 -k start Feb 09 03:12:23 apa3 systemd[1]: Starting The Apache HTTP Server... Feb 09 03:12:23 apa3 systemd[1]: Started The Apache HTTP Server. |
それではバーチャルホストを作成しましょう。先ずは現在の設定の構成を確認。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
$ tree /etc/apache2/ /etc/apache2/ ├── apache2.conf ├── conf-available ├── conf-enabled │ ├── charset.conf -> ../conf-available/charset.conf │ ├── fqdn.conf -> ../conf-available/fqdn.conf │ ├── localized-error-pages.conf -> ../conf-available/localized-error-pages.conf │ ├── other-vhosts-access-log.conf -> ../conf-available/other-vhosts-access-log.conf │ ├── security.conf -> ../conf-available/security.conf │ └── serve-cgi-bin.conf -> ../conf-available/serve-cgi-bin.conf ├── mods-available ├── mods-enabled │ ├── (略) ├── ports.conf ├── sites-available │ ├── 000-default.conf │ ├── default-ssl.conf └── sites-enabled ├── 000-default.conf -> ../sites-available/000-default.conf |
sites-available下にバーチャルホストの数だけ設定ファイルを記述します。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
$ cat /etc/apache2/sites-available/vhost2.conf <VirtualHost *:8080> ServerName hogehoge.local ServerAdmin webmaster@localhost DocumentRoot /var/www/html2 ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> $ cat /etc/apache2/sites-available/vhost3.conf <VirtualHost *:8081> ServerName piyopiyo.local ServerAdmin webmaster@localhost DocumentRoot /var/www/html3 ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> |
次にバーチャルホストの待ち受けカスタムポートを ports.conf にListenするよう記述します。
1 2 3 4 5 6 7 8 9 |
$ cat /etc/apache2/ports.conf # If you just change the port or add more ports here, you will likely also # have to change the VirtualHost statement in # /etc/apache2/sites-enabled/000-default.conf Listen 80 Listen 8080 Listen 8081 |
最後にバーチャルホストの設定をデプロイし、サービスをリロードさせれば反映されます。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
$ sudo a2ensite vhos2 Enabling site vhost2. To activate the new configuration, you need to run: systemctl reload apache2 $ sudo a2ensite vhost3 Enabling site vhost3. To activate the new configuration, you need to run: systemctl reload apache2 $ sudo systemctl reload apache2 $ tree /etc/apache2/ /etc/apache2/ ├── sites-available │ ├── 000-default.conf │ ├── default-ssl.conf │ ├── vhost2.conf │ ├── vhost3.conf └── sites-enabled ├── 000-default.conf -> ../sites-available/000-default.conf ├── vhost2.conf -> ../sites-available/vhost2.conf └── vhost3.conf -> ../sites-available/vhost3.conf |
ufw簡易設定
今回はあくまで内向き開発用なので、単純にこれまでセットアップしてきたサービスに関するポートを開けておきます。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
$ sudo ufw status Status: inactive $ sudo ufw allow 22 Rules updated $ sudo ufw allow 161/udp Rules updated $ sudo ufw allow 8080:8081/tcp Rules updated $ sudo ufw enable Command may disrupt existing ssh connections. Proceed with operation (y|n)? y Firewall is active and enabled on system startup $ sudo ufw status Status: active To Action From -- ------ ---- Apache ALLOW Anywhere 22 ALLOW Anywhere 161/udp ALLOW Anywhere 8080:8081/tcp ALLOW Anywhere |
起動時にufwが224.0.0.1宛をブロック
起動ログに必ず次のエントリが記録され、IGMP マルチキャストIP 224.0.0.1宛をブロックしているようです。
1 2 |
[12.255690] [UFW BLOCK] IN=ens160 OUT= MAC=00:55:66:aa:99:bb:55:55:55:55:55:55:08:00 SRC=0.0.0.0 DST=224.0.0.1 LEN=36 TOS=0x00 PREC=0xA0 TTL=1 ID=0 PROTO=2 [19.256246] [UFW BLOCK] IN=ens160 OUT= MAC=00:55:66:aa:99:bb:55:55:55:55:55:55:08:00 SRC=0.0.0.0 DST=224.0.0.1 LEN=36 TOS=0x00 PREC=0xA0 TTL=1 ID=0 PROTO=2 |
調べてみて見つかるのは、LAN内のルータが発している場合ばかりなのですが、今回MACに記載されているのは自身のイーサアダプタのMACアドレスでした。気持ち悪いので明示的にブロックします。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
$ sudo ufw status numbered Status: active To Action From -- ------ ---- [ 1] Apache ALLOW IN Anywhere [ 2] 22 ALLOW IN Anywhere [ 3] 161/udp ALLOW IN Anywhere [ 4] 8080:8081/tcp ALLOW IN Anywhere $ sudo ufw deny from any to 224.0.0.1 $ sudo ufw status numbered Status: active To Action From -- ------ ---- [ 1] Apache ALLOW IN Anywhere [ 2] 22 ALLOW IN Anywhere [ 3] 161/udp ALLOW IN Anywhere [ 4] 8080:8081/tcp ALLOW IN Anywhere [ 5] 224.0.0.1 DENY IN Anywhere |
再起動後、起動ログに当該エントリが出ることは無くなりました(ルールを消したい時はこの番号指定が便利)。
これでようやく現代的な開発環境は整いました。ここでPHP7にしても問題ないか検証し、本番サーバのアップグレードに進みます。