Unable to open web-site on my browser (Django)

I'm using Nanode 1GB and have deployed Ubuntu 20.04 LTS.
I've developed my website using Django 3 running on python 3.8.
The website is running properly on my local development machine on both Windows 10 x64 and local Virtual test environment Ubuntu 20.04 LTS but I'm unable to open the website when I run my website over Linode. I get

The connection has timed out ->Firefox
This site can’t be reached -> Chrome

error.

I pinged my Linode server and I'm getting response with 5ms.
In the Firewalls tab I have created a rule for my website (Linode specific). I have configured the firewall as

No inbound rules have been added.
Default inbound policy: This policy applies to any traffic not covered by the inbound rules listed above . -> Accept
No outbound rules have been added.
Default outbound policy: This policy applies to any traffic not covered by the outbound rules listed above. -> Accept

I'm trying to test my website and I've run it using the command

python manage.py runserver ipv4-address:8000

Kindly note I finally intend to run my website on OpenLiteSpeed Server with CyberPanel interface.

3 Replies

  • Are you trying to reach your site using port 8000 in your browser?

  • Is port 8000 open in the firewall on your Linode?

https://www.cyberciti.biz/faq/how-to-check-open-ports-in-linux-using-the-cli/
https://www.wikihow.com/Open-Ports-in-Linux-Server-Firewall

See:

https://stackoverflow.com/questions/5768797/manage-py-runserver

for some other troubleshooting tips.

-- sw

I've opened/enabled Is port 8000 open in the Cloud Firewall as well as on my local firewall (ufw) on my Linode.

I even tried after disabling the firewall but it still doesn't work.

I'd refereed to the stackoverflow article but it didn't help.

When I run my website and run the ss -tulpn I can see the port open.

Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
tcp LISTEN 0 10 xxx.xxx.xxx.xxx:8000 0.0.0.0:* users:(("python",pid=2630,fd=4))

Have you looked at the logs for your web server? I don't have a clue where they would be so you'll have to figure out their location yourself. They will probably be very helpful.

  • Once you've found the logs, use tail -f to view the log in real time in another terminal window and try this experiment on your Linode:
curl http://127.0.0.1:8000

and see if you get a response (and note the log entries). Your response will be the HTML generated by your python(1) app if the request is successful. You'll have to be versed enough in what that looks like to make a determination of correctness.

  • Do this again with your IP address:
curl http://xxx.xxx.xxx.xxx:8000

and see if you get a response (and note the log entries).

  • Try this on a remote machine (not your Linode):
curl http://xxx.xxx.xxx.xxx:8000

and see if you get a response (and note the log entries).

On your Linode, if the 127.0.0.1 case works but the ip-address case does not work, then your web server is probably configured to handle only requests from localhost (common for these kinds of things designed for testing).

If both cases on your Linode work and the remote case does not work, then something else is blocking access to your IP address (like a firewall). You need to focus your energies on finding out what that is and fix it.

You may need to install curl(1) with apt-get(8) on your Linode. You'll have to figure out how to do that on your local PC by yourself.

You can read about curl(1) here:

https://curl.se

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct