suspicious workaround : pgadmin4.conf deleted to make apache2 startup, pgadmin4 runs without wsgi

System : **
Operating System: openSUSE Tumbleweed 20190403
KDE Plasma Version: 5.15.3
KDE Frameworks Version: 5.56.0
Qt Version: 5.12.2
Kernel Version: 5.0.5-1-default
OS Type: 64-bit
Processors: 4 × Intel® Core™ i7-5500U CPU @ 2.40GHz
Memory: 7,7 Gio
**
Applications :

pgadmin4
(and apache2, postgresql)

**Issue :
**
Hi everybody,

in order to configure a users database for a website in development, I installed pgadmin4 after Apache2 and Postgresql (LAPP), both of them were running fine. After installing pgadmin4 yesterday, it ran a couple hours and I could begin to configure my database.

This morning, I could not start apache2, it returned the error :

httpd-prefork: Syntax error on line 227 of  /etc/apache2/httpd.conf: Syntax error on line 32 of  /etc/apache2/vhosts.d/00_default.conf: Syntax error on line 1 of  /etc/apache2/conf.d/pgadmin4.conf: Cannot load modules/mod_wsgi.so into  server: /srv/www/modules/mod_wsgi.so: cannot open shared object file: No  such file or directory

default vhost and default-server.conf have an include instruction for /etc/apache2/*.conf, and pgadmin4.conf begins with :

LoadModule wsgi_module modules/mod_wsgi.so

But there is no directory named ‘module’ in ‘/srv/www’, and beyond, no mod_wsgi.so on my system. So apache2 startup aborts.

As a workaround, I just renamed pgadmin4.conf to pgadmin4.conf.bak (instead of simply deleting it), which at least allows me to run apache2.

The weird thing is that pgadmin4 seems to still work well in my browser ! :\ I can browse the tables and make SQL queries.

So does it mean that **pgadmin4.conf (in /etc/apache2/conf.d) is useless ? **And since it tries to load module wsgi, is this one useless too ? If so, why was it added during installation ?
I’m afraid my workaround is awkward and could cause some issues.

Thanks for your hints.

Is apache2-mod_wsgi installed? Installing it should enable and load the module. The pgadmin4.conf cannot do that, since it starts with apache2 already running.
So, my educated guess is you have to install the module, and remove the conflicting line. I’m not sure, but you may have to restart apache2 after installing.

From time to time, I’ve run into this Apache mod_wsgi and wondered about it because I’ve only ever seen and configured it in a python website (typically Django). So, took this opportunity to look it up and confirmed by suspicions

https://modwsgi.readthedocs.io/en/develop/

Probably bottom line is that if your website code doesn’t call and configure Python code, you have no need for it so your found solution should be fine (ignore the error, disable the configuration). Otherwise, if your website has python in it, you should consider maybe activating it (a2enmod).

If you don’t have python in your website code and your pgadmin.conf was installed as part of a pgadmin package from an openSUSE repo, you might want to submit a bug report at https://bugzilla.opensuse.org.

TSU

@Knurpht

You’re always so reactive ! It’s really helpful.

Is apache2-mod_wsgi installed?

No, I didn’t install apache2-mod_wsgi. I was about to do it, but at that moment I wondered whether it was mandatory, because 1) it was not specified as a dependence for pgadmin4, 2) pgadmin runs without it, isn’t it ? I like to understand things. What would it provide ? Of course it can’t be harmful, so if you think it’s better to do it OK, but if you can wrap some explanations with that, I’m fond of.

remove the conflicting line

Sorry, I could’nt understand which line it was. Do you mean the line in pgadmin.conf which loads wsgi module ? Probably not, so I am confused about that.

Yes, I think I’ve read some of your posts before (didn’t remember the username but the avatar), but as it was related to Django I didn’t take them into account. Had a look on this link and it says clearly that wsgi is for apache handling python web apps.

Probably bottom line is that if your website code doesn’t call and configure Python code, you have no need for it so your found solution should be fine (ignore the error, disable the configuration). Otherwise, if your website has python in it, you should consider maybe activating it (a2enmod).

I never use Python in my websites, in fact it is pgadmin4 that seemed to use it. pgadmin4 is a webapp for handling postgresql databases. But as I told before, this app works fine without wsgi. (When I could’nt install pgadmin4 on Ubuntu because it was still on pgadmin3, I used to install it through pythowheel … but I admit that I followed a tutorial without really understanding what I was doing … I still wonder what the heck python has to do with pgadmin4 … Python3 is installed anyway).

If you don’t have python in your website code and your pgadmin.conf was installed as part of a pgadmin package from an openSUSE repo, you might want to submit a bug report at https://bugzilla.opensuse.org.

TSU

I keep this option open.

Thanks !