>
> Latest update:
>>
>
No virtual environment. Python3.6 is now installed into the system folder:
python location:
*/etc/apache2/sites-available*$ python --version
Python 3.6.5
python
Python 3.6.5 (default, May 3 2018, 10:08:28)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.prefix)
/usr
Flask location:
>>> import flask
>>> print(flask.__file__)
/usr/local/lib/python3.6/dist-packages/flask/__init__.py
mod_wsgi-express module-config
LoadModule wsgi_module
"/usr/local/lib/python3.6/dist-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so"
WSGIPythonHome "/usr"
cat wsgi.load
LoadModule wsgi_module
/usr/local/lib/python3.6/dist-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so
*/etc/apache2/sites-available*$ cat FlaskApp.conf
<VirtualHost *:83>
ServerName flaskapp.com
WSGIDaemonProcess flaskapp.com python-home=/usr
python-path=/var/www/FlaskApp
WSGIScriptAlias / /var/www/FlaskApp/flaskapp.wsgi
process-group=flaskapp.com application-group=%{GLOBAL}
<Directory /var/www/FlaskApp/>
<Files flaskapp.wsgi>
Require all granted
</Files>
</Directory>
</VirtualHost>
*/etc/apache2/mods-available*$ cat wsgi.conf
<IfModule mod_wsgi.c>
WSGIRestrictEmbedded On
</IfModule>
Testing:
curl -sH 'Host: flaskapp.com' localhost:83|grep title
<*title*>500 Internal Server Error</*title*>
tail -l /var/log/apache2/error.log
[Wed Jun 13 22:18:08.678744 2018] [wsgi:error] [pid 3095] [remote
127.0.0.1:57590] from werkzeug.exceptions import abort
[Wed Jun 13 22:18:08.678749 2018] [wsgi:error] [pid 3095] [remote
127.0.0.1:57590] File
"/usr/local/lib/python3.6/dist-packages/werkzeug/__init__.py", line 151, in
<module>
[Wed Jun 13 22:18:08.678752 2018] [wsgi:error] [pid 3095] [remote
127.0.0.1:57590] __import__('werkzeug.exceptions')
[Wed Jun 13 22:18:08.678756 2018] [wsgi:error] [pid 3095] [remote
127.0.0.1:57590] File
"/usr/local/lib/python3.6/dist-packages/werkzeug/exceptions.py", line 67,
in <module>
[Wed Jun 13 22:18:08.678759 2018] [wsgi:error] [pid 3095] [remote
127.0.0.1:57590] from werkzeug._internal import _get_environ
[Wed Jun 13 22:18:08.678764 2018] [wsgi:error] [pid 3095] [remote
127.0.0.1:57590] File
"/usr/local/lib/python3.6/dist-packages/werkzeug/_internal.py", line 15, in
<module>
[Wed Jun 13 22:18:08.678766 2018] [wsgi:error] [pid 3095] [remote
127.0.0.1:57590] from datetime import datetime, date
[Wed Jun 13 22:18:08.678771 2018] [wsgi:error] [pid 3095] [remote
127.0.0.1:57590] File "/usr/lib/python3.6/datetime.py", line 8, in
<module>
[Wed Jun 13 22:18:08.678773 2018] [wsgi:error] [pid 3095] [remote
127.0.0.1:57590] import math as _math
[Wed Jun 13 22:18:08.678786 2018] [wsgi:error] [pid 3095] [remote
127.0.0.1:57590] ModuleNotFoundError: No module named 'math'
Running FlaskApp on its own:
*/var/www/FlaskApp/FlaskApp*$ python __init__.py
* Serving Flask app "__init__" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [13/Jun/2018 22:25:23] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [13/Jun/2018 22:25:23] "GET /favicon.ico HTTP/1.1" 404 -
curl -sH 'Host: flaskapp.com' localhost:5000
Hello, this is running from flasK!
As you can see the FlaskApp is running fine.
Python and all modules are now installed in system locations and they are
running fine.
Apache2 is running fine. I have 2 other virtualhosts running serving
php/html pages
Still WSGI is still not setup correctly.
I'm shocked at the lack of decent documentation to get WCGI enabled on a
Apache2 server. What am I missing??
Don't you have some basic test code or files one can run to verify the WSGI
is setup correctly?
Please advise.
--Rajeev
--
You received this message because you are subscribed to the Google Groups
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.