最近、Oracle Cloudのコンピュート・インスタンスに、Oracle APEXをインストールしています。ブラウザからAPEXへのアクセスをHTTPSで行うように構成するため、Let's Encryptを使うことにしてみました。
Oracle CloudでLet's EncryptのCertbotを使用する手順が、オラクルの公式ブログに載っています。Todd Sharpさんによる以下の記事です。
Free SSL Certificates In The Oracle Cloud Using CertBot And Let's Encrypt
この記事を見て、Oracle Linuxの開発チームのSVPであるWim Coekaertsさんが、以下のコメントを公式ブログに寄せています。
- Oracle LinuxのyumサーバーはOracle Linux向けのEPELリポジトリを提供しています。
- Oracle Cloudの環境であれば、各リージョンごとにyumサーバーを用意しています。それを使った方が速いし通信費もかかりません。
Using Let's Encrypt with Oracle Linux in Oracle Cloud Infrastructure
以下より、EPELを構成する手順を紹介します。Certbotについては(今回はCertbotを使用しなかったので)、また別の機会に取り組もうと思います。
OracleのYumサーバーの構成方法については、yum.oracle.comのGetting Startedのページに記載されています。
[root@apex ~]# dnf -y install oracle-epel-release-el8
Oracle Linux 8 BaseOS Latest (x86_64) 17 kB/s | 3.6 kB 00:00
Oracle Linux 8 BaseOS Latest (x86_64) 41 MB/s | 46 MB 00:01
Oracle Linux 8 Application Stream (x86_64) 36 kB/s | 3.9 kB 00:00
Oracle Linux 8 Application Stream (x86_64) 31 MB/s | 36 MB 00:01
Oracle Software for OL8 26 kB/s | 2.9 kB 00:00
Latest Unbreakable Enterprise Kernel Release 6 28 kB/s | 3.0 kB 00:00
Latest Unbreakable Enterprise Kernel Release 6 30 MB/s | 47 MB 00:01
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
oracle-epel-release-el8 x86_64 1.0-5.el8 ol8_baseos_latest 15 k
Installing dependencies:
yum-utils noarch 4.0.21-11.0.1.el8 ol8_baseos_latest 74 k
Transaction Summary
================================================================================
Install 2 Packages
Total download size: 89 k
Installed size: 41 k
Downloading Packages:
(1/2): oracle-epel-release-el8-1.0-5.el8.x86_64 61 kB/s | 15 kB 00:00
(2/2): yum-utils-4.0.21-11.0.1.el8.noarch.rpm 236 kB/s | 74 kB 00:00
--------------------------------------------------------------------------------
Total 283 kB/s | 89 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : yum-utils-4.0.21-11.0.1.el8.noarch 1/2
Installing : oracle-epel-release-el8-1.0-5.el8.x86_64 2/2
Running scriptlet: oracle-epel-release-el8-1.0-5.el8.x86_64 2/2
Verifying : oracle-epel-release-el8-1.0-5.el8.x86_64 1/2
Verifying : yum-utils-4.0.21-11.0.1.el8.noarch 2/2
Installed:
oracle-epel-release-el8-1.0-5.el8.x86_64 yum-utils-4.0.21-11.0.1.el8.noarch
Complete!
[root@apex ~]#
[root@apex ~]# cat /etc/yum.repos.d/oracle-epel-ol8.repo
[ol8_developer_EPEL]
name=Oracle Linux $releasever EPEL Packages for Development ($basearch)
baseurl=https://yum$ociregion.$ocidomain/repo/OracleLinux/OL8/developer/EPEL/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
[ol8_developer_EPEL_modular]
name=Oracle Linux $releasever EPEL Modular Packages for Development ($basearch)
baseurl=https://yum$ociregion.$ocidomain/repo/OracleLinux/OL8/developer/EPEL/modular/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
[root@apex ~]#
[root@apex ~]# cd /etc/yum/vars/
[root@apex vars]# cat ociregion
[root@apex vars]# cat ocidomain
oracle.com
[root@apex vars]#
# OCIREGION=$(curl -sfm 3 http://169.254.169.254/opc/v1/instance/ | jq -r '.region' | cut -d '-' -f 2)
# echo "-$OCIREGION" > /etc/yum/vars/ociregion
[root@apex vars]# dnf -y install jq
Last metadata expiration check: 0:19:28 ago on Mon 30 May 2022 12:57:40 PM JST.
Dependencies resolved.
================================================================================
Package Architecture Version Repository Size
================================================================================
Installing:
jq x86_64 1.6-3.el8 ol8_appstream 202 k
Installing dependencies:
oniguruma x86_64 6.8.2-2.el8 ol8_appstream 187 k
Transaction Summary
================================================================================
Install 2 Packages
Total download size: 389 k
Installed size: 1.1 M
Downloading Packages:
(1/2): oniguruma-6.8.2-2.el8.x86_64.rpm 707 kB/s | 187 kB 00:00
(2/2): jq-1.6-3.el8.x86_64.rpm 735 kB/s | 202 kB 00:00
--------------------------------------------------------------------------------
Total 1.4 MB/s | 389 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : oniguruma-6.8.2-2.el8.x86_64 1/2
Running scriptlet: oniguruma-6.8.2-2.el8.x86_64 1/2
Installing : jq-1.6-3.el8.x86_64 2/2
Running scriptlet: jq-1.6-3.el8.x86_64 2/2
Verifying : jq-1.6-3.el8.x86_64 1/2
Verifying : oniguruma-6.8.2-2.el8.x86_64 2/2
Installed:
jq-1.6-3.el8.x86_64 oniguruma-6.8.2-2.el8.x86_64
Complete!
[root@apex vars]#
[root@apex vars]# OCIREGION=$(curl -sfm 3 http://169.254.169.254/opc/v1/instance/ | jq -r '.region' | cut -d '-' -f 2)
[root@apex vars]# echo "-$OCIREGION" > /etc/yum/vars/ociregion
[root@apex vars]# cat ociregion
-us-ashburn-1
[root@apex vars]#
[root@apex ~]# dnf install snapd
Last metadata expiration check: 0:00:24 ago on Mon 30 May 2022 01:25:21 PM JST.
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
snapd x86_64 2.55.3-1.el8 ol8_developer_EPEL 17 M
Installing dependencies:
bash-completion noarch 1:2.7-5.el8 ol8_baseos_latest 274 k
snap-confine x86_64 2.55.3-1.el8 ol8_developer_EPEL 3.6 M
snapd-selinux noarch 2.55.3-1.el8 ol8_developer_EPEL 505 k
Transaction Summary
================================================================================
Install 4 Packages
Total download size: 22 M
Installed size: 67 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): snapd-selinux-2.55.3-1.el8.noarch.rpm 565 kB/s | 505 kB 00:00
(2/4): bash-completion-2.7-5.el8.noarch.rpm 331 kB/s | 274 kB 00:00
(3/4): snap-confine-2.55.3-1.el8.x86_64.rpm 620 kB/s | 3.6 MB 00:05
(4/4): snapd-2.55.3-1.el8.x86_64.rpm 380 kB/s | 17 MB 00:46
--------------------------------------------------------------------------------
Total 477 kB/s | 22 MB 00:46
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : bash-completion-1:2.7-5.el8.noarch 1/4
Running scriptlet: snapd-selinux-2.55.3-1.el8.noarch 2/4
Installing : snapd-selinux-2.55.3-1.el8.noarch 2/4
Running scriptlet: snapd-selinux-2.55.3-1.el8.noarch 2/4
Installing : snap-confine-2.55.3-1.el8.x86_64 3/4
Installing : snapd-2.55.3-1.el8.x86_64 4/4
Running scriptlet: snapd-2.55.3-1.el8.x86_64 4/4
Running scriptlet: snapd-selinux-2.55.3-1.el8.noarch 4/4
Running scriptlet: snapd-2.55.3-1.el8.x86_64 4/4
Verifying : snap-confine-2.55.3-1.el8.x86_64 1/4
Verifying : snapd-2.55.3-1.el8.x86_64 2/4
Verifying : snapd-selinux-2.55.3-1.el8.noarch 3/4
Verifying : bash-completion-1:2.7-5.el8.noarch 4/4
Installed:
bash-completion-1:2.7-5.el8.noarch snap-confine-2.55.3-1.el8.x86_64
snapd-2.55.3-1.el8.x86_64 snapd-selinux-2.55.3-1.el8.noarch
Complete!
[root@apex ~]#
[root@apex ~]# dnf list *release-el8
Last metadata expiration check: 0:12:43 ago on Mon 30 May 2022 01:25:21 PM JST.
Installed Packages
oracle-epel-release-el8.x86_64 1.0-5.el8 @ol8_baseos_latest
oraclelinux-release-el8.x86_64 1.0-23.el8 @ol8_baseos_latest
Available Packages
mysql-release-el8.src 1.0-3.el8 ol8_baseos_latest
mysql-release-el8.x86_64 1.0-3.el8 ol8_baseos_latest
oracle-epel-release-el8.src 1.0-5.el8 ol8_baseos_latest
oracle-gluster-release-el8.src 1.0-2.el8 ol8_baseos_latest
oracle-gluster-release-el8.x86_64 1.0-2.el8 ol8_baseos_latest
oracle-instantclient-release-el8.src 1.0-1.el8 ol8_baseos_latest
oracle-instantclient-release-el8.x86_64 1.0-1.el8 ol8_baseos_latest
oracle-linux-manager-client-release-el8.src 1.0-1.el8 ol8_baseos_latest
oracle-linux-manager-client-release-el8.x86_64 1.0-1.el8 ol8_baseos_latest
oracle-olcne-release-el8.src 1.0-6.el8 ol8_baseos_latest
oracle-olcne-release-el8.x86_64 1.0-6.el8 ol8_baseos_latest
oracle-ovirt-release-el8.src 1.0-1.0.3.el8 ol8_baseos_latest
oracle-ovirt-release-el8.x86_64 1.0-1.0.3.el8 ol8_baseos_latest
oracle-release-el8.src 1.0-1.el8 ol8_baseos_latest
oracle-release-el8.x86_64 1.0-1.el8 ol8_baseos_latest
oracle-software-release-el8.src 1.0-1.el8 ol8_baseos_latest
oracle-software-release-el8.x86_64 1.0-1.el8 ol8_baseos_latest
oracle-spacewalk-client-release-el8.src 1.0-1.el8 ol8_baseos_latest
oracle-spacewalk-client-release-el8.x86_64 1.0-1.el8 ol8_baseos_latest
oraclelinux-automation-manager-release-el8.src 1.0-1.el8 ol8_baseos_latest
oraclelinux-automation-manager-release-el8.x86_64
1.0-1.el8 ol8_baseos_latest
oraclelinux-developer-release-el8.src 1.0-7.el8 ol8_baseos_latest
oraclelinux-developer-release-el8.x86_64 1.0-7.el8 ol8_baseos_latest
oraclelinux-release-el8.src 1.0-23.el8 ol8_baseos_latest
[root@apex ~]#
[root@apex ~]# dnf -y install oracle-software-release-el8
Last metadata expiration check: 0:18:02 ago on Mon 30 May 2022 01:25:21 PM JST.
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
oracle-software-release-el8 x86_64 1.0-1.el8 ol8_baseos_latest 15 k
Transaction Summary
================================================================================
Install 1 Package
Total download size: 15 k
Installed size: 18 k
Downloading Packages:
oracle-software-release-el8-1.0-1.el8.x86_64.rp 151 kB/s | 15 kB 00:00
--------------------------------------------------------------------------------
Total 149 kB/s | 15 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : oracle-software-release-el8-1.0-1.el8.x86_64 1/1
Verifying : oracle-software-release-el8-1.0-1.el8.x86_64 1/1
Installed:
oracle-software-release-el8-1.0-1.el8.x86_64
Complete!
[root@apex ~]#
[root@apex ~]# cat /etc/yum.repos.d/oracle-software-ol8.repo
[ol8_oracle_software]
name=Oracle Software for Oracle Linux $releasever ($basearch)
baseurl=https://yum$ociregion.$ocidomain/repo/OracleLinux/OL8/oracle/software/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
[root@apex ~]#
baseurlに$ociregionが含まれています。Oracle Cloudで運用する場合は、ソフトウェアの更新に際して外部との通信が発生しなくなります。
以上が、Oracle LinuxへのEPELリポジトリの追加手順の紹介になります。
完