我尝试使用 Hanselman https://www.hanselman.com/blog/RunningASPNETCoreOnGoDaddysCheapestSharedLinuxHostingDontTryThisAtHome.aspx 编写的步骤来安装它。 .
但我最终遇到的错误比他在这篇文章中描述的要多得多。这些是我遵循的步骤:
- 使用 Visual Studio 创建 MyApp 示例应用程序。看图片: App Created
使用 Visual Studio 编译项目。然后这个命令,发布文件:
dotnet publish -r rhel.6-x64
将发布的文件夹中的文件上传到我的Linux共享主机站点,如图:Files Uploaded
From: C:\MyApp\bin\Debug\netcoreapp2.1\rhel.6-x64\publish
到 Linux 共享托管站点 public_http 文件夹,当然使用 WinSCP。然后进入我的共享 Linux Cpanel 并启用我的 SSH 连接
- 使用我的用户名和密码 SSH 打开 Putty 登录 Linux 共享托管服务器。
- 向文件 MyApp 授予所有权限,使其可执行,如 Hanselman 的帖子中所述。
- 当我执行它时,使用 Hanselman 帖子中提到的指令。
首先它提示库:libstdc++6-8.2.1-alt5.x86_64。 https://altlinux.pkgs.org/sisyphus/classic-x86_64/libstdc++6-8.2.1-alt5.x86_64.rpm.html 我使用 wget 下载并放入文件夹 netcoredeps 中。很好。
其次,它提示 lib64/libc.so.6 版本 glibc_2.18。我找到这个:glibc-core-2.27-alt8.x86_64。在https://altlinux.pkgs.org/sisyphus/classic-x86_64/glibc-core-2.27-alt8.x86_64.rpm.html 。我使用 wget 下载并放入文件夹 netcoredeps 中。很好。
- 然后尝试使用 ./MyApp 再次运行应用程序并获取:
/ relocation error: /home2/xxxx/public_html/netcoredeps/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
这个 netcoredeps 文件夹最终如下所示:
最佳答案
一种可能的解决方案是,如果 LD_LIBRARY_PATH 或 MIC_LD_LIBRARY_PATH 中有/lib,则将其删除。
关于c# - 如何在 hostgator Linux 共享主机上安装 ASP.NET Core 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54874898/