I am having difficulty writing a simple log file from a Flask 0.10.1 application running using Apache 2.2.15, mod_wsgi 3.5, python 2.6.6 on Red Hat 6.5 instance in the AWS cloud.
The apache log is showing the following error when I attempt to write the log file:
IOError: [Errno 13] Permission denied: '/var/tmp/log/nanodemo.log'
I used this Flask/wsgi tutorial to get things set up:
My application resides in /var/www/html/NanoDemo
Permissions on /var/tmp/log are wide open:
drwxrwxrwx. 2 ec2-user ec2-user 4096 Oct 16 16:00 log
/var/www/html/NanoDemo/routes.wsgi:
import sys
sys.path.insert(0, '/var/www/html/NanoDemo')
from routes import app as application
/etc/httpd/conf.d/routes.conf
WSGIDaemonProcess routes user=ec2-user group=ec2-user threads=5 home=/var/www/html/NanoDemo display-name=%{GROUP}
WSGIRestrictStdin Off
WSGIRestrictStdout Off
<VirtualHost *>
ServerName example.com
WSGIScriptAlias / /var/www/html/NanoDemo/routes.wsgi
<Directory /var/www/html/NanoDemo>
WSGIProcessGroup routes
WSGIApplicationGroup %{GLOBAL}
Order deny,allow
Allow from all
</Directory>
LogLevel warn
# ErrorLog /var/tmp/log/error.log
</VirtualHost>
/etc/httpd/conf.d/wsgi.conf:
LoadModule wsgi_module modules/mod_wsgi.so
WSGISocketPrefix /var/run/wsgi
Any help would be greatly appreciated!