Python: Difference between revisions
No edit summary |
|||
Line 34: | Line 34: | ||
gucken ob die Datei da ist: | |||
<u>gucken ob die Datei da ist:</u> | |||
Line 42: | Line 44: | ||
<u>gucken ob die .so da ist:</u> | |||
ll /usr/lib/apache2/modules/mod_python.so | '''ll /usr/lib/apache2/modules/mod_python.so''' | ||
-rw-r--r-- 1 root root 143K Jun 28 2013 /usr/lib/apache2/modules/mod_python.so | -rw-r--r-- 1 root root 143K Jun 28 2013 /usr/lib/apache2/modules/mod_python.so | ||
<u>Bei mir war die Zeile "LoadModule" komischerweise auskommentiert. Wenn ich sie wieder einkommentiere, dann startet Apache2 nicht mehr, ohne Fehlermeldung. Er sagt einfach</u> | |||
'''service apache2 restart''' | |||
Job for apache2.service failed because the control process exited with error code. | |||
See "systemctl status apache2.service" and "journalctl -xe" for details. | |||
'''systemctl status apache2.service''' | |||
apache2.service - The Apache HTTP Server | |||
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) | |||
Active: failed (Result: exit-code) since Sat 2023-05-06 17:03:31 CEST; 7s ago | |||
Docs: <nowiki>https://httpd.apache.org/docs/2.4/</nowiki> | |||
Process: 21674 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE) | |||
systemd[1]: Starting The Apache HTTP Server... | |||
apachectl[21674]: Action 'start' failed. | |||
apachectl[21674]: The Apache error log may have more information. | |||
systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE | |||
systemd[1]: apache2.service: Failed with result 'exit-code'. | |||
[systemd[1]: Failed to start The Apache HTTP Server. | |||
<u>Die error.log von Apache2 meinte daraufhin:</u> | |||
'''tail -n 100 /var/log/apache2/error.log''' | |||
[wsgi:crit] [pid 21542] mod_wsgi (pid=21542): The mod_python module can not be used in conjunction with mod_wsgi 4.0+. Remove the mod_python module from the Apache configuration. | |||
AH00016: Configuration Failed |
Revision as of 16:33, 6 May 2023
Web Programmierung
WSGI
apt-get install libapache2-mod-wsgi-py3
a2enmod wsgi
Apache2
Benoetigte Apache Module
libapache2-mod-python
- Python-embedding module for Apache 2
Optionale Apache Module
libapache2-mod-python-doc
- Python-embedding module for Apache 2 - documentation
Apache Fehler
Invalid command 'PythonHandler', perhaps misspelled or defined by a module not included in the server configuration
gucken ob die Datei da ist:
cat mods-available/python.load
LoadModule python_module /usr/lib/apache2/modules/mod_python.so
gucken ob die .so da ist:
ll /usr/lib/apache2/modules/mod_python.so
-rw-r--r-- 1 root root 143K Jun 28 2013 /usr/lib/apache2/modules/mod_python.so
Bei mir war die Zeile "LoadModule" komischerweise auskommentiert. Wenn ich sie wieder einkommentiere, dann startet Apache2 nicht mehr, ohne Fehlermeldung. Er sagt einfach
service apache2 restart
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
systemctl status apache2.service
apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2023-05-06 17:03:31 CEST; 7s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 21674 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
systemd[1]: Starting The Apache HTTP Server...
apachectl[21674]: Action 'start' failed.
apachectl[21674]: The Apache error log may have more information.
systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
systemd[1]: apache2.service: Failed with result 'exit-code'.
[systemd[1]: Failed to start The Apache HTTP Server.
Die error.log von Apache2 meinte daraufhin:
tail -n 100 /var/log/apache2/error.log
[wsgi:crit] [pid 21542] mod_wsgi (pid=21542): The mod_python module can not be used in conjunction with mod_wsgi 4.0+. Remove the mod_python module from the Apache configuration.
AH00016: Configuration Failed