【问题标题】:Internal Server Error when using pgadmin4.15 with apache on Ubuntu 16.04 LTS在 Ubuntu 16.04 LTS 上使用 pgadmin4.15 和 apache 时出现内部服务器错误
【发布时间】:2019-12-12 16:18:37
【问题描述】:

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

我也关注了this 并添加了建议的修复,但它对我不起作用。

这是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'

【问题讨论】:

  • 这个问题已经回答here

标签: python apache ubuntu pgadmin-4


【解决方案1】:

我遇到了与您完全相同的问题,并且我也尝试按照上面的链接进行修复,这就是我做错了:当我编辑 /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 的命令方式,让用户了解正在比较的文件之间的差异 - 这让我感到困惑。这解决了我的问题。

【讨论】:

    【解决方案2】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-26
      • 2018-10-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-16
      相关资源
      最近更新 更多