Can't access webservers on my oracle cloud instance, although I can SSH on 22 and ping the server IP

1.9k views Asked by At

I'm having a hard time viewing Wildfly welcome page on port 8080 + tried apache on port 80 too, and they timeout. I can ssh to the server and using (curl localhost:8080) and (curl localhost:80) show Wildfly and apache welcome pages respectively. I have checked the Security List and Security groups and even opened ALL traffic just to see if they are causing this problem, but unfortunately the problem still there.

I'm using ubuntu 20.04 image and the UFW (firewall) is inactive so the problem isn't from there.

1

There are 1 answers

0
udoyhasan On BEST ANSWER

By default every oracle instances come with 2 firewall.

  1. Hardware Firewall (Known as VCN)
  2. Software Firewall (They use a very hard iptables rules and regular ufw doesn't work with that.)

The 2nd option is very annoying and also took me about 3 days to solve my problem. You can follow my following instructions and hopefully it will also fix your problem.

1st you have to open the port on the Hardware Firewall (VCN) and when you believe you have opened the port then by login to the server using ssh use this command to clear the default oracle iptables rule.

sudo iptables -F

But remember whenever you will reboot the server you will need to again run the flash command. So if you don't want to run this command every time after server reboot. Then after running the flash command run this command to save your flashed iptables rules.

sudo netfilter-persistent save

So, you will not need to run the iptables falsh command every time on the startup of the server.