Monday, April 11, 2016

Deployment of the ASP.NET website to Windows Server via FTP

Leave a Comment

I am trying to deploy my test website to the ftp server, yet I am having quite a few difficulties with it (as it is my very first time doing this).

Here is how the ftp's server folder setup looks like:

There is a main folder named www_root, which contains the following two folders app_data and data.

Here is a printscreen from a TotalCommander:

enter image description here

I was being told by the support people, that I need to copy all my data into the www_root folder.

Once I published my ASP.NET 5 MVC application via Visual Studio 2015 to a File System, I could see three folders:

enter image description here

My base index.html, together with css & javascript is located under wwwroot folder. Here is what the inside of wwwroot folder looks like:

enter image description here

When I copy the contents of my wwwroot folder inside www_root folder (under FTP) and I exclude web.config file, then my base webpage is loaded without a problem (but without server side logic...it's just a plain page with some HTML & CSS code).

Now the problem occured when I added web.config to that folder, then suddenly I received Error 500 when I tried to open my website. I believed that the problem was caused by the fact that web.config contained the following setup:

<configuration>   <system.webServer>     <handlers>       <add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />     </handlers>     <httpPlatform processPath="..\approot\web.cmd" arguments="" stdoutLogEnabled="false" stdoutLogFile="..\logs\stdout.log" startupTimeLimit="3600"></httpPlatform>   </system.webServer> </configuration> 

Here I could see that we are targeting \approot\web.cmd file. Therefore what I did was, that I copied my approot & logs folders (generated by Visual Studio) to the base folder under my FTP.

So in the end when I logged in to my FTP I had the following folders: approot, logs, www_root, where inside of www_root I had all my css, js, & index.html.

Nonetheless, when I reloaded my webpage, it still gave me the 403 - Forbidden: Access is denied..

How can I solve this problem? What am I doing wrong?

1 Answers

Answers 1

In the end, the problem was occurred by the fact, that my hosting server had folder named www_root, however my ASP.NET application automatically creates folder wwwrooot.

What I ended up doing is creating a script, which loops through all the files and replaces wwwroot with www_root.

That has solved the problem.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment