I run the flask on mod_wsgi. my jar application, which is located on /var/www/app , receives some file from the user and saves it in the directory /var/www/app/tmp . However, even after all chmod and chown (thought it was a permission problem), I was unable to get to this tmp directory.
After some debugging, I found out that the current working directory of the flash application is / . I can change the working directory to os.chdir('/var/www/') , but I would like to avoid this for security problems.
here is my apache configuration:
<VirtualHost *:80> ServerName mysite.com ServerAlias site.com ServerAdmin admin@localhost WSGIDaemonProcess app user=www-data group=www-data processes=1 WSGIScriptAlias / /var/www/app.wsgi Alias /static /var/www/app/static <Directory /var/www/app> WSGIProcessGroup app WSGIApplicationGroup %{GLOBAL} WSGIScriptReloading On Order deny,allow Allow from all </Directory> <Location "/static"> SetHandler None </Location> </VirtualHost>
How to change the working directory of my application from / to /var/www ?
python apache2 mod-wsgi
thkang
source share