我使用mod_mono 2.4.2.3和Apache 2来托管Web应用程序。此应用程序尝试在其临时文件夹上生成临时图像,但它给了我这个错误:
System.UnauthorizedAccessException: Access to the path "/opt/franquia/hlrgw/Frontend/tmp/ctl00_ContentPlaceHolder1_ZedGraphWeb1f3c01ca1-bb4f-4b5b-9063-eebf0bb3281b.png" is denied. at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share) [0x00000] at (wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare) at ZedGraph.Web.ZedGraphWeb.Render (System.Web.UI.HtmlTextWriter output) [0x00000]
此文件夹具有“apache”用户/组所有者,配置为运行apache和mod_mono的同一用户。我甚至为调试目的设置了666个权限,但它仍然不起作用。
唯一的问题是该文件夹通过rsync与其他服务器同步(Web应用程序在那里工作正常)。这是使用的行:
*/5 * * * * rsync -vuatpog --delete root@rtclp02:/opt/franquia/hlrgw /opt/franquia/
两台服务器都具有相同的用户,uid和组。我不知道该怎么办:(
答案 0 :(得分:0)
mod-mono-server2,由mod-mono产生,作为 wwwrun (或 apache )用户运行。该文件夹需要对此用户(和/或运行的任何组apache)可写,以使该应用程序正常工作。