gigi81 / sharpfastcgi

C# fastcgi protocol implementation plus shome usage examples. A good example on how to self-host your web application without the need of iis or mono.
MIT License
32 stars 15 forks source link

No response from server when running FastCgi.Server.exe on Windows #11

Closed icnocop closed 5 years ago

icnocop commented 5 years ago

Hi.

Thank you for sharpfastcgi.

I'm running on Windows 10 64-bit.

I cloned the master branch, set FastCgi.Server as the startup project, started debugging, then browsed to http://localhost:9000/info.aspx, but never received a response from the server.

Console output:

 INFO [1] Starting FastCgi Server
 INFO [1] Configuration Result:
[Success] Name aspnet-fastcgi
[Success] DisplayName Asp.NET FastCgi Service
[Success] Description Asp.NET FastCgi Service
[Success] ServiceName aspnet-fastcgi
 INFO [1] Topshelf v3.3.152.0, .NET Framework v4.0.30319.42000
DEBUG [1] Running as a console application, creating the console host.
DEBUG [1] Starting up as a console application
 INFO [1] Listening on 0.0.0.0:9000
 INFO [1] The aspnet-fastcgi service is now running, press Control+C to exit.
Opened tcp socket. Total: 1

Any ideas?

Thank you.

gigi81 commented 5 years ago

You are not supposed to hit the fastcgi server with the browser. They simply speak two different languages. You need to run a Web server like iiis or nginx that is included in the project. The Web server if configured correctly will connect to the fastcgi to handle your request. See readme and example nginx folder

icnocop commented 5 years ago

Thank you; I was able to get it working! 😄

I had to do the following:

  1. Create the directory .\Examples\windows-nginx-1.6.2\logs
  2. Create the directory .\Examples\windows-nginx-1.6.2\temp
  3. Run .\Examples\windows-nginx-1.6.2\nginx.exe
  4. Consolidate log4net NuGet package in solution. Update log4net in the project FastCgi.Loggers.Log4Net from 2.0.6 to 2.0.8.
  5. Build solution (Debug|Mixed Platforms)
  6. Run FastCgi.Server\bin\Debug\Grillisoft.FastCgi.Server.exe README.md indicates to start FastCgi.Test exe