繁体   English   中英

ASP.NET 核心应用程序未在 AWS 中运行 Linux EC2 实例而不是显示 Apache 测试页

[英]ASP.NET Core Application not Running in AWS Linux EC2 instance instead showing Apache Test Page

我有一个 AWS CodePipeline 进程获取 CodeCommit 存储库构建应用程序并将应用程序发布到 Linux EC2 实例。 整个过程成功执行,我可以看到最终的 asp.net 核心应用程序已发布到 /var/www/html/ 文件夹。 但是当我加载负载均衡器的 URL(EC2 实例在负载均衡器后面)时,我看到 Apache 测试页,而不是 asp.net 核心应用程序。

我创建的 asp.net 核心应用程序只是默认创建的默认 asp.net 核心 web 应用程序。

下面是 buildspec.yaml 文件。 (这发布了一个独立的应用程序)

 version: 0.2 env: variables: DO.NET_CORE_RUNTIME: 6.0 phases: install: on-failure: ABORT runtime-versions: do.net: ${DO.NET_CORE_RUNTIME} commands: - echo install stage - started `date` pre_build: commands: - echo pre build stage - stared `date` - echo restore dependencies started `date` - do.net restore./WebApplication1/WebApplication1.csproj build: commands: - echo build stage - started `date` - do.net publish --configuration Release --runtime linux-x64./WebApplication1/WebApplication1.csproj --self-contained - cp./WebApplication1/appspec.yml./WebApplication1/bin/Release.net6.0/linux-x64/publish/ artifacts: files: - '**/*' - appspec.yml name: artifact-test-cham discard-paths: no base-directory: ./WebApplication1/bin/Release.net6.0/linux-x64/publish/

下面是 appspec.yaml 文件,它将内容从 S3 工件位置复制到 /var/www/html/ 文件夹

 version: 0.0 os: linux files: - source: / destination: /var/www/html/

下图显示 web 应用程序与其他 asp.net 核心框架相关文件成功发布到 Linux EC2 实例中的 /var/www/html 文件夹。 但即使所有 web 应用程序文件以及其他框架文件都可用,正如我所说,当我浏览负载均衡器时,我只能看到 Apache 测试页面。

在此处输入图像描述

我已经找到了这个问题的答案,在 AWS Linux EC2 实例中发布一个 ASP.NET Core web 应用程序,答案发布在以下 URL,在 Amazon RePost 站点中。 请使用以下链接查看答案

https://repost.aws/questions/QUvNwkb4joTZylmomnQjjJaw/asp.net-core-application-not-running-in-aws-linux-ec-2-instance-instead-showing-apache-test-page

您可以在该网站或此处发布与解决方案相关的任何问题,我将尽力回答问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM