{"id":13972,"date":"2014-05-30T22:34:01","date_gmt":"2014-05-30T17:04:01","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=13972"},"modified":"2016-12-22T13:46:33","modified_gmt":"2016-12-22T08:16:33","slug":"deploy-asp-net-application-on-amazon-ec2","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/deploy-asp-net-application-on-amazon-ec2\/","title":{"rendered":"Deploy ASP.NET application on Amazon EC2"},"content":{"rendered":"<h5>This article is a step by step guide to deploy an ASP.NET MVC application by using Web Deploy on IIS server, running on \u00a0Amazon EC2 Windows server.<\/h5>\n<p><\/p>\n<h3 style=\"text-align: justify;color:#ff9900\"><u>Step 1: Launch Instance<\/p>\n<p><\/u><\/h3>\n<p>Once you have logged in to\u00a0AWS\u00a0console, Go to EC2 -&gt; Instances,\u00a0then launch instances and select\u00a0Microsoft Windows Server 2012 Base\u00a0and follow the steps.<br \/>\n<br \/>\n<a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/05\/asp_net1.png\"><br \/><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-13973\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/05\/asp_net1.png\" alt=\"asp_net1\" width=\"1026\" height=\"97\" \/><\/a><\/p>\n<p>Before Launching Instances, AWS console prompts you to create a key pair file (.pem file). Once you created the .pem\u00a0file, download the file to your local machine as this\u00a0file will be used to obtain passwords for Windows Machine.<br \/>\n<br \/>\nOnce the instance is in running state, click\u00a0<em><em>Connect<\/em>\u00a0(It takes around 5-10 min to retrieve the password). It prompts you to upload the .pem\u00a0file\u00a0that you have created above. Once you have uploaded the file it will decrypt the file and delivers you a\u00a0random Password\u00a0\u00a0which will be used to connect to Instances using RDP (Remote Desktop Client).<\/p>\n<p>Note: Make sure to open\u00a0<strong>Port 3389<\/strong>\u00a0for RDP connections in the security group.<\/p>\n<h3 style=\"text-align: justify;color:#ff9900\"><u>Step 2: Connect to Instances using RDP<\/p>\n<p><\/u><\/h3>\n<p>You can use Remmina RDP in Ubuntu to connect to Windows Instance with <i><em>Username: Administrator and Password: <\/em><\/i>(that console delivers after decryption process)<\/p>\n<p><a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/05\/asp_net2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-13977\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/05\/asp_net2.png\" alt=\"asp_net2\" width=\"524\" height=\"127\" \/><\/a><\/p>\n<h3 style=\"color: #000000;text-align: justify;color:#ff9900\"><u>Step 3: Install Web Platform on Windows Server Instance<\/u><\/p>\n<\/h3>\n<p><i>Web Platform Installer<\/i> is a free tool used to automate the installation of\u00a0the Microsoft Web Platform (<\/span>e.g IIS\/Visual Studio) and some third party softwares like WordPress\/Drupal\/Joomla<\/p>\n<p>Once this is installed, Open Web Platform and search web deploy<\/p>\n<h3 style=\"color: #000000;text-align: justify;color:#ff9900\"><u>Step 4: Install web deploy for Hosting Servers<\/u><\/p>\n<\/h3>\n<p><a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/05\/asp_net5.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-13979\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/05\/asp_net5.png\" alt=\"asp_net5\" width=\"891\" height=\"287\" \/><\/a><\/p>\n<h3 style=\"text-align: justify;color:#ff9900\"><u>Step 5: Set up IIS Server with \u00a0.NET FRAMEWORK features<br \/>\n<\/u><\/p>\n<\/h3>\n<p><i><em>Press Window + Q, Open Server Manager<\/em><\/i>, it will look like this<\/p>\n<p><a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/05\/server_manager.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-13980\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/05\/server_manager.png\" alt=\"server_manager\" width=\"771\" height=\"429\" \/><\/a><\/p>\n<p>Click on Add Roles and Enable following features:<\/p>\n<p><i><em>Web Server (IIS)\u00a0+\u00a0\u00a0Application Development\u00a0<\/em><\/i>and all features listed in below figure.<\/p>\n<p><a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/05\/server_role.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-13986\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/05\/server_role.png\" alt=\"server_role\" width=\"793\" height=\"560\" \/><\/a><\/p>\n<h3 style=\"text-align: justify;color:#ff9900\"><u>Step 6: Add\u00a0website to IIS<\/u><\/p>\n<\/h3>\n<ol>\n<li><strong>-&gt;<\/strong>Create a directory\u00a0c:\\inetpub\\wwwroot\\deploy<\/li>\n<li><strong>-&gt;<\/strong>Start IIS and add a website.<\/li>\n<\/ol>\n<p>Make sure to choose Application pool same as your application .NET version.<\/p>\n<p><a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/05\/website.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-13987\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/05\/website.png\" alt=\"website\" width=\"587\" height=\"236\" \/><\/a><\/p>\n<h3 style=\"text-align: justify;color:#ff9900\"><u>Step 7: Publish Website from Visual Studio<\/u><\/p>\n<\/h3>\n<p>On your local machine, open up Visual Studio.<\/p>\n<p>Create a new <em>ASP.NET web application<\/em> (.NET framework 4.0) with name &#8220;deploy&#8221;.<br \/>\nOnce the application is set up, click on\u00a0Build on the navigation bar and select\u00a0<i><em>Publish deploy<\/em><\/i>.<\/p>\n<p>You will get the following dialogue box.<\/p>\n<p><a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/05\/image.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-13988\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/05\/image.png\" alt=\"image\" width=\"469\" height=\"634\" \/><\/a><\/p>\n<p>Add the credentials and hit the Publish button. If everything goes well you will get your application page.<\/h5>\n<p><a href=\"\/blog\/wp-ttn-blog\/uploads\/2014\/05\/home.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-13989\" src=\"\/blog\/wp-ttn-blog\/uploads\/2014\/05\/home.png\" alt=\"home\" width=\"1135\" height=\"266\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article is a step by step guide to deploy an ASP.NET MVC application by using Web Deploy on IIS server, running on \u00a0Amazon EC2 Windows server. Step 1: Launch Instance Once you have logged in to\u00a0AWS\u00a0console, Go to EC2 -&gt; Instances,\u00a0then launch instances and select\u00a0Microsoft Windows Server 2012 Base\u00a0and follow the steps. Before Launching [&hellip;]<\/p>\n","protected":false},"author":100,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":62},"categories":[1174],"tags":[572,1440,1441],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/13972"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/100"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=13972"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/13972\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=13972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=13972"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=13972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}