Ubuntu 18.04 LTS -> 20.04 LTS on GCP

GCPで運用しているこのサイトのOSをUbuntu 18.04 LTSから20.04LTSにアップグレードした。

gcp用でも問題なく do-release-upgrade -d で上げることができた。なお、gcpでアップグレードを掛けると、Kernelは勝手に5.4.0-1009-gcpになる様だ。(apt/sources.listはhttp://us-west1.gce.archive.ubuntu.com/ubuntu/を参照している)

GCPの問題というわけではなく毎回出る軽微な設定の変更な何点かあった。

  • PHP7.2→7.4になったことによりApacheが起動しない問題
May 02 09:14:18 abel systemd[1]: Starting The Apache HTTP Server... 
May 02 09:14:19 abel apachectl[3698]: apache2: Syntax error on line 146 of /etc/apache2/apache2.conf: Syntax error on line 3 of /etc/apache2/mods-enabled/php7.2.load: Cannot load /usr/lib/apache2/modules/libphp7.2.so into server: /usr/l> 
May 02 09:14:19 abel apachectl[3693]: Action 'start' failed. May 02 09:14:19 abel apachectl[3693]: The Apache error log may have more information. May 02 09:14:19 abel systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE 
May 02 09:14:19 abel systemd[1]: apache2.service: Failed with result 'exit-code'. 
May 02 09:14:19 abel systemd[1]: Failed to start The Apache HTTP Server. 

phpモジュールをリンクしなおして解決
# a2dismod php7.2
# a2enmod php7.4
  • dovecot 2.3系での変更
May 2 09:20:53 abel dovecot: config: Warning: please set ssl_dh=</etc/dovecot/dh.pem
May 2 09:20:53 abel dovecot: config: Warning: You can generate it with: dd if=/var/lib/dovecot/ssl-parameters.dat bs=1 skip=88 | openssl dhparam -inform der > /etc/dovecot/dh.pem 
May 2 09:20:53 abel dovecot: imap-login: Error: Failed to initialize SSL server context: Can't load DH parameters: error:1408518A:SSL routines:ssl3_ctx_ctrl:dh key too small: user=<>, rip=126.203.14.194, lip=10.138.0.3, session=<zjVRRZ+ k7lt+yw7C>

May 02 09:23:52 abel dovecot[4362]: config: Warning: NOTE: You can get a new clean config file with: doveconf -Pn > dovecot-new.conf 
May 02 09:23:52 abel dovecot[4362]: config: Warning: Obsolete setting in /etc/dovecot/conf.d/10-ssl.conf:50: ssl_protocols has been replaced by ssl_min_protocol

DH keyを作れと言われるので以下で作る(2048を指定しないと1024で作られてしまう)
dd if=/var/lib/dovecot/ssl-parameters.dat bs=1 skip=88 | openssl dhparam 2048 -inform der > /etc/dovecot/dh.pem

/etc/dovecot/conf.d/10-ssl.confを以下の様に変更
ssl_dh = </etc/dovecot/dh.pem
# ssl_protocols = TLSv1 TLSv1.1 TLSv1.2
ssl_min_protocol = TLSv1

コメントを残す