If you encounter below error when deploying .NET application for the first time on Ubuntu, you need to give write permission to the running user.

Unhandled exception.
System.UnauthorizedAccessException: Access to the path '/var/www/core-api/core-api.log' is denied.
System.IO.IOException: Permission denied

In previous example we used www-data as running user so we need to give permission to write for this user.

sudo chown -R www-data:www-data /var/www/core-api/core-api.log
sudo chmod -R 770 /var/www/core-api/core-api.log
 
For detailed information you can check this answer.

 

Comments


Comments are closed