This project is read-only.

Missing App_Data/files directory while running with Mono

Topics: ASP.NET 2.0
Aug 31, 2010 at 4:36 PM

I played around and did some research. I wanted to run BlogEngine.NET using Linux, Apache2 and mod_mono module. Everything seems to work fine, but when I wanted to upload some file or image with new entry or page I got error:

Message : Access to the path "/var/www/blog/App_Data/files" is denied

The solution: create App_Data/files and set it's permissions to 777. It solves problems with uploading items.

Hope this would help someone.

Aug 31, 2010 at 5:17 PM

That's certainly a solution to make it work.  I'm working on a "clean install" blog post about setting up BlogEngine.NET under Linux, and permissions is one thing that must be addressed.  However, I don't know that I'd go 777 all the way across.  What I've done is change the group to the group under which the web server runs (usually "www-data"), then adding group write permissions.  This doesn't make a) everything world-writable and b) everything executable.  If you're concerned about the security implications of making that tree world-writable, the following two commands will allow the web server to write to it, while denying world-writability.  (This also prevents changing the files themselves to be executable.)

chgrp -R www-data App_Data
chmod -R g+w App_Data