VPS [Ubuntu] > Docker > Apache (serving Oracle APEX)
So locally I run Ubuntu on my laptop. I have followed the instructions provided to me by an author on Github to install docker and subsequent software (Oracle DB 19.x, Oracle ORDS, Oracle APEX, Apache, to name a few).
When I've done this locally, I was able to access APEX via:
localhost:8080/ords/
I have followed the exact steps on my Ubuntu VPS within Linode, I can SSH into the docker container and access the Oracle DB SQL cl in my terminal, plus I can within TOAD, access the db directly calling my VPS IP address using port 1521, and interact with the DB just fine.
I have been all over trying to acccess APEX from my browser [VPS IP]:8080/ords/ and have no luck.
By all accounts all is there and working, but no matter what I am having no success.
When implementing the container, I ran:
docker run -d --name db-apex-dev-container -p 2222:22 -p 8080:8080 -p 1521:1521 -v /dev/shm --tmpfs /dev/shm:rw,nosuid,nodev,exec,size=2g db-apex-dev-image
I have also pared that back and just tried to expose 8080, still nothing.
Can anyone help me gain access via my local browser to the Apache instance within docker?
I provide the output of netstat -plunt and iptables-save in the first comment.
1 Reply
Adding this to help someone else who may understand this better than me:
I had attempted to utilize UFW however I later found that by default Docker writes directly to IPTABLES. I have since reset UFW and it's currently inactive as of running these 2 commands:
root@localhost:~# netstat -plunt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 545/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 618/sshd
tcp6 0 0 :::22 :::* LISTEN 618/sshd
udp 0 0 127.0.0.53:53 0.0.0.0:* 545/systemd-resolve
root@localhost:~# iptables-save
# Generated by iptables-save v1.8.3 on Thu Nov 14 20:51:45 2019
*nat
:PREROUTING ACCEPT [4729:240522]
:INPUT ACCEPT [1140:67007]
:OUTPUT ACCEPT [34:2382]
:POSTROUTING ACCEPT [34:2382]
:DOCKER - [0:0]
-A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER
-A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER
-A POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE
-A DOCKER -i docker0 -j RETURN
COMMIT
# Completed on Thu Nov 14 20:51:45 2019
# Generated by iptables-save v1.8.3 on Thu Nov 14 20:51:45 2019
*filter
:INPUT ACCEPT [220:19799]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [218:36071]
:DOCKER - [0:0]
:DOCKER-ISOLATION-STAGE-1 - [0:0]
:DOCKER-ISOLATION-STAGE-2 - [0:0]
:DOCKER-USER - [0:0]
:ufw-after-forward - [0:0]
:ufw-after-input - [0:0]
:ufw-after-logging-forward - [0:0]
:ufw-after-logging-input - [0:0]
:ufw-after-logging-output - [0:0]
:ufw-after-output - [0:0]
:ufw-before-forward - [0:0]
:ufw-before-input - [0:0]
:ufw-before-logging-forward - [0:0]
:ufw-before-logging-input - [0:0]
:ufw-before-logging-output - [0:0]
:ufw-before-output - [0:0]
:ufw-reject-forward - [0:0]
:ufw-reject-input - [0:0]
:ufw-reject-output - [0:0]
:ufw-track-forward - [0:0]
:ufw-track-input - [0:0]
:ufw-track-output - [0:0]
-A INPUT -j ufw-before-logging-input
-A INPUT -j ufw-before-input
-A INPUT -j ufw-after-input
-A INPUT -j ufw-after-logging-input
-A INPUT -j ufw-reject-input
-A INPUT -j ufw-track-input
-A FORWARD -j DOCKER-USER
-A FORWARD -j DOCKER-ISOLATION-STAGE-1
-A FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -o docker0 -j DOCKER
-A FORWARD -i docker0 ! -o docker0 -j ACCEPT
-A FORWARD -i docker0 -o docker0 -j ACCEPT
-A FORWARD -j ufw-before-logging-forward
-A FORWARD -j ufw-before-forward
-A FORWARD -j ufw-after-forward
-A FORWARD -j ufw-after-logging-forward
-A FORWARD -j ufw-reject-forward
-A FORWARD -j ufw-track-forward
-A OUTPUT -j ufw-before-logging-output
-A OUTPUT -j ufw-before-output
-A OUTPUT -j ufw-after-output
-A OUTPUT -j ufw-after-logging-output
-A OUTPUT -j ufw-reject-output
-A OUTPUT -j ufw-track-output
-A DOCKER-ISOLATION-STAGE-1 -i docker0 ! -o docker0 -j DOCKER-ISOLATION-STAGE-2
-A DOCKER-ISOLATION-STAGE-1 -j RETURN
-A DOCKER-ISOLATION-STAGE-2 -o docker0 -j DROP
-A DOCKER-ISOLATION-STAGE-2 -j RETURN
-A DOCKER-USER -j RETURN
COMMIT