Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to publish web service on a website

I know how to create a web service in C++ Builder/Delphi. But, I don't know how to publish it on my web site. I'm using a web hosting service, not my own personal web server. For example,

enter image description here

I usually use the first option "Stand-alone VCL application". Can this one be published on the web site? What are the differences between those types anyway?

like image 630
Tracer Avatar asked Jan 11 '23 17:01

Tracer


1 Answers

Standalone VCL and console applications are mainly for debugging purposes. You use them when you develop your service because this way it is much faster. You can debug your code and use the WebApp debugger that comes with delphi.

If you want to deploy in production use either ISAPI or CGI. ISAPI is a dll that gets loaded by Apache or IIS (most common but there are other web servers that support it). Usually it was faster then CGI because it loaded once and ran inside the host process, the web server itself, but because it is a DLL that meant that if crashed, it could bring down the whole web server.

CGI on the other hand is a standalone executable. It was used a lot on linux where forking a process is cheap and fast. Every request used its own instance of CGI executable. But since then, projects like fast CGI and others made this a lot faster and more appealing. This also goes for ISAPI. Since then, there are ways to isolate ISAPIs into its own sandboxed processes.

As for hosting. Both are 32 or 64 bit Windows processes. So you need a Windows platform to run them. Mostly that will be Apache or IIS. This is not the best option for hosting because hosting is mostly done on Linux. This is the reason why PHP is still so popular. It runs on Linux and 99% hosting environments support it. So if your hosting is not Windows based and does not support CGI or ISAPI then you are out of luck.

like image 73
Runner Avatar answered Jan 16 '23 02:01

Runner