Thread: [Cppcms-users] Running CppCMS with IIS
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2011-08-17 13:51:17
|
Hello All, It is not the first time I'm being asked about running CppCMS with IIS... So I had decided to check it deeply. -------------------------------------------------- Bottom line: I was able to run CppCMS application with IIS using SCGI after a small "workaround" that is currently exists in svn trunk of CppCMS. -------------------------------------------------- Before you try to use IIS in front of CppCMS I'd recommend you to chose another web server that is more friendly to web developers who use web server independent API like FastCGI. Best Approach: -------------- Configure CppCMS with some other good web server like Apache or Nginx and forward requests from IIS to it. FastCGI Connectivity ===================== FastCGI - don't use it, it was designed to run PHP and nothing more. IIS's FastCGI implementation is broken and does not support multi-threaded FastCGI applications. http://forums.iis.net/t/1155551.aspx It also does not provide an option to configure specific port making it even impossible to use CppCMS application with IIS. SCGI Connectivity ===================== Using with ISAPI SCGI. --------------------- There is SCGI ISAPI extension that allows to use external SCGI applications isapi_scgi http://woof.magicsplat.com/isapi_scgi/home However it has two big limitations: 1. It does not support real CGI response from the client and expects HTTP response. Currently in SVN trunk it is possible to set an option `service.generate_http_headers` to `true`. This option tells CppCMS to generate HTTP rather then CGI response headers. Using this option it was possible to run successfully CppCMS application with IIS. 2. It supports only predefined set of HTTP headers so if you will need to get custom headers from for example AJAX responses you'll need to alter `isapi_scgi` sources. So you'll need configuration like: { "service" : { "api" : "scgi", "ip" : "127.0.0.1", "port" : 9999, "generate_http_headers" : true } } Troubleshooting ISAPI SCGI extension. -------------------------------------- There are two problems: - Currently the project provides only 32 bit builds of this dll, if you need 64 bit or you'll need to build it manually. - If you need support of custom HTTP headers you'll have to add them in scgi.c. - In order to build it with gcc you need to apply following changes: --- scgi_old.h 2011-08-17 10:48:32.109547500 +0300 +++ scgi.h 2011-08-17 10:50:26.184022000 +0300 @@ -37,3 +37,3 @@ */ -#if defined(_MSC_VER) +#if defined(_MSC_VER) || defined(__GNUC__) # define COPY_MEMORY(d, s, n) memcpy((d), (s), (n)) @@ -48,3 +48,3 @@ ZLINK_CREATE_TYPEDEFS(context_t); -typedef struct context { +struct context { OVERLAPPED ovl; /* Must be first structure */ @@ -81,3 +81,3 @@ buffer_t buf; /* Data buffer */ -} context_t; +}; And the you'll be able to build the DLL as: gcc -O2 -shared buffer.c scgi.c logger.c -lws2_32 -o isapi_scgi.dll Bottom line.... If you don't have to don't use IIS! (as don't use Windows in general) Artyom CppDB - C++ SQL Connectivity: http://cppcms.sf.net/sql/cppdb/ |
From: augustin <aug...@ov...> - 2011-08-18 06:47:12
|
On Wednesday 17 August 2011 09:51:07 pm Artyom Beilis wrote: > If you don't have to don't use IIS! > (as don't use Windows in general) +1 ;) Augustin. -- Friends: http://www.reuniting.info/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |
From: 李明 <lim...@gm...> - 2011-08-19 02:02:16
|
Nice job! On Thu, Aug 18, 2011 at 2:46 PM, augustin <aug...@ov...>wrote: > On Wednesday 17 August 2011 09:51:07 pm Artyom Beilis wrote: > > If you don't have to don't use IIS! > > (as don't use Windows in general) > > > +1 > ;) > > Augustin. > > > > > > -- > Friends: http://www.reuniting.info/ > My projects: > http://astralcity.org/ http://3enjeux.overshoot.tv/ > http://linux.overshoot.tv/ > http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ > http://openteacher.info/ http://minguo.info/ > http://www.wechange.org/ http://searching911.info/ > > > > > > > > > > > > > . > > > ------------------------------------------------------------------------------ > Get a FREE DOWNLOAD! and learn more about uberSVN rich system, > user administration capabilities and model configuration. Take > the hassle out of deploying and managing Subversion and the > tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |