Publishing an asp.net core web application on linux ec2 instance
I have followed the steps mentioned in the following article published by Microsoft.
I am bit new to asp.net core and publishing web apps in Linux environments.
Even though I followed the above article, once I finished everything and when I started the web app using "sudo systemctl start kestrel-helloapp.service" and check the status of the app status using the "sudo systemctl status kestrel-helloapp.service" command I receive error code 203.
I have published my through AWS CodePipeline, to /var/www/html folder. And I can see all the files are published successfully to that folder.
I'm not sure what I am doing wrong in here because when I navigate to the load balancers dns name, I only see the Apache test page, not the web application home page.
Hi @ChamPer ,
If you can run the application successful in local. The 203 error doesn't relate the Asp.net core code. Perhaps there have some required configuration when deploy the application.
Since you are using AWS Linux EC2, you'd better to search how to publish the asp.net core application on AWS Linux EC2, and you can contact AWS Linux EC2 forum to ask for help.
@Zhi Lv - MSFT : Thanks for your response. I have figured out the issue in my case. The issue was I have given an incorrect path for "dotnet" in ExecStart command. I have tested the steps in the following URL, on an AWS Linux EC2 instance, and I can confirm that my test asp.net core application is working fine.
I have setup through a pipeline. To get the application code, build it and publish it to the EC2 instances. I now have to figure it out on how to give those commands, so that all the steps are automated.
I will post my answer here, so that others could benefit from it as well.
@Zhi Lv - MSFT : To make it work, I had to remove the "ServerName" and "ServerAlias" attributes in the .conf file (helloapp.conf). Since I did this as a test I do not have a proper URL to test. In production, those two attributes are used to hold the value of the web application URL that I am publishing to the EC2 instances. Am I right? Please let me know.
Sign in to comment