LoginSignup
0
0

More than 3 years have passed since last update.

Couldn't serve files through port 8081, AWS EC2 Ubuntu 18.04 Instance

Last updated at Posted at 2021-02-26

Issue

Was setting up a simple website for fun/practice on Ubuntu 18.04, using Apache2 as the web server. I then wanted to work on another website, so I thought I would work on it through a different port than the one for the first (443/HTTPS), and tried it with a random port 8081.

For some strange reason, I couldn't get it to work. I checked the access logs for my instance from AWS, and the requests via port 8081 were getting in, but the web server was not responding.

TL,DR; (Solution)

Turns out I had set up a separate firewall within the Ubuntu instance that I had completely forgotten about.

Once I figured that out, fixing it was easy: sudo ufw allow 8081

If you try troubleshooting firewall issues with AWS instances, most of the guides/ knowledge online tells you to look at the settings in AWS, since those should be the only ones that matter.

But if you're like me and followed Apache tutorials that told you to set up a firewall within the server, and then you just forgot you did that, chances are you might've forgotten that you need to edit those firewalls.

So I wrote this as a friendly reminder that this might be something you have to check, since I didn't see it anywhere else :)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0