no python application found_为什么我会得到“uWSGI Error Python application not found”?

我有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)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值