全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 16386|回复: 5
打印 上一主题 下一主题

[Windows VPS] zmirror反代网站时遇到wsgi.py无法作为python启动

[复制链接]
跳转到指定楼层
1#
发表于 2016-11-7 13:32:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
100金钱
请大神指点,我换过ubuntu14.04 和 ubuntu16.04,每次安装都会出现提示,部署完成后,启动apache,会提示:
  1. AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using ::1. Set the 'ServerName' directive globally to suppress this message
复制代码


日志里是这样的:

  1. [Mon Nov 07 11:25:55.022520 2016] [wsgi:error] [pid 8692:tid 140677276653312] [remote 105.xx.xx.xx:57606] mod_wsgi (pid=8692): Target WSGI script '/var/www/zmirror/wsgi.py' cannot be loaded as Python module.
  2. [Mon Nov 07 11:25:55.022658 2016] [wsgi:error] [pid 8692:tid 140677276653312] [remote 105.xx.xx.xx:57606] mod_wsgi (pid=8692): Exception occurred processing WSGI script '/var/www/zmirror/wsgi.py'.
  3. [Mon Nov 07 11:25:55.022716 2016] [wsgi:error] [pid 8692:tid 140677276653312] [remote 105.xx.xx.xx:57606] Traceback (most recent call last):
  4. [Mon Nov 07 11:25:55.022957 2016] [wsgi:error] [pid 8692:tid 140677276653312] [remote 105.xx.xx.xx:57606]   File "/var/www/zmirror/wsgi.py", line 9, in <module>
  5. [Mon Nov 07 11:25:55.022966 2016] [wsgi:error] [pid 8692:tid 140677276653312] [remote 105.xx.xx.xx:57606]     from zmirror.zmirror import app as application
  6. [Mon Nov 07 11:25:55.024276 2016] [wsgi:error] [pid 8692:tid 140677276653312] [remote 105.xx.xx.xx:57606]   File "/var/www/zmirror/zmirror/zmirror.py", line 23, in <module>
  7. [Mon Nov 07 11:25:55.024288 2016] [wsgi:error] [pid 8692:tid 140677276653312] [remote 105.xx.xx.xx:57606]     from flask import Flask, request, make_response, Response, redirect
  8. [Mon Nov 07 11:25:55.024323 2016] [wsgi:error] [pid 8692:tid 140677276653312] [remote 105.xx.xx.xx:57606] ImportError: No module named 'flask'
  9. [Mon Nov 07 11:25:57.342697 2016] [wsgi:error] [pid 8692:tid 140677343794944] [remote 105.xx.xx.xx:44294] mod_wsgi (pid=8692): Target WSGI script '/var/www/zmirror/wsgi.py' cannot be loaded as Python module.
  10. [Mon Nov 07 11:25:57.342775 2016] [wsgi:error] [pid 8692:tid 140677343794944] [remote 105.xx.xx.xx:44294] mod_wsgi (pid=8692): Exception occurred processing WSGI script '/var/www/zmirror/wsgi.py'.
  11. [Mon Nov 07 11:25:57.342814 2016] [wsgi:error] [pid 8692:tid 140677343794944] [remote 105.xx.xx.xx:44294] Traceback (most recent call last):
  12. [Mon Nov 07 11:25:57.342858 2016] [wsgi:error] [pid 8692:tid 140677343794944] [remote 105.xx.xx.xx:44294]   File "/var/www/zmirror/wsgi.py", line 9, in <module>
  13. [Mon Nov 07 11:25:57.342863 2016] [wsgi:error] [pid 8692:tid 140677343794944] [remote 105.xx.xx.xx:44294]     from zmirror.zmirror import app as application
  14. [Mon Nov 07 11:25:57.342884 2016] [wsgi:error] [pid 8692:tid 140677343794944] [remote 105.xx.xx.xx:44294]   File "/var/www/zmirror/zmirror/zmirror.py", line 23, in <module>
  15. [Mon Nov 07 11:25:57.342887 2016] [wsgi:error] [pid 8692:tid 140677343794944] [remote 105.xx.xx.xx:44294]     from flask import Flask, request, make_response, Response, redirect
  16. [Mon Nov 07 11:25:57.342905 2016] [wsgi:error] [pid 8692:tid 140677343794944] [remote 105.xx.xx.xx:44294] ImportError: No module named 'flask'

复制代码

最佳答案

查看完整内容

pip install flask
2#
发表于 2016-11-7 13:32:07 | 只看该作者
pip install flask
3#
 楼主| 发表于 2016-11-7 13:53:36 | 只看该作者

我试试
4#
 楼主| 发表于 2016-11-7 13:59:41 | 只看该作者

还是不行,启动apache还是一样的提示
访问https是500错误
5#
发表于 2016-11-7 17:02:52 来自手机 | 只看该作者
别用apache,用nginx,代理127.0.0.1:端口,域名在config.py和nginx虚拟主机配置文件的servername里面设置,前提是运行wsgi.py没问题,zmirror需要python3运行,需要requests的python模块,都是在python3里面,如果用pip安装,要使用pip3 install XXX,最好下载源码编译安装,别用pip安装,编译安装命令一共两条,python3 setup.py build和python3 setup.py install
6#
 楼主| 发表于 2016-11-7 17:26:58 | 只看该作者
enta 发表于 2016-11-7 17:02
别用apache,用nginx,代理127.0.0.1:端口,域名在config.py和nginx虚拟主机配置文件的servername里面设置 ...

谢谢,不过金币没有了,精神上感谢
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-6-11 19:26 , Processed in 0.074630 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表