How to Open Some Ports on Ubuntu

Ubuntu 18.04 Apache2.4.29 not able to open ports other than 80

Problem solved, what I needed was just a sudo reboot.
It turned out that adding ports shall require not only an Apache2 restart but also a server reboot.

Can not reach open ports on Oracle Cloud Instance

If a firewall is in place, the connection is not refused but blocked ("Connection Time Out"). So if you get a "Connection refused.", this sounds more like no process is running on the host listening on the port. Can you check with "netstat -na | grep LISTEN" if a process is listening on port 80/443 ?

Opening a port on Ubuntu

I think the mangodb instance was not started, apart from that ,sudo netstat -ntlp | grep LISTEN gives the list ports that are active are being used now, first start your Mango instance sudo service mongodb start , then run this command sudo netstat -ntlp | grep LISTEN if you find 27017 in the list, then sudo iptables -L chack your iptable rule is added or not. If it is in that list good else, sudo iptables -A INPUT -p tcp --dport 27017 -j ACCEPT
you can get more details on mangodb port and traffic @ http://docs.mongodb.org/manual/tutorial/configure-linux-iptables-firewall/

How To open ports on Ubuntu in Google cloud platform

You have already installed apache, and it's running on the port 80 as you can see on the nmap test, a closed port just mean that there's no application running on that port, this is different to filtered, see this for more information, this confirms that your firewall rules are correct (you are allowing traffic from all sources 0.0.0.0/0). By now you should be able to access your website on the port 80, if not I suggest you to follow this GCP guide.

So, if you want to run apache on the port 443 you just need to change its configuration (basically you will need to get a certificate for your server, configure some related parameters and then create a virtualhost listening on the 443 port, there are many guides on the internet for this just google for "enable https apache [your_OS]"), that should be enough since the firewall rules on GCP and your instance appear to be properly configured.

Open Port in Ubuntu

Edit /etc/postgresql/<version>/main/postgresql.conf and set the listen_addresses to your outgoing interface or all. Restart postgresql: sudo service postgresql restart.

How to enable port 5000 on AWS ubuntu

In addition to allowing access to port 5000 via the Security Group, you also need to ensure that your app is listening on an IP which can accept TCP connections from outside. To listen on all IPs, in your app, use:

if __name__ == '__main__':
app.run(host='0.0.0.0', debug = False)

Instead of:

if __name__ == '__main__':
app.run(host='127.0.0.1', debug = False)

To see what address your application is listening on, you can run this command:

netstat -an | grep :5000

After making these changes, you will want to restart your Flask application.

I'm assuming you're just using this for development and testing, since you're keeping it on port 5000, but, when you're ready to deploy your application into production, you need to put it behind a real webserver. I would recommend using nginx with uWSGI. Here is a guide to configuring Flask + nginx + uWSGI, and here is the official documentation from Flask on the subject.



Related Topics



Leave a reply



Submit