从远程计算机访问 Oracle Apex



大家好,我已经成功地在Linux VM(谷歌云计算(上安装了Oracle 11g Express附加功能。 我有sqlplus工作,我可以查询数据。 侦听器也在工作。

但是由于Linux服务器没有GUI,我无法尝试本地主机,并且外部计算机拒绝了连接。

我的问题是:

1(Apex是否预装在Oracle XE上,它曾经在任何地方都没有提到。

2( 如果服务器的 IP 地址是 123.123.123,我将使用哪个 URL 从远程计算机访问 Apex?我试过了

  • http://123.123.123:8080/apex/
  • http://123.123.123/apex/
  • https://123.123.123:8080/apex/

3(如何判断是服务器还是Oracle拒绝连接?

防火墙

$ netstat -ant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN     
tcp        0      0 10.128.0.3:50776        169.254.169.254:80      ESTABLISHED
tcp        0      0 10.128.0.3:43548        10.128.0.3:1521         ESTABLISHED
tcp        0      0 10.128.0.3:50722        169.254.169.254:80      CLOSE_WAIT 
tcp        0      0 10.128.0.3:50814        169.254.169.254:80      ESTABLISHED
tcp        0      0 10.128.0.3:50774        169.254.169.254:80      ESTABLISHED
tcp        0     64 10.128.0.3:22           74.125.41.105:38312     ESTABLISHED
tcp6       0      0 :::40070                :::*                    LISTEN     
tcp6       0      0 :::8080                 :::*                    LISTEN     
tcp6       0      0 :::1521                 :::*                    LISTEN     
tcp6       0      0 :::22                   :::*                    LISTEN     
tcp6       0      0 ::1:25                  :::*                    LISTEN     
tcp6       0      0 10.128.0.3:1521         10.128.0.3:43548        ESTABLISHED

听者

$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 22-AUG-2017 02:59:51
Copyright (c) 1991, 2011, Oracle.  All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC_FOR_XE)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date                22-AUG-2017 02:00:17
Uptime                    0 days 0 hr. 59 min. 33 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Default Service           XE
Listener Parameter File   /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/centossmallblockpro/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC_FOR_XE)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centossmallblockpro.c.sincere-destiny-176110.internal)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=centossmallblockpro.c.sincere-destiny-176110.internal)(PORT=8080))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "XE" has 1 instance(s).
Instance "XE", status READY, has 1 handler(s) for this service...
Service "XEXDB" has 1 instance(s).
Instance "XE", status READY, has 1 handler(s) for this service...
The command completed successfully

SQL加工作

sqlplus
SQL*Plus: Release 11.2.0.2.0 Production on Tue Aug 22 03:03:51 2017
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Enter user-name: system
Enter password: 
Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
SQL> select * from dual;
D
-
X

.

Telnet XX.XXX.XXX.XX 8080
Telnet: Unable to connect to remote host: Connection timed out

1(我认为Oracle XE(11g(带有APEX版本3.2。这是一个非常古老的 APEX 版本。按照说明如何删除此旧版本并从 otn.oracle.com 获取最新版本。最新版本也应该适用于11g XE。

2( 隧道

您可以创建从桌面计算机到运行服务的端点服务器的 ssh 隧道。现在,您可以从桌面环境访问远程计算机上的服务。sqlplus,SQL Developer,Firefox等。

# Access Your Database Remotely Through an SSH Tunnel
# ssh -L [local port]:[database host]:[remote port] [username]@[remote host]
# console 1: 9998 is just an arbitrary port > 1024. Can be anything.
ssh -N -L 9998:10.128.0.3:1521 -i ~/.ssh/id_rsa user@35.184.136.98
# console 2:
sqlplus user/pwd@localhost:9998/XE 
# firefox:
http://localhost:9998/apex 

Bjarte 对 1 和 2 的回答很好,但实际问题不是 Linux 防火墙,而是计算引擎防火墙。

我甚至不知道它的存在,当您选中复选框以打开 Http 时,它为 TCP:80 创建了一个规则,但我需要 TCP:8080。

这是为我解决它的文章,无法在谷歌计算引擎上打开端口......

最新更新