简体   繁体   English

我无法在端口 80 上运行 django

[英]I can't running django on port 80

I can't running django in my website server at port 80... because It gives me that port is already in use??我无法在我的网站服务器中的端口 80 上运行 django ... 因为它给了我该端口已在使用中? may I know what's the problem exactly?我可以知道到底是什么问题吗?

this is the link for my website It only gives me a html page (zabarjad.co).这是我网站的链接 它只给了我一个 html 页面 (zabarjad.co)。

but when I type in command line to run django this is what happen:但是当我在命令行中输入运行 django 时会发生这种情况:

aziz@zabarjad-djangostack-vm:/var/www/zabarjadprod$ sudo python3 manage.py runserver 0.0.0.0:80
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
March 06, 2021 - 17:40:17
Django version 2.2.15, using settings 'zabarjadprod.settings'
Starting development server at http://0.0.0.0:80/
Quit the server with CONTROL-C.
Error: That port is already in use.

Aziz, there is something running at port 80 on your system. Aziz,你系统的 80 端口有东西在运行。 check for other services and servers installed on your system and shut down the on the said port.检查系统上安装的其他服务和服务器并关闭所述端口。

It means there is some other program on your computer running on port 80 .这意味着您的计算机上有其他程序在端口80上运行。 I personally have the following shortcut in my ~/.bash_profile to analyze these sort of things:我个人在我的~/.bash_profile中有以下快捷方式来分析这些事情:

alias ports="sudo lsof -iTCP -sTCP:LISTEN -n -P"

If you run it by itself, you should see something along the lines of (assuming you are running MacOS. If not Google, how to find the ports of running processes for your machine):如果你自己运行它,你应该会看到类似的东西(假设你运行的是 MacOS。如果不是谷歌,如何为你的机器找到正在运行的进程的端口):

在此处输入图像描述

On the right side, the ports of each process is shown.在右侧,显示了每个进程的端口。 You can then do kill {PID} (eg kill 4749 would kill my Spotify instance) to kill the process running on port 80 (make sure it's something you aren't actually using).然后您可以执行kill {PID} (例如kill 4749会杀死我的 Spotify 实例)来终止在端口 80 上运行的进程(确保它是您实际上没有使用的东西)。


I should add, however, than there are very few times that you might want to use port 80 locally.但是,我应该补充一点,您可能希望在本地使用端口80的次数很少。 It's better to use 8080 or something else, and only on deployment use 80 .最好使用8080或其他东西,并且仅在部署时使用80

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法连接到远程Django服务器端口80 - Can't connect to remote django server port 80 使用Nginx在端口80上运行Django应用程序 - Running django application on port 80 using nginx 我在端口 8000:80 上的 apache+docker 上运行 django 应用程序,需要使用另一个端口运行另一个应用程序但无法正常工作 - I have django application running on apache+docker on port 8000:80,need to run another application with another port but not working 在 AWS EC2 上部署 django 应用程序时无法在端口 80 上运行 gunicorn - Can't run gunicorn on port 80 while deploying django app on AWS EC2 80端口上的Django项目? - Django project on 80 port? 龙卷风:在端口80上同时运行websocket和闪存策略服务器 - Tornado: Running both websocket and flash policy server on port 80 在Django中分叉后关闭TCP端口80和443 - Close TCP port 80 and 443 after forking in Django Azure VM Gunicorn上Ubuntu 18.04中的Django无法连接到('0.0.0.0',80) - Django in Ubuntu 18.04 on Azure VM gunicorn Can't connect to ('0.0.0.0', 80) Django 服务器正在运行但无法访问 url - Django server running but can't hit url 为什么不能同时绑定到0.0.0.0:80和192.168.1.1:80? - why can't bind to 0.0.0.0:80 and 192.168.1.1:80 simultaneously?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM