Installed xampp on ubuntu-16.04.
XAMPP root installation location: /opt/lampp
Python 2.7.12 Django 1.11 XAMPP 5.6.30
The wsgi.py settings: ```python
import os
import sys
import site
site.addsitedir('/opt/lampp/htdocs/dpcm/dpcm/lib/python2.7/site-packages')
sys.path.insert(0, '/opt/lampp/htdocs/dpcm')
sys.path.insert(1, '/opt/lampp/htdocs/dpcm/dpcm1')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dpcm1.settings")
os.environ.setdefault("PYTHON_EGG_CACHE", "/opt/lampp/htdocs/dpcm/.python-eggs")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
# if import ssl module, it will occur an error.
import ssl
```
/opt/lampp/apache2/conf/httpd.conf content:
Alias /bitnami/ "/opt/lampp/apache2/htdocs/"
Alias /bitnami "/opt/lampp/apache2/htdocs"
<Directory "/opt/lampp/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
WSGIScriptAlias /dpcm/ /opt/lampp/htdocs/dpcm/dpcm1/wsgi.py
#WSGIDaemonProcess /dpcm/ python-path=/opt/lampp/htdocs/dpcm:/opt/lampp/htdocs/dpcm/dpcm/lib/python2.7/site-packages
#WSGIProcessGroup /dpcm/
WSGIPythonPath /opt/lampp/htdocs/dpcm
WSGIPythonHome /opt/lampp/htdocs/dpcm/dpcm/
<Directory /opt/lampp/htdocs/dpcm/dpcm1>
<Files wsgi.py>
Order deny,allow
Require all granted
</Files>
</Directory>
Alias /static/ /opt/lampp/htdocs/dpcm/static/
<Directory /opt/lampp/htdocs/dpcm/static>
Order allow,deny
Allow from all
</Directory>
if import ssl module in inactive-mode, it can be imported successfully. But if add 'import ssl' in wsgi.py or other django project file, there will report an error message:
[Thu Jun 01 10:54:13.272126 2017] [wsgi:error] [pid 5430] [client 10.0.2.15:41534] mod_wsgi (pid=5430): Target WSGI script '/opt/lampp/htdocs/dpcm/dpcm1/wsgi.py' cannot be loaded as Python module.
[Thu Jun 01 10:54:13.272176 2017] [wsgi:error] [pid 5430] [client 10.0.2.15:41534] mod_wsgi (pid=5430): Exception occurred processing WSGI script '/opt/lampp/htdocs/dpcm/dpcm1/wsgi.py'.
[Thu Jun 01 10:54:13.272207 2017] [wsgi:error] [pid 5430] [client 10.0.2.15:41534] Traceback (most recent call last):
[Thu Jun 01 10:54:13.272230 2017] [wsgi:error] [pid 5430] [client 10.0.2.15:41534] File "/opt/lampp/htdocs/dpcm/dpcm1/wsgi.py", line 33, in <module>
[Thu Jun 01 10:54:13.272308 2017] [wsgi:error] [pid 5430] [client 10.0.2.15:41534] import ssl
[Thu Jun 01 10:54:13.272320 2017] [wsgi:error] [pid 5430] [client 10.0.2.15:41534] File "/usr/lib/python2.7/ssl.py", line 97, in <module>
[Thu Jun 01 10:54:13.276754 2017] [wsgi:error] [pid 5430] [client 10.0.2.15:41534] import _ssl # if we can't import it, let the error propagate
[Thu Jun 01 10:54:13.276826 2017] [wsgi:error] [pid 5430] [client 10.0.2.15:41534] ImportError: /opt/lampp/lib/libssl.so.1.0.0: version `OPENSSL_1.0.1' not found (required by /opt/lampp/htdocs/dpcm/dpcm/lib/python2.7/lib-dynload/_ssl.x86_64-linux-gnu.so)
In normal, it link the .so to /usr/lib
, but it find in /opt/lampp/lib
,
so i think it is env variables issue.
Add following code in shell script: lampp
LD_LIBRARY_PATH='/usr/lib'
export LD_LIBRARY_PATH
and comment code
# if test "$(osguess)" = "macosx"
# then
# # Thanks to drosenbe! - oswald [3sep10]
# if test -z $DYLD_LIBRARY_PATH
# then
# export DYLD_LIBRARY_PATH="$LIBRARY_PATH"
# else
# export DYLD_LIBRARY_PATH="$LIBRARY_PATH:$DYLD_LIBRARY_PATH"
# fi
# else
# # Thanks to drosenbe! - oswald [3sep10]
# if test -z $LD_LIBRARY_PATH
# then
# export LD_LIBRARY_PATH="$LIBRARY_PATH"
# else
# export LD_LIBRARY_PATH="$LIBRARY_PATH:$LD_LIBRARY_PATH"
# fi
# fi
This is useless, does anybody have the same problem as me?