0

I have python scripts on my Pi ZeroWs that do things like temp readings, etc. that create html files with the data. I loaded apache to view the data on each box. When I execute the scripts manually everything is fine since sudo has perms. I created services to run the scripts at regular intervals enabled them so they run after reboots.

The problem is permissions, I get: " python3[2109]: PermissionError: [Errno 13] Permission denied: '/var/www/html/xxx.html'

I don't want to 777 the apache directory but am not sure what perms my services need to have my python code be able to write to the html directory.

Any ideas?

1
  • 1
    Change the ownership or group of your script so that the user the webserver (www-data) is running as has permissions (no need for 777 permissions). Mar 13 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.