热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

nopythonapplicationfound_为什么我会得到“uWSGIErrorPythonapplicationnotfound”?

我有nginx配置:server{listen80;server_namemail.myserver.com;rewrite^(.*)https:$server_na

我有nginx配置:server

{

listen 80;

server_name mail.myserver.com;

rewrite ^(.*) https://$server_name$request_uri? permanent;

}

server

{

# By default we listen on all ips including ipv6 on port 443. We only respond to the server name here.

# If you have a default ssl website already comment out the next line and uncomment the one after..

listen 443;

#listen 443 ssl;

server_name mail.myserver.com;

# Our logs files.

access_log /var/log/nginx/iredmail-access.log;

error_log /var/log/nginx/iredmail-error.log;

# Startup SSL using iRedMails certs.

# If you made the ssl change above you will need to make this one to enable ssl.

ssl on;

ssl_certificate /etc/ssl/certs/iRedMail_CA.pem;

ssl_certificate_key /etc/ssl/private/iRedMail.key;

ssl_session_timeout 5m;

# We specify our root location to roundcubemail.

root /usr/share/apache2/roundcubemail/;

index index.html index.php;

# Aliasing some locations of static files.

location /iredadmin/static { alias /usr/share/apache2/iredadmin/static/;}

location /static { alias /usr/share/apache2/iredadmin/static/;}

location /awstats/icon { alias /usr/share/awstats/icon/;}

location /awstatsicon { alias /usr/share/awstats/icon/;}

# This allows webmail and roundcube as aliases to /mail/. The root is redirected to /mail.

rewrite ^/roundcubemail /mail/ permanent;

rewrite ^/webmail /mail/ permanent;

rewrite ^/$ /mail/ permanent;

# This is used to create a comparision to Apaches ability to alias that works with dynamic scripts.

location ~ /mail(.*)\.php($|/)

{

include fastcgi_params;

fastcgi_pass 127.0.0.1:9000;

#fastcgi_pass unix:/var/run/fpm-iredmail.sock;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME /usr/share/apache2/roundcubemail$1.php;

fastcgi_param SERVER_NAME $http_host;

fastcgi_ignore_client_abort on;

fastcgi_intercept_errors off;

}

location ~ /mail(.*)

{

autoindex on;

alias /usr/share/apache2/roundcubemail$1;

}

location /iredadmin {

root /usr/share/apache2/iredadmin/;

uwsgi_pass 127.0.0.1:9001;

#uwsgi_pass unix:///var/run/uwsgi/app/iredadmin/iredadmin.socket;

uwsgi_param UWSGI_PYHOME /usr/share/apache2/iredadmin/python-home;

uwsgi_param UWSGI_CHDIR /usr/share/apache2/iredadmin;

uwsgi_param UWSGI_SCRIPT iredadmin;

include uwsgi_params;

}

# Our phpMyAdmin service. Comment this section out if you don't want public access to it.

location ~ /phpmyadmin(.*)\.php($|/)

{

include fastcgi_params;

fastcgi_pass 127.0.0.1:9000;

#uwsgi_pass unix:///var/run/uwsgi/app/iredadmin/iredadmin.socket;

uwsgi_param UWSGI_PYHOME /usr/share/apache2/iredadmin/python-home;

uwsgi_param UWSGI_CHDIR /usr/share/apache2/iredadmin;

uwsgi_param UWSGI_SCRIPT iredadmin;

include uwsgi_params;

}

# Our phpMyAdmin service. Comment this section out if you don't want public access to it.

location ~ /phpmyadmin(.*)\.php($|/)

{

include fastcgi_params;

fastcgi_pass 127.0.0.1:9000;

#fastcgi_pass unix:/var/run/fpm-iredmail.sock;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin$1.php;

fastcgi_param SERVER_NAME $http_host;

fastcgi_param HTTPS on;

fastcgi_param HTTP_SCHEME https;

fastcgi_ignore_client_abort on;

fastcgi_intercept_errors off;

port_in_redirect off;

}

location ~ /phpmyadmin(.*)

{

autoindex on;

alias /usr/share/phpmyadmin$1;

}

}

如果我转到/iredmail

uwsgi配置:

^{pr2}$

nginx日志:...

2013/07/30 14:47:04 [error] 15947#0: *56 open() "/usr/share/apache2/roundcubemail/favicon.ico" failed (2: No such file or directory ...

uwsgi日志:AttributeError: 'general'

Tue Jul 30 14:36:33 2013 - unable to load app 0 (mountpoint='mail.myserver.com|') (callable not found or import error)

mail.myserver.com [pid: 17788|app: -1|req: -1/2] 146.52.44.87 () {50 vars in 1421 bytes} [Tue Jul 30 14:36:33 2013] GET /iredadmin => generated 48 bytes in 9 msecs (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)

Traceback (most recent call last):

File "/usr/share/apache2/iredadmin/iredadmin.py", line 9, in

from libs import iredbase

File "/usr/share/apache2/iredadmin/libs/iredbase.py", line 34, in

webmaster = cfg.general.get('webmaster', 'root')

File "/usr/lib/python2.7/dist-packages/web/utils.py", line 76, in __getattr__

raise AttributeError, k

AttributeError: 'general'

Tue Jul 30 14:41:31 2013 - unable to load app 0 (mountpoint='mail.myserver.com|') (callable not found or import error)

mail.myserver.com [pid: 17787|app: -1|req: -1/3] 146.52.44.87 () {48 vars in 1390 bytes} [Tue Jul 30 14:41:31 2013] GET /iredadmin => generated 48 bytes in 4 msecs (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)

Traceback (most recent call last):

File "/usr/share/apache2/iredadmin/iredadmin.py", line 9, in

from libs import iredbase

File "/usr/share/apache2/iredadmin/libs/iredbase.py", line 34, in

webmaster = cfg.general.get('webmaster', 'root')

File "/usr/lib/python2.7/dist-packages/web/utils.py", line 76, in __getattr__

raise AttributeError, k

AttributeError: 'general'

Tue Jul 30 14:47:04 2013 - unable to load app 0 (mountpoint='mail.myserver.com|') (callable not found or import error)

mail.myserver.com [pid: 17787|app: -1|req: -1/4] 146.52.44.87 () {50 vars in 1421 bytes} [Tue Jul 30 14:47:04 2013] GET /iredadmin => generated 48 bytes in 6 msecs (HTTP/1.1 500) 2 headers in 63 bytes (0 switches on core 0)

(END)



推荐阅读
  • 用阿里云的免费 SSL 证书让网站从 HTTP 换成 HTTPS
    HTTP协议是不加密传输数据的,也就是用户跟你的网站之间传递数据有可能在途中被截获,破解传递的真实内容,所以使用不加密的HTTP的网站是不 ... [详细]
  • PTArchiver工作原理详解与应用分析
    PTArchiver工作原理及其应用分析本文详细解析了PTArchiver的工作机制,探讨了其在数据归档和管理中的应用。PTArchiver通过高效的压缩算法和灵活的存储策略,实现了对大规模数据的高效管理和长期保存。文章还介绍了其在企业级数据备份、历史数据迁移等场景中的实际应用案例,为用户提供了实用的操作建议和技术支持。 ... [详细]
  • 本文详细介绍了使用 Python 进行 MySQL 和 Redis 数据库操作的实战技巧。首先,针对 MySQL 数据库,通过 `pymysql` 模块展示了如何连接和操作数据库,包括建立连接、执行查询和更新等常见操作。接着,文章深入探讨了 Redis 的基本命令和高级功能,如键值存储、列表操作和事务处理。此外,还提供了多个实际案例,帮助读者更好地理解和应用这些技术。 ... [详细]
  • 微信公众号推送模板40036问题
    返回码错误码描述说明40001invalidcredential不合法的调用凭证40002invalidgrant_type不合法的grant_type40003invalidop ... [详细]
  • 本文详细介绍了 PHP 中对象的生命周期、内存管理和魔术方法的使用,包括对象的自动销毁、析构函数的作用以及各种魔术方法的具体应用场景。 ... [详细]
  • 思科IOS XE与ISE集成实现TACACS认证配置
    本文详细介绍了如何在思科IOS XE设备上配置TACACS认证,并通过ISE(Identity Services Engine)进行用户管理和授权。配置包括网络拓扑、设备设置和ISE端的具体步骤。 ... [详细]
  • 本文介绍了如何利用HTTP隧道技术在受限网络环境中绕过IDS和防火墙等安全设备,实现RDP端口的暴力破解攻击。文章详细描述了部署过程、攻击实施及流量分析,旨在提升网络安全意识。 ... [详细]
  • 开机自启动的几种方式
    0x01快速自启动目录快速启动目录自启动方式源于Windows中的一个目录,这个目录一般叫启动或者Startup。位于该目录下的PE文件会在开机后进行自启动 ... [详细]
  • 如何使用 `org.opencb.opencga.core.results.VariantQueryResult.getSource()` 方法及其代码示例详解 ... [详细]
  • DVWA学习笔记系列:深入理解CSRF攻击机制
    DVWA学习笔记系列:深入理解CSRF攻击机制 ... [详细]
  • 在 Vue 应用开发中,页面状态管理和跨页面数据传递是常见需求。本文将详细介绍 Vue Router 提供的两种有效方式,帮助开发者高效地实现页面间的数据交互与状态同步,同时分享一些最佳实践和注意事项。 ... [详细]
  • PHP自学必备:从零开始的准备工作与工具选择 ... [详细]
  • 在使用SSH框架进行项目开发时,经常会遇到一些常见的问题。例如,在Spring配置文件中配置AOP事务声明后,进行单元测试时可能会出现“No Hibernate Session bound to thread”的错误。本文将详细探讨这一问题的原因,并提供有效的解决方案,帮助开发者顺利解决此类问题。 ... [详细]
  • 2012年9月12日优酷土豆校园招聘笔试题目解析与备考指南
    2012年9月12日,优酷土豆校园招聘笔试题目解析与备考指南。在选择题部分,有一道题目涉及中国人的血型分布情况,具体为A型30%、B型20%、O型40%、AB型10%。若需确保在随机选取的样本中,至少有一人为B型血的概率不低于90%,则需要选取的最少人数是多少?该问题不仅考察了概率统计的基本知识,还要求考生具备一定的逻辑推理能力。 ... [详细]
  • 在腾讯云服务器上部署Nginx的详细指南中,首先需要确保安装必要的依赖包。如果这些依赖包已安装,可直接跳过此步骤。具体命令包括 `yum -y install gcc gcc-c++ wget net-tools pcre-devel zlib-devel`。接下来,本文将详细介绍如何下载、编译和配置Nginx,以确保其在腾讯云服务器上顺利运行。此外,还将提供一些优化建议,帮助用户提升Nginx的性能和安全性。 ... [详细]
author-avatar
温蚊童鞋_612
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有