Orchard 1.8获取404未找到错误 - 通过Web Matrix部署

时间:2014-05-13 07:11:48

标签: orchardcms webmatrix permission-denied file-not-found

我创建了一个Orchard网站(版本1.8)

它是通过WebMatrix创建的。

本地一切都运行得很好。

当我将其上传到我的服务器(Web部署也通过WebMatrix)时,我收到以下错误消息:

Server Error in '/' Application.

The resource cannot be found.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. 

Requested URL: /

果园错误日志:

2014-05-13 08:22:07,827 [23] Orchard.Environment.DefaultOrchardHost - (null) - A tenant could not be started: Default
NHibernate.HibernateException: Could not create the driver from Orchard.Data.Providers.SqlCeDataServicesProvider+OrchardSqlServerCeDriver, Orchard.Framework, Version=1.8.0.0, Culture=neutral, PublicKeyToken=null. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
   at System.Data.SqlServerCe.UnmanagedLibraryHelper..ctor(String fileName)
   at System.Data.SqlServerCe.NativeMethodsHelper..ctor(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadValidLibrary(String modulePath)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinariesFromPrivateFolder(String privateInstall)
   at System.Data.SqlServerCe.NativeMethods.LoadNativeBinaries()
   at System.Data.SqlServerCe.SqlCeCommand..ctor()
   --- End of inner exception stack trace ---
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at NHibernate.Bytecode.ActivatorObjectsFactory.CreateInstance(Type type) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Bytecode\ActivatorObjectsFactory.cs:line 9
   at NHibernate.Driver.ReflectionDriveConnectionCommandProvider.CreateCommand() in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Driver\ReflectionDriveConnectionCommandProvider.cs:line 35
   at NHibernate.Driver.ReflectionBasedDriver.CreateCommand() in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Driver\ReflectionBasedDriver.cs:line 65
   at NHibernate.Driver.SqlServerCeDriver.Configure(IDictionary`2 settings) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Driver\SqlServerCeDriver.cs:line 35
   at Orchard.Data.Providers.SqlCeDataServicesProvider.OrchardSqlServerCeDriver.Configure(IDictionary`2 settings) in c:\Orchard\src\Orchard\Data\Providers\SqlCeDataServicesProvider.cs:line 78
   at NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary`2 settings) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Connection\ConnectionProvider.cs:line 109
   --- End of inner exception stack trace ---
   at NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary`2 settings) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Connection\ConnectionProvider.cs:line 113
   at NHibernate.Connection.ConnectionProvider.Configure(IDictionary`2 settings) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Connection\ConnectionProvider.cs:line 64
   at NHibernate.Connection.ConnectionProviderFactory.NewConnectionProvider(IDictionary`2 settings) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Connection\ConnectionProviderFactory.cs:line 50
   at NHibernate.Cfg.SettingsFactory.BuildSettings(IDictionary`2 properties) in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Cfg\SettingsFactory.cs:line 83
   at NHibernate.Cfg.Configuration.BuildSettings() in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Cfg\Configuration.cs:line 1733
   at NHibernate.Cfg.Configuration.BuildSessionFactory() in c:\Users\sebros\Documents\My Projects\nhibernate-core\src\NHibernate\Cfg\Configuration.cs:line 1264
   at Orchard.Data.SessionFactoryHolder.BuildSessionFactory() in c:\Orchard\src\Orchard\Data\SessionFactoryHolder.cs:line 90
   at Orchard.Data.SessionFactoryHolder.GetSessionFactory() in c:\Orchard\src\Orchard\Data\SessionFactoryHolder.cs:line 68
   at Orchard.Data.SessionLocator.EnsureSession() in c:\Orchard\src\Orchard\Data\SessionLocator.cs:line 117
   at Orchard.Data.SessionLocator.Demand() in c:\Orchard\src\Orchard\Data\SessionLocator.cs:line 42
   at Orchard.Data.SessionLocator.For(Type entityType) in c:\Orchard\src\Orchard\Data\SessionLocator.cs:line 36
   at Orchard.Data.Repository`1.get_Session() in c:\Orchard\src\Orchard\Data\Repository.cs:line 26
   at Orchard.Data.Repository`1.get_Table() in c:\Orchard\src\Orchard\Data\Repository.cs:line 30
   at Orchard.Data.Repository`1.Fetch(Expression`1 predicate) in c:\Orchard\src\Orchard\Data\Repository.cs:line 126
   at Orchard.Data.Repository`1.Get(Expression`1 predicate) in c:\Orchard\src\Orchard\Data\Repository.cs:line 91
   at Orchard.Data.Repository`1.Orchard.Data.IRepository<T>.Get(Expression`1 predicate) in c:\Orchard\src\Orchard\Data\Repository.cs:line 60
   at Orchard.Core.Settings.Descriptor.ShellDescriptorManager.GetDescriptorRecord() in c:\Orchard\src\Orchard.Web\Core\Settings\Descriptor\ShellDescriptorManager.cs:line 57
   at Orchard.Core.Settings.Descriptor.ShellDescriptorManager.GetShellDescriptor() in c:\Orchard\src\Orchard.Web\Core\Settings\Descriptor\ShellDescriptorManager.cs:line 30
   at Orchard.Environment.ShellBuilders.ShellContextFactory.CreateShellContext(ShellSettings settings) in c:\Orchard\src\Orchard\Environment\ShellBuilders\ShellContextFactory.cs:line 66
at Orchard.Environment.DefaultOrchardHost.CreateShellContext(ShellSettings

我google了一下,大多数帖子建议

Check Read/Write Permissions on Default .NET AppPool user for the folders "App_Data, Modules, Media, Themes".

我检查了权限并以这种方式设置它们。 尽管如此,仍然会得到同样的错误。

有什么建议吗?帮助将受到高度赞赏。

编辑: 自己解决了,看到秒发表......

4 个答案:

答案 0 :(得分:3)

另一种可能的解决方案是验证数据库连接。在我的情况下,我尝试了上述解决方案,它仍然返回相同的404错误消息。在Orchard / App_Data / logs中,它显示了一个与数据库更相关的错误,与OP错误消息中的“无法从Orchard.Data.Providers.SqlCeDataServicesProvider + OrchardSqlServerCeDriver创建驱动程序”相同。

我意识到我没有在AWS主机上的RDS实例上设置安全组权限,以正确地允许Web服务器EC2实例访问数据库。一旦我添加了适当的EC2实例(安全组,EC2实例实际上是其中一部分,而不仅仅是机器),我能够访问该站点而不会有进一步的问题。

文件夹权限也很重要,但是如果您尝试了但仍然没有运气,请验证您的数据库权限是否正确!

答案 1 :(得分:2)

之前我已经遇到过这个问题,并为我解决了这个问题:

  • 右键单击AppData并选择属性
  • 选择“安全”选项卡,单击“编辑”,然后单击“添加新用户名”
  • 添加&#34; IIS AppPool \ InsertAppPoolNameHere&#34;

答案 2 :(得分:2)

自己解决了。

似乎我必须为Orchard Root中的每个文件夹(甚至Core,Config,bin等等)添加完整权限,而不仅仅是提到的4个。

如果你用google搜索自己并且偶然发现了这个尝试。

我目前正在逐步删除部分权限,以检查其工作时长,以及最低要求是什么。

但是谢谢哈扎的帮助,非常感谢。

答案 3 :(得分:-1)

  • 转到 src-&gt; Orchard.Web 文件夹并右键单击属性 选择安全选项卡。

  • 点击修改 - &gt;添加 - &gt;来自弹出的&#34;选择用户或的高级 组&#34;窗口。

  • 然后点击立即查找以搜索可用用户及之后 生成的用户列表添加&#34; IIS_IUSRS&#34; 然后确定。

  • 授予 IIS_IUSRS 权限以进行修改。

  • 完成。