gunicorn不是从端口80开始,而是从端口8000开始

时间:2016-10-19 02:44:27

标签: python django gunicorn

我正在使用gunicorn并尝试编写upstart脚本。我在命令行中测试命令,对于端口80,它只是出错

命令

<meta charset="UTF-8" />
<input id="input" type="text" pattern="^[a-zA-Z]+(?:\s[a-zA-Z]+$|$)" required autofocus/>
<label for="input"></label>

日志

gunicorn --bind 0.0.0.0:80 --workers 3 myapp.wsgi:application

为什么这不起作用的任何想法?有时它适用于端口8000。

2 个答案:

答案 0 :(得分:1)

如果您使用的是类Unix环境,则<1024(例如80)端口将需要超级用户特权。

根据问题:https://stackoverflow.com/a/16225928/6823310

最初由:

回答

https://stackoverflow.com/users/358328/uku-loskit

这就是为什么端口8000有效而端口80不起作用的原因。

尝试使用sudo运行命令。

否则,请检查该端口是否尚未被其他服务使用。

答案 1 :(得分:0)

为此,您必须使用“ sudo”命令。

select * from ( select dpd.objectid as id1, ss.objectid as id2, ohp.objectid as id3 , ohs.objectid as id4, ugp.objectid as id5, ugs.objectid as id6, s.objectid as id7, t.objectid as id8 from mvdynamicprotectivedevice dpd FULL OUTER JOIN mvsupportstructure ss ON (dpd.fema_wo = ss.fema_wo) FULL OUTER JOIN mvoverheadprimaryline ohp ON (dpd.fema_wo = ohp.fema_wo) FULL OUTER JOIN overheadsecondaryline ohs ON (dpd.fema_wo = ohs.fema_wo) FULL OUTER JOIN mvundergroundprimaryline ugp ON (dpd.fema_wo = ugp.fema_wo) FULL OUTER JOIN undergroundsecondaryline ugs ON (dpd.fema_wo = ugs.fema_wo) FULL OUTER JOIN mvswitch s ON (dpd.fema_wo = s.fema_wo) FULL OUTER JOIN mvtransformer t ON (dpd.fema_wo = t.fema_wo) WHERE dpd.fema_wo = 'WBS.F.81109.1.1.2' ) unpivot ( objectid for objectid in (id1, id2, id3, id4, id5, id6, id7, id8) );

端口80需要超级用户特权。