I've been trying out quite a many things to the level of high frustration when trying to get Flask run with Apache + mod_wsgi.
Basically I've done the following tutorials:
But on browser I'm getting the following error:
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
And in Apache error.log the following:
[Fri May 03 17:17:06 2013] [error] [client ::1] client denied by server configuration: /home/user1/Develop/flask_dbadmin.wsgi
I'm running OpenSuse 11.4.
It sounds like Apache doesn't have access to the object in question. Make sure you have an account set up for this specific reason and give the files access this account. Then use
chown to set the access to these files for that user. In a development environment that can be for example the Apache account.
chown -R wwwrun:www /home/user1/Develop/
Or you could give everyone access, but I wouldn't recommend this.
chmod 777 -R /home/user1/Develop/
If that doesn't work you may need to manually allow access to the wsgi files in your apache config.
It should look something like this.
WSGIDaemonProcess flask_dbadmin user=wwwrun group=www threads=5 <VirtualHost *:80> ........ <Directory /home/user1/Develop/ > Order allow,deny Allow from all </Directory> <Files flask_dbadmin.wsgi> Order allow,deny Allow from all </Files> </VirtualHost>
If you tried things mentioned Apache2: 'AH01630: client denied by server configuration' here and it still doesn't work chances are your wsgi script alias path is outside path mentioned in
You need a
<Location> block for every Alias.
So for example,
WSGIScriptAlias / /home/stark/FlaskApp/flaskapp.wsgi
you would need
<Directory /home/stark/FlaskApp> Require all granted </Directory>