firewalldの構成
ORDSは一般ユーザーの権限で動作させるため、HTTPやHTTPSのポート(80および443)の接続を待ち受けることはできません。代わりにポート8080と8443を使用します。firewalldではHTTP(ポート80)の接続をポート8080、HTTPS(ポート443)の接続をポート8443へ転送します。また、HTTPとHTTPSへの接続を許可します。
firewall-cmd --add-service=https
firewall-cmd --add-service=http
firewall-cmd --add-forward-port=port=443:proto=tcp:toport=8443
firewall-cmd --add-forward-port=port=80:proto=tcp:toport=8080
firewall-cmd --runtime-to-permanent
firewall-cmd --reload
firewall-cmd --list-all
[root@localhost ~]# firewall-cmd --add-service=https
success
[root@localhost ~]# firewall-cmd --add-service=http
success
[root@localhost ~]# firewall-cmd --add-forward-port=port=443:proto=tcp:toport=8443
success
[root@localhost ~]# firewall-cmd --add-forward-port=port=80:proto=tcp:toport=8080
success
[root@localhost ~]# firewall-cmd --runtime-to-permanent
success
[root@localhost ~]# firewall-cmd --reload
success
[root@localhost ~]# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: enp0s3
sources:
services: cockpit dhcpv6-client http https ssh
ports:
protocols:
forward: yes
masquerade: no
forward-ports:
port=443:proto=tcp:toport=8443:toaddr=
port=80:proto=tcp:toport=8080:toaddr=
source-ports:
icmp-blocks:
rich rules:
[root@localhost ~]#
Java Development Kitのインストール
dnf -y install java-17-openjdk-headless
[root@localhost ~]# dnf -y install java-17-openjdk-headless
Last metadata expiration check: 2:34:56 ago on Tue 18 Jun 2024 11:13:09 AM JST.
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
java-17-openjdk-headless
x86_64 1:17.0.11.0.9-2.0.1.el9 ol9_appstream 45 M
Installing dependencies:
alsa-lib x86_64 1.2.10-2.el9 ol9_appstream 592 k
copy-jdk-configs noarch 4.0-3.el9 ol9_appstream 28 k
cups-libs x86_64 1:2.3.3op2-24.el9 ol9_baseos_latest 265 k
javapackages-filesystem noarch 6.0.0-4.el9 ol9_appstream 10 k
lksctp-tools x86_64 1.0.19-3.el9_4 ol9_baseos_latest 110 k
[中略]
lua-posix-35.0-8.el9.x86_64
nspr-4.35.0-7.el9_4.x86_64
nss-3.90.0-7.el9_4.x86_64
nss-softokn-3.90.0-7.el9_4.x86_64
nss-softokn-freebl-3.90.0-7.el9_4.x86_64
nss-sysinit-3.90.0-7.el9_4.x86_64
nss-util-3.90.0-7.el9_4.x86_64
tzdata-java-2024a-1.el9.noarch
Complete!
[root@localhost ~]#
[root@localhost ~]# java -version
openjdk version "17.0.11" 2024-04-16 LTS
OpenJDK Runtime Environment (Red_Hat-17.0.11.0.9-3.0.1) (build 17.0.11+9-LTS)
OpenJDK 64-Bit Server VM (Red_Hat-17.0.11.0.9-3.0.1) (build 17.0.11+9-LTS, mixed mode, sharing)
[root@localhost ~]#
Oracle REST Data Servicesのインストール
dnf -y --repofrompath ol9_oracle_software,http://yum.oracle.com/repo/OracleLinux/OL9/oracle/software/x86_64 install ords
[root@localhost ~]# dnf -y --repofrompath ol9_oracle_software,http://yum.oracle.com/repo/OracleLinux/OL9/oracle/software/x86_64 install ords
Added ol9_oracle_software repo from http://yum.oracle.com/repo/OracleLinux/OL9/oracle/software/x86_64
ol9_oracle_software 31 kB/s | 69 kB 00:02
Last metadata expiration check: 0:00:02 ago on Tue 18 Jun 2024 01:53:58 PM JST.
Dependencies resolved.
================================================================================
Package Architecture Version Repository Size
================================================================================
Installing:
ords noarch 24.1.1-4.el9 ol9_oracle_software 115 M
Installing dependencies:
lsof x86_64 4.94.0-3.el9 ol9_baseos_latest 246 k
Transaction Summary
================================================================================
Install 2 Packages
Total download size: 115 M
Installed size: 120 M
Downloading Packages:
(1/2): lsof-4.94.0-3.el9.x86_64.rpm 1.7 MB/s | 246 kB 00:00
(2/2): ords-24.1.1-4.el9.noarch.rpm 2.2 MB/s | 115 MB 00:51
--------------------------------------------------------------------------------
Total 2.2 MB/s | 115 MB 00:51
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : lsof-4.94.0-3.el9.x86_64 1/2
Running scriptlet: ords-24.1.1-4.el9.noarch 2/2
Installing : ords-24.1.1-4.el9.noarch 2/2
Running scriptlet: ords-24.1.1-4.el9.noarch 2/2
INFO: Before starting ORDS service, run the below command as user oracle:
ords --config /etc/ords/config install
INFO: To enable the ORDS service during startup, run the below command:
sudo systemctl enable ords
Verifying : lsof-4.94.0-3.el9.x86_64 1/2
Verifying : ords-24.1.1-4.el9.noarch 2/2
Installed:
lsof-4.94.0-3.el9.x86_64 ords-24.1.1-4.el9.noarch
Complete!
[root@localhost ~]#
Oracle REST Data Servicesの構成
ORDSコマンドを実行するときに構成ディレクトリが未指定だとカレント・ディレクトリを構成ディレクトリと見做します。作業は/etc/ords/config上で実施します。
[root@localhost ~]# su - oracle
Last login: Tue Jun 18 13:15:38 JST 2024 on pts/0
[oracle@localhost ~]$ export PATH=/usr/local/bin:$PATH
[oracle@localhost ~]$ cd /etc/ords/config
[oracle@localhost config]$
ords install
[oracle@localhost config]$ ords install
2024-06-18T05:02:43Z INFO ORDS has not detected the option '--config' and this will be set up to the default directory.
ORDS: Release 24.1 Production on Tue Jun 18 05:02:45 2024
Copyright (c) 2010, 2024, Oracle.
Configuration:
/etc/ords/config
The configuration folder /etc/ords/config does not contain any configuration files.
Oracle REST Data Services - Interactive Install
Enter a number to select the database connection type to use
[1] Basic (host name, port, service name)
[2] TNS (TNS alias, TNS directory)
[3] Custom database URL
Choose [1]:
Enter the database host name [localhost]:
Enter the database listen port [1521]:
Enter the database service name [orcl]: freepdb1
Provide database user name with administrator privileges.
Enter the administrator username: sys
Enter the database password for SYS AS SYSDBA: ********
Retrieving information.
ORDS is not installed in the database. ORDS installation is required.
Enter a number to update the value or select option A to Accept and Continue
[1] Connection Type: Basic
[2] Basic Connection: HOST=localhost PORT=1521 SERVICE_NAME=freepdb1
Administrator User: SYS AS SYSDBA
[3] Database password for ORDS runtime user (ORDS_PUBLIC_USER): <generate>
[4] ORDS runtime user and schema tablespaces: Default: SYSAUX Temporary TEMP
[5] Additional Feature: Database Actions
[6] Configure and start ORDS in Standalone Mode: Yes
[7] Protocol: HTTP
[8] HTTP Port: 8080
[9] APEX static resources location:
[A] Accept and Continue - Create configuration and Install ORDS in the database
[Q] Quit - Do not proceed. No changes
Choose [A]: 9
Enter the APEX static resources location: /home/oracle/i
Enter a number to update the value or select option A to Accept and Continue
[1] Connection Type: Basic
[2] Basic Connection: HOST=localhost PORT=1521 SERVICE_NAME=freepdb1
Administrator User: SYS AS SYSDBA
[3] Database password for ORDS runtime user (ORDS_PUBLIC_USER): <generate>
[4] ORDS runtime user and schema tablespaces: Default: SYSAUX Temporary TEMP
[5] Additional Feature: Database Actions
[6] Configure and start ORDS in Standalone Mode: Yes
[7] Protocol: HTTP
[8] HTTP Port: 8080
[9] APEX static resources location: /home/oracle/i
[A] Accept and Continue - Create configuration and Install ORDS in the database
[Q] Quit - Do not proceed. No changes
Choose [A]:
The setting named: db.connectionType was set to: basic in configuration: default
The setting named: db.hostname was set to: localhost in configuration: default
The setting named: db.port was set to: 1521 in configuration: default
The setting named: db.servicename was set to: freepdb1 in configuration: default
The setting named: plsql.gateway.mode was set to: proxied in configuration: default
The setting named: db.username was set to: ORDS_PUBLIC_USER in configuration: default
The setting named: db.password was set to: ****** in configuration: default
The setting named: feature.sdw was set to: true in configuration: default
The global setting named: database.api.enabled was set to: true
The setting named: restEnabledSql.active was set to: true in configuration: default
The global setting named: standalone.http.port was set to: 8080
The global setting named: standalone.static.path was set to: /home/oracle/i
The global setting named: standalone.static.context.path was set to: /i
The global setting named: standalone.doc.root was set to: /etc/ords/config/global/doc_root
The setting named: security.requestValidationFunction was set to: ords_util.authorize_plsql_gateway in configuration: default
2024-06-18T05:03:33.017Z INFO Created folder /etc/ords/config/logs
2024-06-18T05:03:33.019Z INFO The log file is defaulted to the current working directory located at /etc/ords/config/logs
2024-06-18T05:03:33.090Z INFO Installing Oracle REST Data Services version 24.1.1.r1201228 in FREEPDB1
2024-06-18T05:03:34.432Z INFO ... Verified database prerequisites
2024-06-18T05:03:34.865Z INFO ... Created Oracle REST Data Services proxy user
2024-06-18T05:03:35.316Z INFO ... Created Oracle REST Data Services schema
2024-06-18T05:03:36.065Z INFO ... Granted privileges to Oracle REST Data Services
2024-06-18T05:03:39.249Z INFO ... Created Oracle REST Data Services database objects
2024-06-18T05:03:54.216Z INFO Completed installation for Oracle REST Data Services version 24.1.1.r1201228. Elapsed time: 00:00:21.102
2024-06-18T05:03:54.320Z INFO Completed configuring PL/SQL gateway user for Oracle REST Data Services version 24.1.1.r1201228. Elapsed time: 00:00:00.103
2024-06-18T05:03:54.322Z INFO Log file written to /etc/ords/config/logs/ords_install_2024-06-18_050333_01958.log
2024-06-18T05:03:54.487Z INFO HTTP and HTTP/2 cleartext listening on host: 0.0.0.0 port: 8080
2024-06-18T05:03:54.504Z INFO Disabling document root because the specified folder does not exist: /etc/ords/config/global/doc_root
2024-06-18T05:03:54.505Z INFO Default forwarding from / to contextRoot configured.
2024-06-18T05:03:57.705Z INFO Configuration properties for: |default|lo|
db.servicename=freepdb1
db.hostname=localhost
db.password=******
conf.use.wallet=true
security.requestValidationFunction=ords_util.authorize_plsql_gateway
standalone.static.context.path=/i
database.api.enabled=true
db.username=ORDS_PUBLIC_USER
standalone.http.port=8080
standalone.static.path=/home/oracle/i
restEnabledSql.active=true
resource.templates.enabled=false
plsql.gateway.mode=proxied
db.port=1521
feature.sdw=true
config.required=true
db.connectionType=basic
standalone.doc.root=/etc/ords/config/global/doc_root
2024-06-18T05:03:57.706Z WARNING *** jdbc.MaxLimit in configuration |default|lo| is using a value of 10, this setting may not be sized adequately for a production environment ***
2024-06-18T05:03:57.707Z WARNING *** jdbc.InitialLimit in configuration |default|lo| is using a value of 10, this setting may not be sized adequately for a production environment ***
2024-06-18T05:04:00.092Z INFO
Mapped local pools from /etc/ords/config/databases:
/ords/ => default => VALID
2024-06-18T05:04:00.255Z INFO Oracle REST Data Services initialized
Oracle REST Data Services version : 24.1.1.r1201228
Oracle REST Data Services server info: jetty/10.0.20
Oracle REST Data Services java info: OpenJDK 64-Bit Server VM 17.0.11+9-LTS
Oracle APEXの接続確認
ORDSの自動起動の設定
2024-06-18T05:04:00.255Z INFO Oracle REST Data Services initialized
Oracle REST Data Services version : 24.1.1.r1201228
Oracle REST Data Services server info: jetty/10.0.20
Oracle REST Data Services java info: OpenJDK 64-Bit Server VM 17.0.11+9-LTS
^C[oracle@localhost config]$
ords config set --global db.invalidPoolTimeout 30s
[oracle@localhost config]$ ords config set --global db.invalidPoolTimeout 30s
2024-06-18T05:15:22Z INFO ORDS has not detected the option '--config' and this will be set up to the default directory.
ORDS: Release 24.1 Production on Tue Jun 18 05:15:23 2024
Copyright (c) 2010, 2024, Oracle.
Configuration:
/etc/ords/config
The global setting named: db.invalidPoolTimeout was set to: 30s
[oracle@localhost config]$
[oracle@localhost config]$ exit
logout
[root@localhost ~]#
systemctl enable ords
[root@localhost ~]# systemctl enable ords
Synchronizing state of ords.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable ords
Created symlink /etc/systemd/system/multi-user.target.wants/ords.service → /etc/systemd/system/ords.service.
Created symlink /etc/systemd/system/graphical.target.wants/ords.service → /etc/systemd/system/ords.service.
[root@localhost ~]#
systemctl stop ords
systemctl start ords
[root@localhost ~]# systemctl stop ords
[root@localhost ~]# systemctl start ords
[root@localhost ~]#