如何将本地 DotNetNuke 站点部署到我的主机?
好吧,这似乎是一个基本问题。也许是的。但我一生都不知道答案。我正在寻找简单的答案。
我尝试了以下两项操作:
1)我有一个在本地创建的网站。当我部署到我的主机(站点文件的 XCopy + .bak SQL Server 备份文件的恢复)时,我收到与在本地 HD 上查找文件的数据库中的记录相关的各种错误。 IE:数据库中有完全限定的路径名与相对路径名。 EX: C:\FolderName\FileName.ext
2) 我在主机上建立了一个全新的数据库和新的站点文件,以便创建全新的站点,但 SQL 脚本无法运行。即使在 web.config 中正确设置了连接字符串,似乎也是权限问题。
另外,我还没有从 Visual Studio 中启动任何东西。目前只需从门户界面执行所有操作。
哦,我首先在这里问是因为 StackOverflow 上的你们都是可靠的。 DNN 监控论坛的人员则不然。
Ok, so this may seem an elementary question. Maybe it is. But for the life of me I don't know the answer. I'm looking for the simple answer(s).
I've attempted both of the following:
1) I have a site I've created locally. When I deploy to my host (XCopy of site files + restore of a .bak SQL Server backup file), I get all kinds of errors pertaining to records in the database that are looking for files on my local HD. IE: There are fully qualified path names in the database vs. relative. EX: C:\FolderName\FileName.ext
2) I've stood up a brand new database and new site files out on my host as well in order to create the site fresh, but the SQL Scripts won't run. Appears to be a permissions issue even though the connection strings are set properly in the web.config.
Also, I've not fired up anything from Visual Studio yet. Just doing everything from the portal interface at the moment.
Oh, and I'm asking here first because you all on StackOverflow are reliable. The folks at DNN that monitor the forums are not.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
1)您应该能够将文件系统和数据库复制到另一台服务器并运行而不会出现问题。如果您正在进行自定义开发,则必须确保在 URL 中使用相对路径或考虑当前门户别名(PortalModuleBase 基类具有可获取当前别名的属性 PortalAlias.HTTPAlias)。如果您有“硬编码链接”,您的网站将无法正常工作。
如果您可以提供有关您所看到的错误的更多详细信息,我将使用我所掌握的更多信息来编辑这篇文章。
2) 用户需要具有db_owner角色才能安装。你能证实情况确实如此吗?我经常发现在尝试安装 DNN 之前测试 SQL Server Management Studio 中的登录名、登录名/密码以及角色很有帮助。
1) You should be able to copy the file system and database to another server and run without a problem. If you are doing custom development, you must make sure to use relative paths in your URLs or take into account the current portal alias (The PortalModuleBase base class has a property PortalAlias.HTTPAlias which gets the current alias). If you have "hard-coded links" your site won't work properly.
If you can provide more details about the errors you are seeing I'll edit this post with any more information I have.
2) The user needs to be in the db_owner role for installation. Can you verify that this is the case? I often find it helpful to test the login in SQL Server Management Studio and very the login/password as well as the role before trying to install DNN.
1)本地输入Host->门户网站 -> YourPortal 并添加一个等于您部署的域的 url 的别名。也许,你已经有了 localhost :)
2) 在主机上部署数据库并创建具有 db_owner 权限的用户
3) 在主机上复制 DNN 的文件,并使用新路径、数据库名称、凭据更新 web.config 连接字符串
4) ASP.NET 应对部署门户的文件夹拥有完全权限
5) 尝试一下。
1) Locally enter Host -> Portals -> YourPortal and add one more alias equal to url of domain you deploy at. Maybe, you have localhost there already :)
2) Deploy DB at host and create user with rights db_owner
3) Copy files of your DNN at host and update at web.config connectionString with new paths, DBname, credentials
4) ASP.NET shall have full rights for folder where you portal is deployed
5) try it.
问题出在门户别名表中。所有适用的别名都必须有适当的记录。问题是,当您在自己的本地主机中创建站点时,只有“本地主机”记录。必须为所有 URI 位置创建附加记录。
The issue was in the Portal Alias table. There has to be appropriate records for all applicable aliases. The problem is, when you create the site in your own localhost, there's only a "localhost" record. Additional records have to be created for all URI locations.