Django runserver 正在运行,但网站未在 8080 以外的其他端口上加载:CPANEL

Django runserver is working but website isn't loading on other port than 8080: CPANEL

我有两个 Django 项目,我正在使用 Cpanel 终端在 8080(工作中)、8083(不工作)中托管它

我正在使用 Cpanel 终端在端口 8083 托管 Django 网站

现在我尝试了这个

python manage.py runserver 0.0.0.0:8083

正在运行,服务器启动于 0.0.0.0:8083

现在我们应该可以在浏览器中使用我们的 websiteIP:8083

看到它

但这不起作用。

8083 端口网站未加载,但 8080 端口

我在settings.py

中检查了ALLOWED HOST =["my.IP.241.0","my_website_url.com"]

好像是防火墙的问题,但是不知道怎么解决..

我按照这篇文章安装了 csf 并禁用了 cpanel 的默认防火墙

systemctl stop firewalld
systemctl disable firewalld

现在安装 csf 并启动并启用它

编辑csf.conf(在你想要的最后添加端口)

TCP_IN="20,21,22,25,53,80,110,143,443,465,587,993,995,2082,2083,2086,2087,2095,2096,26,8080,8000,8081,8082,8083,8880"
    
TCP_OUT="20,21,22,25,37,43,53,80,110,143,443,587,2086,2087,2083,2082,8080,8000,8081,8082,8083,8880"

现在 运行 在我们的 python 服务器上我们列出的端口工作

screen -d -m  python manage.py runserver 0.0.0.0:8880

因为 cloudflare 支持此端口

我关注了这个。

https://www.digitalocean.com/community/questions/how-to-install-and-configure-config-server-firewall-csf-on-centos