I am trying to install a server for inginious
(a program for automatic grading). One step in the installation is configuring Apache2 to use mod_wsgi. Here is the configuration file inginious.conf
:
<VirtualHost *:8081>
LoadModule wsgi_module /usr/local/lib/python3.6/dist-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-l$
WSGIScriptAlias / "/usr/local/bin/inginious-webapp"
WSGIScriptReloading On
Alias /static /usr/local/lib/python3.6/dist-packages/inginious/frontend/static
<Directory "/usr/local/bin">
<Files "inginious-webapp">
Require all granted
</Files>
</Directory>
<DirectoryMatch "/usr/local/lib/python3.6/dist-packages/inginious/frontend/static">
Require all granted
</DirectoryMatch>
ServerAdmin erelsgl@gmail.com
DocumentRoot /var/www/inginious
</VirtualHost>
<VirtualHost *:8082>
LoadModule wsgi_module /usr/local/lib/python3.6/dist-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-$
WSGIScriptAlias / "/usr/local/bin/inginious-webdav"
WSGIScriptReloading On
<Directory "/usr/local/bin">
<Files "inginious-webdav">
Require all granted
</Files>
</Directory>
</VirtualHost>
I enabled it using a2ensite inginious
and then systemctl reload apache2
. There are no errors in /var/log/apache2/error.log
. But netstat -tupln |grep 80
returns
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 1500/python3
tcp6 0 0 :::80 :::* LISTEN 852/apache2
which shows that no one is listening at ports 8081 and 8082.
On the other hand, apache2 -M
shows, among others,
wsgi_module (shared)
and apache2 -S
shows, among others,
*:8081 104.248.40.179 (/etc/apache2/sites-enabled/inginious.conf:1)
*:8082 104.248.40.179 (/etc/apache2/sites-enabled/inginious.conf:22)
which shows that Apache2 does read the wsgi configuration.
Here is the error.log
file just after reloading Apache2:
[Thu Feb 18 18:57:46.994117 2021] [socache_shmcb:info] [pid 12632] AH00830: Shared memory socache initialised
[Thu Feb 18 18:57:46.994139 2021] [ssl:info] [pid 12632] AH01887: Init: Initializing (virtual) servers for SSL
[Thu Feb 18 18:57:46.994146 2021] [ssl:info] [pid 12632] AH01876: mod_ssl/2.4.29 compiled against Server: Apache/2.4.29, Library: OpenSSL/1.1.1
[Thu Feb 18 18:57:46.994214 2021] [mpm_prefork:notice] [pid 12632] AH00163: Apache/2.4.29 (Ubuntu) OpenSSL/1.1.1 mod_wsgi/4.5.17 Python/3.6 configured -- resuming normal operations
[Thu Feb 18 18:57:46.994219 2021] [mpm_prefork:info] [pid 12632] AH00164: Server built: 2020-08-12T21:33:25
[Thu Feb 18 18:57:46.994222 2021] [core:notice] [pid 12632] AH00094: Command line: '/usr/sbin/apache2'
[Thu Feb 18 18:57:47.997715 2021] [wsgi:info] [pid 16827] mod_wsgi (pid=16827): Initializing Python.
[Thu Feb 18 18:57:48.000974 2021] [wsgi:info] [pid 16831] mod_wsgi (pid=16831): Initializing Python.
[Thu Feb 18 18:57:48.004725 2021] [wsgi:info] [pid 16830] mod_wsgi (pid=16830): Initializing Python.
[Thu Feb 18 18:57:48.006544 2021] [wsgi:info] [pid 16829] mod_wsgi (pid=16829): Initializing Python.
[Thu Feb 18 18:57:48.011627 2021] [wsgi:info] [pid 16828] mod_wsgi (pid=16828): Initializing Python.
[Thu Feb 18 18:57:48.063143 2021] [wsgi:info] [pid 16831] mod_wsgi (pid=16831): Attach interpreter ''.
[Thu Feb 18 18:57:48.067184 2021] [wsgi:info] [pid 16830] mod_wsgi (pid=16830): Attach interpreter ''.
[Thu Feb 18 18:57:48.072145 2021] [wsgi:info] [pid 16831] mod_wsgi (pid=16831): Imported 'mod_wsgi'.
[Thu Feb 18 18:57:48.072434 2021] [wsgi:info] [pid 16827] mod_wsgi (pid=16827): Attach interpreter ''.
[Thu Feb 18 18:57:48.073417 2021] [wsgi:info] [pid 16830] mod_wsgi (pid=16830): Imported 'mod_wsgi'.
[Thu Feb 18 18:57:48.080393 2021] [wsgi:info] [pid 16829] mod_wsgi (pid=16829): Attach interpreter ''.
[Thu Feb 18 18:57:48.083918 2021] [wsgi:info] [pid 16829] mod_wsgi (pid=16829): Imported 'mod_wsgi'.
[Thu Feb 18 18:57:48.084460 2021] [wsgi:info] [pid 16827] mod_wsgi (pid=16827): Imported 'mod_wsgi'.
[Thu Feb 18 18:57:48.088675 2021] [wsgi:info] [pid 16828] mod_wsgi (pid=16828): Attach interpreter ''.
[Thu Feb 18 18:57:48.091951 2021] [wsgi:info] [pid 16828] mod_wsgi (pid=16828): Imported 'mod_wsgi'.
What is wrong with my configuration?