Hi all,
I've been banging my head against the wall trying to fix this. This issue
<https://github.com/GrahamDumpleton/mod_wsgi-docker/issues/6> seems similar
but I haven't been able to wrangle a solution out of it.
- mod_wsgi 4.3
- Apache 2.4
- Debian Jessie
- Python 2.7.9
I'm trying to setup a Docker image running a Flask app and I've gotten to a
point where I can run the Flask local development server and retrieve
(pretty simple, templated html) pages. When I try to run it on Apache
though, there is a gateway timeout and I find the following error in my
VirutalHost log file:
[wsgi:error] ... Timeout when reading response headers from daemon process
'molmod': /var/www/app/molmod.wsgi
In the genreal Apache log file there is the following error over and over:
[wsgi:alert] ... mod_wsgi (pid=<x>): Failure to configure the daemon
process correctly and process left in unspecified state. Restarting daemon
process after delay.
It seems like the daemon gets stuck restarting over and over instead of
serving the Flask site.
Here is my config file:
ErrorLog logs/error_log
WSGISocketPrefix /var/run
# turn off initialization of Python interpreter
WSGIRestrictEmbedded On
<VirtualHost *:80>
Alias /static/ /var/www/app/static/
<Directory /var/www/app/static/>
Require all granted
</Directory>
WSGIDaemonProcess molmod user=flask_user group=flask_group threads=5
WSGIScriptAlias / /var/www/app/molmod.wsgi
<Directory /var/www/app>
WSGIProcessGroup molmod
WSGIApplicationGroup %{GLOBAL}
Require all granted
</Directory>
LogLevel info
ErrorLog logs/flask_log
</VirtualHost>
If it helps at all, here is the Dockerfile I am using as well:
FROM httpd:2.4
RUN apt-get -y update && \
apt-get install -y libapache2-mod-wsgi
RUN useradd flask_user && groupadd flask_group
COPY ./molmod /var/www/app
RUN apt-get install -y python-pip && \
pip install -r /var/www/app/requirements.txt
COPY ./httpd.conf /tmp/httpd.conf
RUN echo "LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so" >> \
"$HTTPD_PREFIX"/conf/httpd.conf
RUN cat /tmp/httpd.conf >> "$HTTPD_PREFIX"/conf/httpd.conf && \
rm /tmp/httpd.conf
EXPOSE 80
CMD ["httpd-foreground"]
Thanks in advance!
--
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.