flask mod_wsgi地址已在使用中

时间:2017-02-09 18:06:15

标签: python flask mod-wsgi

我已经尝试了过去2天的一切。但没有什么能真正帮助我。

后台:我跟着this在生产中安装了烧瓶应用,但我需要更改serverName文件中的vhost,所以我忘了杀死已经运行的烧瓶app / process和编辑过的相同vhost文件指向其他位置,几乎没有变化。

问题:现在,在重新启动apache之后,当我访问修改后的serverName时,我会继续收到以下错误消息。

mod_wsgi (pid=1685): Target WSGI script '/var/www/html/machine/machine.wsgi' cannot be loaded as Python module., referer: http://dev.badiyajobs.com/
mod_wsgi (pid=1685): Exception occurred processing WSGI script '/var/www/html/machine/machine.wsgi'., referer: http://dev.badiyajobs.com/
Traceback (most recent call last):
File "/var/www/html/machine/machine.wsgi", line$
from run import app as application
File "/var/www/html/machine/assessment/run.py",$
app.run()
File "/usr/local/lib/python2.7/dist-packages/fl$
run_simple(host, port, self, **options)
File "/usr/local/lib/python2.7/dist-packages/we$
 inner()
File "/usr/local/lib/python2.7/dist-packages/we$
 fd=fd)
File "/usr/local/lib/python2.7/dist-packages/we$
 passthrough_errors, ssl_context, fd=fd)
File "/usr/local/lib/python2.7/dist-packages/we$
HTTPServer.__init__(self, (host, int(port)), $
File "/usr/lib/python2.7/SocketServer.py", line$
self.server_bind()
File "/usr/lib/python2.7/BaseHTTPServer.py", li$
SocketServer.TCPServer.server_bind(self)
File "/usr/lib/python2.7/SocketServer.py", line$
[self.socket.bind(self.server_address)
File "/usr/lib/python2.7/socket.py", line 224, $
return getattr(self._sock,name)(*args)
error: [Errno 98] Address already in use

任何人请建议如何摆脱已经运行的应用程序。我已经尝试了许多关于杀戮过程的事情,但注意到实际上有效。

1 个答案:

答案 0 :(得分:0)

杀死正在侦听该端口的所有进程的最简单方法是使用fuser(1)命令。例如,要查看在端口80上侦听http请求的所有进程(以root身份运行或使用sudo):

fuser 80/tcp

如果你想杀死他们,那么只需添加' -k'选项

Source