Localhost服务器拒绝连接 [英] Localhost Server Refusing Connection

查看:2116
本文介绍了Localhost服务器拒绝连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在Dreamhost服务器上设置了Django.遍历所有内容,但似乎无法获得欢迎页面.我的意思是,开发服务器正在127.0.0.1:8002运行(尝试使用8000,但收到该端口已被使用的错误)".当我尝试在Chrome浏览器中访问该地址时,出现错误102(net :: ERR_CONNECTION_REFUSED):服务器拒绝了连接.

I just set up Django on a dreamhost server. Ran through everything, but can't seem to get the welcome page. I got to the point where it says "Development server is running at 127.0.0.1:8002 (tried with 8000 but got the "that port is already in use error). When I try to access that address in my browser in Chrome I get Error 102 (net::ERR_CONNECTION_REFUSED): The server refused the connection.

知道为什么会这样吗?我陷入了困境,我不知道发生了什么.衷心感谢您的帮助.

Any idea why this is happening? I am stuck in a loop, I have no clue what is going on. Help is sincerely appreciated.

推荐答案

您需要知道服务器的IP或域地址.如果您使用example.com访问服务器SSH,请使用

You need to know your server's IP or domain address. If you used example.com to access you server SSH, then launching Django with

./manage.py运行服务器0.0.0.0:8002

./manage.py runserver 0.0.0.0:8002

,并可以使用http://example.com:8002访问它.但是,如果您只知道IP,请使用该IP而不是

and accessing it with http://example.com:8002 should work. But if you only know IP, then launch Django with that IP instead of

0.0.0.0

0.0.0.0

并使用http://YOUR-IP:8002

这篇关于Localhost服务器拒绝连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆