简体   繁体   中英

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

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 :

在此处输入图片说明

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:

在此处输入图片说明

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

在此处输入图片说明

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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