スクリプトprepare-ubuntu.shによる更新を反映するため、一旦インスタンスを再起動します。
sudo shutdown -r now
ubuntu@ordsmcp2:~$ sudo shutdown -r now
Broadcast message from root@ordsmcp2 on pts/1 (Wed 2026-02-25 03:31:17 UTC):
The system will reboot now!
再度、インスタンスにユーザーubuntuで接続し、Oracle APEXの構成作業を始めます。
スクリプト内で作成しているユーザーoracleに切り替えて作業します。
sudo su - oracle
ubuntu@ordsmcp2:~$ sudo su - oracle
$
これ以降の作業はほとんどOracle Linux 10と同じですが、podmanの代わりにDockerを使用します。
Oracle APEXの最新のアーカイブをダウンロードし解凍します。その他に、データファイルを保管するディレクトリ
oradataと、ORDSの構成ファイルを保管するディレクトリ
ords_configを作成します。
curl -OL https://download.oracle.com/otn_software/apex/apex-latest.zip
unzip -q apex-latest.zip
mkdir oradata
mkdir ords_config
$ curl -OL https://download.oracle.com/otn_software/apex/apex-latest.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 289M 100 289M 0 0 123M 0 0:00:02 0:00:02 --:--:-- 123M
$ unzip -q apex-latest.zip
$ mkdir oradata
$ mkdir ords_config
$
環境作成に使用するコンテナ・イメージを、あらかじめダウンロードしておきます。
docker pull container-registry.oracle.com/database/free:latest
docker pull container-registry.oracle.com/database/ords:latest
$ docker pull container-registry.oracle.com/database/free:latest
latest: Pulling from database/free
41fec24cd635: Pull complete
3bf32880b451: Pull complete
2194ce8eea01: Pull complete
422548fea3d3: Pull complete
ec2d2b9967e0: Pull complete
8b259ba4c4d9: Pull complete
76262a11b33d: Pull complete
1b5d06dc2c49: Pull complete
991ed18434dd: Pull complete
f25c6654bf3b: Pull complete
ea29ae69235f: Pull complete
3a95ca5b8cd0: Pull complete
d46a44facb7d: Pull complete
cc817f3645bb: Pull complete
45768b398726: Pull complete
7e9be3b296e9: Pull complete
e02d6fb066f3: Pull complete
2d032c198665: Pull complete
8a5b38f9ede2: Pull complete
da072ef4f3b2: Pull complete
aeed28bf05ac: Pull complete
29c59e2aad04: Pull complete
Digest: sha256:8a8084193724b95bc62247e3af4218b357e4f172c78925551b2181dbe2566232
Status: Downloaded newer image for container-registry.oracle.com/database/free:latest
container-registry.oracle.com/database/free:latest
$ docker pull container-registry.oracle.com/database/ords:latest
latest: Pulling from database/ords
ac06ceafe5b9: Pull complete
7199b16c8c4a: Pull complete
2d59a8c44230: Pull complete
4577ec524291: Pull complete
a1247073a683: Pull complete
0c76fee24ccd: Pull complete
b91daf9676e0: Pull complete
4f4fb700ef54: Pull complete
Digest: sha256:c8b7713edbd9394d304b936be91d6ffe3251586f45352bc918e4cb56faabe852
Status: Downloaded newer image for container-registry.oracle.com/database/ords:latest
container-registry.oracle.com/database/ords:latest
$
$ docker logs -f apex-ords
Testing database connection...
INFO : Attempt 1: Connecting to sys/*****@apex-db:1521/FREEPDB1 as sysdba...
INFO : Database connection successful.
INFO : The Oracle REST Data Services are not installed on your database.
INFO : Installing The Oracle REST Data Services 25.4.0.
INFO : The ORACLE_USER_PWD variable was not supplied.
A temporary password was generated for ORACLE_USER_PWD.
Execute this command to get the generated password:
docker exec <ORDS_container_name> ords config get --secret db.password
INFO : The Oracle REST Data Services 25.4.0 has been installed correctly on your database.
INFO : The container found Oracle APEX version 24.2.0 in the mounted volume.
INFO : Installing Oracle APEX on your DB, please be patient.
INFO : The APEX_PWD variable was not supplied.
A new password must be set to complete the configuration.
To do this, connect as SYS with SYSDBA privileges and run:
ALTER USER APEX_PUBLIC_USER IDENTIFIED BY "<new_password>";
INFO : The Oracle APEX has been installed. You can create an APEX Workspace in Database Actions APEX Workspaces section.
INFO : Set plsql.gateway.mode proxied after Oracle APEX was installed.
INFO : Setup standalone.static.path /opt/oracle/apex/images.
INFO : Starting the Oracle REST Data Services instance.
2026-02-25T04:05:22Z INFO ORDS has not detected the option '--config' and this will be set up to the default directory.
[中略]
2026-02-25T04:05:31.006Z WARNING *** jdbc.MaxLimit in configuration |default|lo| is using a value of 10, this setting may not be sized adequately for a production environment ***
2026-02-25T04:05:31.368Z INFO Created Pool: |default|lo|-2026-02-25T04-05-30.167143688Z at: 2026-02-25T04:05:30.167143688Z
2026-02-25T04:05:31.554Z INFO
Mapped local pools from /etc/ords/config/databases:
/ords/ => default => VALID
2026-02-25T04:05:31.572Z INFO Oracle REST Data Services initialized
Oracle REST Data Services version : 25.4.0.r3641739
Oracle REST Data Services server info: jetty/12.0.25
Oracle REST Data Services java info: Java HotSpot(TM) 64-Bit Server VM GraalVM EE 21.3.10 (build 17.0.11+7-LTS-jvmci-21.3-b51 mixed mode, sharing)
2026-02-25T04:05:31.767Z INFO CursorMonitor 1
2026-02-25T04:05:31.768Z INFO RequestMonitor 1
2026-02-25T04:05:31.769Z INFO AccessLogMonitor 1 0
2026-02-25T04:05:31.769Z INFO TransactionMonitor 1
2026-02-25T04:05:31.773Z INFO WatchdogMonitor 1
2026-02-25T04:25:37.924Z WARNING Bad Authority: [/]
129.212.188.167 - [25/Feb/2026:04:25:37 +0000] "GET /badMessage HTTP/1.0" 400 - "" "" 27 - - -
198.235.24.2 - [25/Feb/2026:04:25:49 +0000] "GET /badMessage HTTP/1.0" 400 - "" "" 2 - - -
198.235.24.2 - [25/Feb/2026:04:25:49 +0000] "GET /badMessage HTTP/1.0" 400 - "" "" 1 - - -
2026-02-25T04:05:31.006Z WARNING *** jdbc.MaxLimit in configuration |default|lo| is using a value of 10, this setting may not be sized adequately for a production environment ***
2026-02-25T04:05:31.368Z INFO Created Pool: |default|lo|-2026-02-25T04-05-30.167143688Z at: 2026-02-25T04:05:30.167143688Z
2026-02-25T04:05:31.554Z INFO
Mapped local pools from /etc/ords/config/databases:
/ords/ => default => VALID
2026-02-25T04:05:31.572Z INFO Oracle REST Data Services initialized
Oracle REST Data Services version : 25.4.0.r3641739
Oracle REST Data Services server info: jetty/12.0.25
Oracle REST Data Services java info: Java HotSpot(TM) 64-Bit Server VM GraalVM EE 21.3.10 (build 17.0.11+7-LTS-jvmci-21.3-b51 mixed mode, sharing)
2026-02-25T04:05:31.767Z INFO CursorMonitor 1
2026-02-25T04:05:31.768Z INFO RequestMonitor 1
2026-02-25T04:05:31.769Z INFO AccessLogMonitor 1 0
2026-02-25T04:05:31.769Z INFO TransactionMonitor 1
2026-02-25T04:05:31.773Z INFO WatchdogMonitor 1
^C$
データベースのコンテナに接続します。データベースのコンテナapex-dbの/home/oracle/apexにはAPEXのメディアの解凍先がマウントされています。 /home/oracle/apexに移動します。
@load_trans JAPANESE
SQL> @load_trans JAPANESE
PL/SQL procedure successfully completed.
Installing Oracle APEX translation - JAPANESE
. ORACLE
.
. Oracle APEX Hosted Development Service Installation.
..............................................................
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
--application/set_environment
API Last Extended:20241130
Your Current Version:20241130
This import is compatible with version: 20241130
COMPATIBLE (You should be able to run this import without issues.)
ID offset during import: 0
New ID offset for application: 0
APPLICATION 4420 - Oracle APEX Builder, Wizard Messages and Native Plug-Ins
--application/delete_application
--application/create_application
--application/user_interfaces
--application/shared_components/navigation/lists/spotlight_custom_entries_global
--application/shared_components/navigation/lists/spotlight_custom_entries_app_level
--application/shared_components/navigation/lists/spotlight_custom_entries_page_designer
--application/shared_components/navigation/listentry
--application/plugin_settings
[中略」
--application/pages/page_00203
--application/pages/page_00204
--application/pages/page_00205
--application/pages/page_00206
--application/deployment/definition
--application/deployment/checks
--application/deployment/buildoptions
--application/end_environment
... elapsed: 4.34 sec
...done
Adjust instance settings
PL/SQL procedure successfully completed.
SQL>
管理者ユーザーとパスワードを設定します。管理者ユーザー名はデフォルトの
ADMINとします。
@apxchpwd
SQL> @apxchpwd
...set_appun.sql
================================================================================
This script can be used to change the password of an Oracle APEX
instance administrator. If the user does not yet exist, a user record will be
created.
================================================================================
Enter the administrator's username [ADMIN]
User "ADMIN" does not yet exist and will be created.
Enter ADMIN's email [ADMIN]
Enter ADMIN's password [] *********
Created instance administrator ADMIN.
SQL>
以上で、Oracle APEXの管理サービスに、日本語でサインインできるようになりました。
nginxによるリバース・プロキシの構成
OpenResty(nginx)はホスト名指定でHTTPS接続ができるように構成します。そのため、DNSにホスト名とIPアドレスをあらかじめ登録しておきます。DNSに設定したホスト名で、このコンピュート・インスタンスに接続できることを確認します。
http://ホスト名:8080/ords/apex_admin
OpenRestyはコンテナではなくホストで実行します。作業はrootユーザーにて実施します。
コンピュート・インスタンスにユーザーubuntuで接続し、rootユーザーに切り替えます。
sudo -s
cd ~
ubuntu@ordsmcp2:~$ sudo -s
root@ordsmcp2:/home/ubuntu# cd ~
root@ordsmcp2:~#
certbotを実行し、Let's Encryptより証明書を取得します。デフォルトでは楕円曲線暗号の鍵を生成するようです。ORDSでの利用を考えている場合は
--key-type rsaをオプションとして追加し、RSAの鍵を生成します。
以下の例ではホスト名に
ords.example.comを指定していますが、作業の際には割り当てているホスト名に置き換えます。
certbot certonly --standalone -d ホスト名
root@ordsmcp2:~# certbot certonly --standalone -d ords.example.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices)
(Enter 'c' to cancel): メール・アドレス
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.6-August-18-2025.pdf. You must agree
in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, to
share your email address with the Electronic Frontier Foundation, a founding
partner of the Let's Encrypt project and the non-profit organization that
develops Certbot? We'd like to send you email about our work encrypting the web,
EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: N
Account registered.
Requesting a certificate for ords.example.com
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/ords.example.com/fullchain.pem
Key is saved at: /etc/letsencrypt/live/ords.example.com/privkey.pem
This certificate expires on 2026-05-26.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
* Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
* Donating to EFF: https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
root@ordsmcp2:~#
OpenResty(nginx)ではhttpsからhttpへのリバース・プロキシを構成しているため、Oracle REST Data Servicesの
security.httpsHeaderCheckに
"X-Forwarded-Proto: https"を設定します。
ユーザー
oracleに切り替えコンテナ
apex-ordsに接続して、
ordsコマンドを実行します。
構成を更新したのち、コンテナを再起動します。
su - oracle
docker exec apex-ords ords --config /etc/ords/config config set security.httpsHeaderCheck "X-Forwarded-Proto: https"
docker restart apex-ords
root@ordsmcp2:~# su - oracle
$ docker exec apex-ords ords --config /etc/ords/config config set security.httpsHeaderCheck "X-Forwarded-Proto: https"
ORDS: Release 25.4 Production on Wed Feb 25 05:31:03 2026
Copyright (c) 2010, 2026, Oracle.
Configuration:
/etc/ords/config
The global setting named: security.httpsHeaderCheck was set to: X-Forwarded-Proto: https
$ docker restart apex-ords
apex-ords
$ exit
root@ordsmcp2:~#
OpenResty(nginx)を使ってリバース・プロキシを構成するためのファイルは、prepare-ubuntu.shの実行時にダウンロード済みです。
サーバーの設定ファイルに記載されているホスト名を変更した後に、OpenRestyを起動します。
sed -i 's/ords.example.com/ホスト名/g' /etc/nginx/conf.d/01-server.confsystemctl enable openresty
systemctl start openresty
root@ordsmcp2:~# sed -i 's/ords.example.com/**********/g' /etc/nginx/conf.d/01-server.conf
root@ordsmcp2:~# systemctl enable openresty
Synchronizing state of openresty.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable openresty
root@ordsmcp2:~# systemctl start openresty
root@ordsmcp2:~#
以上でnginxによるリバース・プロキシが構成できました。Oracle APEXにHTTPSで接続できます。