So, I have a Python Server Pages script that when ran, saves stuff to a file in /var/www/
. It opens the file with:
open(filename, 'wb')
Which causes this:
IOError: [Errno 13] Permission denied: 'file.txt'
I'm using Apache and have set /var/www/
to chmod 755
. I'm not sure if www-data is trying to write, since when I run this, the output is simply 0
:
<%
import os
req.write(str(os.system('whoami')))
%>
I chown
'd it to www-data
anyway, but it still doesn't work. Can anyone give me any pointers?