繁体   English   中英

在 Ubuntu 16.04 LTS 上使用 pgadmin4.15 和 apache 时出现内部服务器错误

[英]Internal Server Error when using pgadmin4.15 with apache on Ubuntu 16.04 LTS

我几乎按照这篇文章在我的ubuntu 16.04上设置了pgadmin 4 ,我跳过了安装PostgreSql的第一步,因为我想使用 AWS RDS。 但是当我尝试启动http://myipaddress/pgadmin4/时,我得到了500 Internal Server Error http://myipaddress确实让我进入了Apache2 Ubuntu 默认页面,但不确定我缺少什么配置。

我也遵循了这个并添加了建议的修复,但它对我不起作用。

这是error.log中的错误

[wsgi:warn] [pid 19605:tid 140528707069824] mod_wsgi: Compiled for Python/3.5.1+.  
[wsgi:warn] [pid 19605:tid 140528707069824] mod_wsgi: Runtime using Python/3.5.2.  
[mpm_event:notice] [pid 19605:tid 140528707069824] AH00489: Apache/2.4.18 (Ubuntu) mod_wsgi/4.3.0 Python/3.5.2 configured -- resuming normal operations  
[core:notice] [pid 19605:tid 140528707069824] AH00094: Command line: '/usr/sbin/apache2'  
[wsgi:error] [pid 19608:tid 140528601200384] [remote 8.28.16.254:0] mod_wsgi (pid=19608): Exception occurred processing WSGI script '/usr/share/pgadmin4/web/pgAdmin4.wsgi'.  
[wsgi:error] [pid 19608:tid 140528601200384] [remote 8.28.16.254:0] Traceback (most recent call last):  
[wsgi:error] [pid 19608:tid 140528601200384] [remote 8.28.16.254:0]   File "/usr/lib/python3/dist-packages/flask/app.py", line 1836, in __call__  
[wsgi:error] [pid 19608:tid 140528601200384] [remote 8.28.16.254:0]     return self.wsgi_app(environ, start_response)  
[wsgi:error] [pid 19608:tid 140528601200384] [remote 8.28.16.254:0]   File "/usr/share/pgadmin4/web/pgAdmin4.py", line 95, in __call__  
[pid 19608:tid 140528601200384] [remote 8.28.16.254:0]     return self.app(environ, start_response)  
[wsgi:error] [pid 19608:tid 140528601200384] [remote 8.28.16.254:0] AttributeError: 'ReverseProxied' object has no attribute 'app'

我遇到了与您完全相同的问题,我也尝试按照上面的链接进行修复,这就是我做错的地方:当我编辑 /usr/share/pgadmin4/web/pgAdmin4.py 时,我错误地把self.app = app 前的加号

 class ReverseProxied(object):
     def __init__(self, app):
         # https://werkzeug.palletsprojects.com/en/0.15.x/middleware/proxy_fix/#module-werkzeug.middleware.proxy_fix
+        self.app = app
         try:
             from werkzeug.middleware.proxy_fix import ProxyFix
             self.app = ProxyFix(app

一旦我把

 class ReverseProxied(object):
     def __init__(self, app):
         # https://werkzeug.palletsprojects.com/en/0.15.x/middleware/proxy_fix/#module-werkzeug.middleware.proxy_fix
         self.app = app
         try:
             from werkzeug.middleware.proxy_fix import ProxyFix
             self.app = ProxyFix(app

pgAdmin4 在系统重启后工作正常。 + 符号是 diff 的命令方式,让用户知道正在比较的文件之间的差异——这让我感到困惑。 这解决了我的问题。

我没有 + 符号。 出于某种原因,我的缩进弄乱了。 一旦我修复它,它就可以正常工作。

  File "/usr/share/pgadmin4/web/pgAdmin4.py", line 83
    except ImportError:
                      ^
IndentationError: unindent does not match any outer indentation level

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM