Giter VIP home page Giter VIP logo

Comments (2)

Dwijad avatar Dwijad commented on July 29, 2024

I am attaching more information as it looks mod_wsgi is compiled against python3 and apache2 is using python3 module ( apt-get install libapache2-mod-wsgi-py3 ).

root@demohost:~# cat /etc/apache2/mods-available/wsgi.load
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so

root@demohost:~# ldd /usr/lib/apache2/modules/mod_wsgi.so
linux-vdso.so.1 => (0x00007ffe7f9ea000)
libpython3.5m.so.1.0 => /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0 (0x00007f9f26c1a000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9f269fd000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f9f26633000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f9f2640a000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f9f261f0000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f9f25feb000)
libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f9f25de8000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9f25adf000)
/lib64/ld-linux-x86-64.so.2 (0x0000563d3323d000)
root@demohost:~#

Apache Logs (Debug mode)
[Thu Jan 26 07:07:09.156047 2017] [wsgi:info] [pid 4064] mod_wsgi (pid=4064): Initializing Python.
[Thu Jan 26 07:07:09.171233 2017] [wsgi:info] [pid 4064] mod_wsgi (pid=4064): Attach interpreter ''.
[Thu Jan 26 07:07:09.908074 2017] [ssl:debug] [pid 4004] ssl_engine_kernel.c(2023): [client 117.227.65.236:34900] AH02041: Protocol: TLSv1.2, Cipher: ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
[Thu Jan 26 07:07:09.908272 2017] [ssl:debug] [pid 4004] ssl_engine_kernel.c(354): [client 117.227.65.236:34900] AH02034: Initial (No.1) HTTPS request received for child 2 (server demohost.com:443)
[Thu Jan 26 07:07:09.908395 2017] [authz_core:debug] [pid 4004] mod_authz_core.c(809): [client 117.227.65.236:34900] AH01626: authorization result of Require all granted: granted
[Thu Jan 26 07:07:09.908440 2017] [authz_core:debug] [pid 4004] mod_authz_core.c(809): [client 117.227.65.236:34900] AH01626: authorization result of : granted
[Thu Jan 26 07:07:09.908563 2017] [authz_core:debug] [pid 4004] mod_authz_core.c(809): [client 117.227.65.236:34900] AH01626: authorization result of Require all granted: granted
[Thu Jan 26 07:07:09.908608 2017] [authz_core:debug] [pid 4004] mod_authz_core.c(809): [client 117.227.65.236:34900] AH01626: authorization result of : granted
[Thu Jan 26 07:07:09.921327 2017] [wsgi:info] [pid 4001] mod_wsgi (pid=4001): Create interpreter 'demohost.com|'.
[Thu Jan 26 07:07:09.933245 2017] [wsgi:info] [pid 4001] mod_wsgi (pid=4001): Adding '/opt/apps/RatticWeb' to path.
[Thu Jan 26 07:07:09.933819 2017] [wsgi:info] [pid 4001] [remote 117.227.65.236:57350] mod_wsgi (pid=4001, process='rattic', application='demohost.com|'): Loading WSGI script '/opt/apps/RatticWeb/ratticweb/wsgi.py'.
[Thu Jan 26 07:07:09.934173 2017] [wsgi:error] [pid 4001] [remote 117.227.65.236:57350] mod_wsgi (pid=4001): Target WSGI script '/opt/apps/RatticWeb/ratticweb/wsgi.py' cannot be loaded as Python module.
[Thu Jan 26 07:07:09.934233 2017] [wsgi:error] [pid 4001] [remote 117.227.65.236:57350] mod_wsgi (pid=4001): Exception occurred processing WSGI script '/opt/apps/RatticWeb/ratticweb/wsgi.py'.
[Thu Jan 26 07:07:09.934410 2017] [wsgi:error] [pid 4001] [remote 117.227.65.236:57350] Traceback (most recent call last):
[Thu Jan 26 07:07:09.934479 2017] [wsgi:error] [pid 4001] [remote 117.227.65.236:57350] File "/opt/apps/RatticWeb/ratticweb/wsgi.py", line 22, in
[Thu Jan 26 07:07:09.934510 2017] [wsgi:error] [pid 4001] [remote 117.227.65.236:57350] from django.core.wsgi import get_wsgi_application
[Thu Jan 26 07:07:09.934549 2017] [wsgi:error] [pid 4001] [remote 117.227.65.236:57350] ImportError: No module named 'django'
[Thu Jan 26 07:07:09.934753 2017] [ssl:debug] [pid 4004] ssl_engine_io.c(1016): [client 117.227.65.236:34900] AH02001: Connection closed to child 2 with standard shutdown (server demohost.com:443)

Thanks

from ratticweb.

Dwijad avatar Dwijad commented on July 29, 2024

Hi
Able to solve the problem by compiling mod_wsgi against python3.5 and then creating apache configuration for wsgi (wsgi.load). The steps are given below if someone wants to compile and install mod_wsgi in ubuntu 16.04 . Also i have removed apache module for python3 that i have installed earlier using apt-get.

root@demohost:~# apt-get purge libapache2-mod-wsgi-py3
root@demohost:~# wget https://github.com/GrahamDumpleton/mod_wsgi/archive/develop.zip
root@demohost:~# unzip develop.zip
root@demohost:~# cd mod_wsgi-develop
root@demohost:~/mod_wsgi-develop#./configure --with-python=/usr/bin/python3.5
root@demohost:~/mod_wsgi-develop# make
root@demohost:~/mod_wsgi-develop# make install

root@demohost:~/mod_wsgi-develop# cd /etc/apache2/mods-available
root@demohost:/etc/apache2/mods-available# vi wsgi.load
LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so

root@demohost:/etc/apache2/mods-available# cd /etc/apache2/mods-enabled
root@demohost:/etc/apache2/mods-enabled# ln -s ../mods-available/wsgi.load .

root@demohost:/etc/apache2/mods-enabled# service apache2 start

Hope it helps others.
Thanks

from ratticweb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.