Thread: [Cppcms-users] Can't get lighttpd to work with cppcms in Windows 7
Brought to you by:
artyom-beilis
|
From: Vizcayno <viz...@gm...> - 2013-06-22 23:34:50
|
Hello:
I have the next hello.cpp program:
#include <cppcms/application.h>
#include <cppcms/applications_pool.h>
#include <cppcms/service.h>
#include <cppcms/http_response.h>
#include <iostream>
class hello : public cppcms::application {
public:
hello(cppcms::service &srv) :
cppcms::application(srv)
{
}
virtual void main(std::string url);
};
void hello::main(std::string /*url*/)
{
response().out() <<
"<html>\n"
"<body>\n"
" <h1>Hello World</h1>\n"
"</body>\n"
"<script language=\"javascript\">\n"
"<!--\n"
"today = new Date();\n"
"document.write(\"<BR>The time now is: \", today.getHours(),
\":\",today.getMinutes(),\":\",today.getSeconds());\n"
"document.write(\"<BR>The date is: \", today.getDate(),\"/\",
today.getMonth()+1,\"/\",today.getFullYear());\n"
"//-->\n"
"</script>\n"
"</html>\n";
}
int main(int argc,char ** argv)
{
try {
cppcms::service srv(argc,argv);
srv.applications_pool().mount(
cppcms::applications_factory<hello>()
);
srv.run();
}
catch(std::exception const &e) {
std::cerr << e.what() << std::endl;
}
}
======================================================================
The configuration file that I called configLH.js contains:
{
"service" : {
"api" : "fastcgi",
"ip": "127.0.0.1" ,
"port" : 80
}
}
======================================================================
The configuration of lighttpd contains:
server.modules = (
"mod_access",
"mod_accesslog",
"mod_fastcgi",
"mod_rewrite",
"mod_status",
)
include "variables.conf"
include "mimetype.conf"
server.document-root = server_root + "/htdocs"
server.upload-dirs = ( temp_dir )
index-file.names =
( "index.php", "index.pl", "index.cgi", "index.cml",
"index.html", "index.htm", "default.htm" )
server.event-handler = "libev"
url.access-deny = ( "~", ".inc" )
$HTTP["url"] =~ "\.pdf$" {
server.range-requests = "disable"
}
static-file.exclude-extensions = ( ".php", ".pl", ".cgi" )
dir-listing.activate = "enable"
debug.log-file-not-found = "enable"
fastcgi.server = (
## The script name of the application
"/hello" => ((
## Command line to run
"bin-path" => "c:/apps/vcApps/cppCms/Release/hello -c
c:/apps/vcApps/cppCms/Release/configLH.js",
"host" => "127.0.0.1",
"port" => 80,
"max-procs" => 1,
"check-local" => "disable"
))
)
=========================================================================
When I invoke the lighttpd from DOS cmd I get the next results:
:lighttpd -D -f lighttpd.conf
2013-06-22 19:24:43: (log.c.166) server started
2013-06-22 19:24:43: (mod_fastcgi.c.1365) --- fastcgi spawning local
proc: c:/apps/vcApps/cppCms/Release/hello -c
c:/apps/vcApps/cppCms/Relea
se/configLH.js
port: 80
socket
max-procs: 1
2013-06-22 19:24:43: (mod_fastcgi.c.1389) --- fastcgi spawning
port: 80
socket
current: 0 / 1
========================================================================
Then I type the next in the IE browser:
http://localhost/hello
while I am waiting for an answer, the next message shows in the dos cmd
(look at the time elapsed):
2013-06-22 19:26:08: (mod_fastcgi.c.3035) got proc: pid: 0 socket:
tcp:127.0.0.1
:80 load: 1
2013-06-22 19:27:09: (mod_fastcgi.c.2543) unexpected end-of-file (perhaps
the fa
stcgi process died): pid: 0 socket: tcp:127.0.0.1:80
2013-06-22 19:27:09: (mod_fastcgi.c.3329) response not received, request
sent: 7
22 on socket: tcp:127.0.0.1:80 for /hello?, closing connection
2013-06-22 19:27:09: (mod_fastcgi.c.1490) released proc: pid: 0 socket:
tcp:127.
0.0.1:80 load: 0
Immediately after, the error HTTP 500 displays on IE browser.
=========================================================================
What do you think is wrong here? Can you suggest me any workaround?
Thanks for your time and attention.
Kind regards.
|
|
From: Artyom B. <art...@ya...> - 2013-06-24 19:24:23
|
It seems that both lighttpd listens on 80 and fastcgi, change, fastcgi port to a different one Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Vizcayno <viz...@gm...> >To: cpp...@li... >Sent: Sunday, June 23, 2013 2:33 AM >Subject: [Cppcms-users] Can't get lighttpd to work with cppcms in Windows 7 > > >Hello: > >I have the next hello.cpp program: > > > >#include <cppcms/application.h> > >#include <cppcms/applications_pool.h> > >#include <cppcms/service.h> > >#include <cppcms/http_response.h> > >#include <iostream> > > > >class hello : public cppcms::application { > >public: > > hello(cppcms::service &srv) : > > cppcms::application(srv) > > { > > } > > virtual void main(std::string url); > >}; > > > >void hello::main(std::string /*url*/) > >{ > > response().out() << > > "<html>\n" > > "<body>\n" > > " <h1>Hello World</h1>\n" > > "</body>\n" > > "<script language=\"javascript\">\n" > > "<!--\n" > > "today = new Date();\n" > > "document.write(\"<BR>The time now is: \", today.getHours(), >\":\",today.getMinutes(),\":\",today.getSeconds());\n" > > "document.write(\"<BR>The date is: \", today.getDate(),\"/\", >today.getMonth()+1,\"/\",today.getFullYear());\n" > > "//-->\n" > > "</script>\n" > > "</html>\n"; > >} > > > >int main(int argc,char ** argv) > >{ > > try { > > cppcms::service srv(argc,argv); > > srv.applications_pool().mount( > > cppcms::applications_factory<hello>() > > ); > > srv.run(); > > } > > catch(std::exception const &e) { > > std::cerr << e.what() << std::endl; > > } > >} > > > >====================================================================== > >The configuration file that I called configLH.js contains: > >{ > > "service" : { > > "api" : "fastcgi", > > "ip": "127.0.0.1" , > > "port" : 80 > > } > >} > > > >====================================================================== > >The configuration of lighttpd contains: > >server.modules = ( > > "mod_access", > > "mod_accesslog", > > "mod_fastcgi", > > "mod_rewrite", > > "mod_status", > > ) > >include "variables.conf" > >include "mimetype.conf" > >server.document-root = server_root + "/htdocs" > >server.upload-dirs = ( temp_dir ) > >index-file.names = >( "index.php", "index.pl", "index.cgi", "index.cml", > > "index.html", "index.htm", "default.htm" ) > >server.event-handler = "libev" > > > >url.access-deny = ( "~", ".inc" ) > > > >$HTTP["url"] =~ "\.pdf$" { > > server.range-requests = "disable" > >} > > > >static-file.exclude-extensions = ( ".php", ".pl", ".cgi" ) > > > >dir-listing.activate = "enable" > > > >debug.log-file-not-found = "enable" > > > >fastcgi.server = ( > > ## The script name of the application > > "/hello" => (( > > ## Command line to run > > "bin-path" => "c:/apps/vcApps/cppCms/Release/hello -c >c:/apps/vcApps/cppCms/Release/configLH.js", > > "host" => "127.0.0.1", > > "port" => 80, > > "max-procs" => 1, > > "check-local" => "disable" > > )) > >) > > > >========================================================================= > >When I invoke the lighttpd from DOS cmd I get the next results: > >:lighttpd -D -f lighttpd.conf > >2013-06-22 19:24:43: (log.c.166) server started > >2013-06-22 19:24:43: (mod_fastcgi.c.1365) --- fastcgi spawning local > > proc: c:/apps/vcApps/cppCms/Release/hello -c >c:/apps/vcApps/cppCms/Relea > >se/configLH.js > > port: 80 > > socket > > max-procs: 1 > >2013-06-22 19:24:43: (mod_fastcgi.c.1389) --- fastcgi spawning > > port: 80 > > socket > > current: 0 / 1 > > > >======================================================================== > >Then I type the next in the IE browser: > >http://localhost/hello > > > >while I am waiting for an answer, the next message shows in the dos cmd >(look at the time elapsed): > >2013-06-22 19:26:08: (mod_fastcgi.c.3035) got proc: pid: 0 socket: >tcp:127.0.0.1 > >:80 load: 1 > >2013-06-22 19:27:09: (mod_fastcgi.c.2543) unexpected end-of-file (perhaps >the fa > >stcgi process died): pid: 0 socket: tcp:127.0.0.1:80 > >2013-06-22 19:27:09: (mod_fastcgi.c.3329) response not received, request >sent: 7 > >22 on socket: tcp:127.0.0.1:80 for /hello?, closing connection > >2013-06-22 19:27:09: (mod_fastcgi.c.1490) released proc: pid: 0 socket: >tcp:127. > >0.0.1:80 load: 0 > > > >Immediately after, the error HTTP 500 displays on IE browser. > > > >========================================================================= > > > >What do you think is wrong here? Can you suggest me any workaround? > > > >Thanks for your time and attention. > > > >Kind regards. > > > > > > > > > > > > > > > > > > >------------------------------------------------------------------------------ >This SF.net email is sponsored by Windows: > >Build for Windows Store. > >http://p.sf.net/sfu/windows-dev2dev >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: Vizcayno <viz...@gm...> - 2013-06-25 18:30:55
|
Artyom Beilis <artyomtnk@...> writes:
>
>
> It seems that both lighttpd listens on 80 and fastcgi, change, fastcgi
port to a different one
>
>
Artyom, thanks for your attention. I followed your indications but I have a
new problem. It seems not to be related with cppCms, but according to your
experience, I ask for your help or tips again.
Initially I kept default port 80 to lighttpd (it worked) and 8080 to
fastcgi, I also put 8080 to configLH.js for the hello.exe program.
When running:
:lighttpd -D -f lighttpd.conf I get next message but the machine did not
crash:
2013-06-25 14:07:07: (log.c.166) server started
2013-06-25 14:07:07: (mod_fastcgi.c.1365) --- fastcgi spawning local
proc: c:/apps/vcApps/cppCms/Release/hello -c
c:/apps/vcApps/cppCms/Relea
se/configLH.js
port: 8080
socket
max-procs: 1
2013-06-25 14:07:07: (mod_fastcgi.c.1389) --- fastcgi spawning
port: 8080
socket
current: 0 / 1
system: an attempt was made to access a socket in a way forbidden by its
access permissions
It seems that the error is originated in the hello exe program when I
invoke from:
... "bin-path" => "c:/apps/vcApps/cppCms/Release/hello -c
c:/apps/vcApps/cppCms/Release/configLH.js", ...
I did another test:
I changed the port of lighttpd with server.port = 8080 (it works, too) and
kept the fastcgi port to 80. I kept the same port 80 for the file
configLH.js also. The results are the same for fastcgi.
I am using windows 7, 64 bits with last versión of lighttp for windows
(LightTPD for Windows - With OpenSSL) version 1.4.32-1 (IPv6). The machine
is in corporate network. I would suspect of restrictions in the firewall
but the administrator indicated me that the lighttpd should work. I also
installed the new and last version of cppCms without problems (thanks for
that!!).
Regards
Vizcayno.
|
|
From: Artyom B. <art...@ya...> - 2013-06-26 06:58:55
|
First of all I'd suggest to set both lighttpd and cppcms ports above 1024 (that do not require admin permissions) i.e. lighttpd 8080, fastcgi 8081 and see if there is a progress. Also take a look on AV or firewall logs windows tend to block networking programs unless you permit them to listen explicitly. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Vizcayno <viz...@gm...> >To: cpp...@li... >Sent: Tuesday, June 25, 2013 9:30 PM >Subject: Re: [Cppcms-users] Can't get lighttpd to work with cppcms in Windows 7 > > >Artyom Beilis <artyomtnk@...> writes: > >> >> >> It seems that both lighttpd listens on 80 and fastcgi, change, fastcgi >port to a different one >> >> > >Artyom, thanks for your attention. I followed your indications but I have a >new problem. It seems not to be related with cppCms, but according to your >experience, I ask for your help or tips again. > >Initially I kept default port 80 to lighttpd (it worked) and 8080 to >fastcgi, I also put 8080 to configLH.js for the hello.exe program. > >When running: >:lighttpd -D -f lighttpd.conf I get next message but the machine did not >crash: > >2013-06-25 14:07:07: (log.c.166) server started >2013-06-25 14:07:07: (mod_fastcgi.c.1365) --- fastcgi spawning local > proc: c:/apps/vcApps/cppCms/Release/hello -c >c:/apps/vcApps/cppCms/Relea >se/configLH.js > port: 8080 > socket > max-procs: 1 >2013-06-25 14:07:07: (mod_fastcgi.c.1389) --- fastcgi spawning > port: 8080 > socket > current: 0 / 1 >system: an attempt was made to access a socket in a way forbidden by its >access permissions > >It seems that the error is originated in the hello exe program when I >invoke from: >... "bin-path" => "c:/apps/vcApps/cppCms/Release/hello -c >c:/apps/vcApps/cppCms/Release/configLH.js", ... > >I did another test: >I changed the port of lighttpd with server.port = 8080 (it works, too) and >kept the fastcgi port to 80. I kept the same port 80 for the file >configLH.js also. The results are the same for fastcgi. > >I am using windows 7, 64 bits with last versión of lighttp for windows >(LightTPD for Windows - With OpenSSL) version 1.4.32-1 (IPv6). The machine >is in corporate network. I would suspect of restrictions in the firewall >but the administrator indicated me that the lighttpd should work. I also >installed the new and last version of cppCms without problems (thanks for >that!!). > >Regards > >Vizcayno. > > > > > > > > >------------------------------------------------------------------------------ >This SF.net email is sponsored by Windows: > >Build for Windows Store. > >http://p.sf.net/sfu/windows-dev2dev >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |