cppcms-users Mailing List for CppCMS C++ Web Framework (Page 140)
Brought to you by:
artyom-beilis
You can subscribe to this list here.
2009 |
Jan
|
Feb
(22) |
Mar
|
Apr
(3) |
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
(16) |
Dec
(13) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(4) |
Feb
|
Mar
(8) |
Apr
(8) |
May
(8) |
Jun
(36) |
Jul
(63) |
Aug
(126) |
Sep
(47) |
Oct
(66) |
Nov
(46) |
Dec
(42) |
2011 |
Jan
(87) |
Feb
(24) |
Mar
(54) |
Apr
(21) |
May
(22) |
Jun
(18) |
Jul
(22) |
Aug
(101) |
Sep
(57) |
Oct
(33) |
Nov
(34) |
Dec
(66) |
2012 |
Jan
(64) |
Feb
(76) |
Mar
(73) |
Apr
(105) |
May
(93) |
Jun
(83) |
Jul
(84) |
Aug
(88) |
Sep
(57) |
Oct
(59) |
Nov
(35) |
Dec
(49) |
2013 |
Jan
(67) |
Feb
(17) |
Mar
(49) |
Apr
(64) |
May
(87) |
Jun
(64) |
Jul
(93) |
Aug
(23) |
Sep
(15) |
Oct
(16) |
Nov
(62) |
Dec
(73) |
2014 |
Jan
(5) |
Feb
(23) |
Mar
(21) |
Apr
(11) |
May
(1) |
Jun
(19) |
Jul
(27) |
Aug
(16) |
Sep
(5) |
Oct
(37) |
Nov
(12) |
Dec
(9) |
2015 |
Jan
(7) |
Feb
(7) |
Mar
(44) |
Apr
(28) |
May
(5) |
Jun
(12) |
Jul
(8) |
Aug
|
Sep
(39) |
Oct
(34) |
Nov
(30) |
Dec
(34) |
2016 |
Jan
(66) |
Feb
(23) |
Mar
(33) |
Apr
(15) |
May
(11) |
Jun
(15) |
Jul
(26) |
Aug
(4) |
Sep
(1) |
Oct
(30) |
Nov
(10) |
Dec
|
2017 |
Jan
(52) |
Feb
(9) |
Mar
(24) |
Apr
(16) |
May
(9) |
Jun
(12) |
Jul
(33) |
Aug
(8) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
(6) |
2018 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
(14) |
Jun
(1) |
Jul
(9) |
Aug
(1) |
Sep
(13) |
Oct
(8) |
Nov
(2) |
Dec
(2) |
2019 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2020 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(9) |
Jul
(6) |
Aug
(25) |
Sep
(10) |
Oct
(10) |
Nov
(6) |
Dec
|
2021 |
Jan
|
Feb
|
Mar
(7) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(9) |
Oct
(1) |
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Artyom <art...@ya...> - 2009-12-05 21:17:45
|
> But I have another strange error when using lighttpd: > 2009-12-04 16:52:34: (mod_fastcgi.c.2900) backend is > overloaded; > ... > When I benchmarked it with ab (from apache-utils) I see > that 2, 3 > connections at once work without any problems, but when I > change > concurrency to about 5 it fails: > Failed requests: 2 > (Connect: 0, Receive: 0, Length: 2, > Exceptions: 0) > > Its always 2 failed requests, the other "succeed" with 500 > - Internal Server > Error. > Other: > > server.port = 8080 > server.bind = "markusbyte" > Ok, first of all what "server.*" configuration are you using What Server API do you use, what model threaded or prefork? How many threads processed do you define? What buffer parameter do you use? I would recommend: Make "server.buffer" parameter big as twice as exepected cuncurrent requests no. Also provide reasonable number for "server.threads" or "server.procs" according to the mode you use. The default workers number is 5 which may explain the issue. See: http://cppcms.sourceforge.net/wikipp/en/page/ref_config Server API, and Server Mod. You may want something like: server.mod = "thread" # -- multithreaded working model server.threads = 20 # 20 or much more cuncurrent workers # but not too much server.buffer = 1000 # the size of queue of incoming requests What happens that lighttpd creates more connections than the server can handle. Giving big buffer value allows CppCMS service accept new connections and put them to queue, thus preventing of lighttpd report 500 -- overloaded service. Best, Artyom |
From: Markus R. <us...@ma...> - 2009-12-04 16:05:15
|
Artyom wrote: >> But because of another bug I can't use lighttpd (at least the 1.4.*): >> http://redmine.lighttpd.net/issues/show/729 > > Have you tried to use it with URL-rewriting? Url rewriting would solve > this problem for you. Yes, you are right, that works. But I have another strange error when using lighttpd: 2009-12-04 16:52:34: (mod_fastcgi.c.2900) backend is overloaded; we'll disable it for 2 seconds and send the request to another backend instead: reconnects: 0 load: 3 2009-12-04 16:52:34: (mod_fastcgi.c.3542) all handlers for /src/url_to_file/Bilder/Orte/Schweiz2008/Uni Lichthof.jpg on /src/url_to_file are down. 2009-12-04 16:52:37: (mod_fastcgi.c.2673) fcgi-server re-enabled: 0 /tmp/fcgi-hello.socket When I benchmarked it with ab (from apache-utils) I see that 2, 3 connections at once work without any problems, but when I change concurrency to about 5 it fails: Failed requests: 2 (Connect: 0, Receive: 0, Length: 2, Exceptions: 0) Its always 2 failed requests, the other "succeed" with 500 - Internal Server Error. This problem is also easily reproduceable without ab by just opening an image gallery (where the browser opens dotzends of connections to download all thumbnails). The Result is that some images are not displayed. The problem occurs with standard config by cppcms and also the config with url rewriting: ----- rewrite config ------- server.modules = ("mod_fastcgi", "mod_rewrite") server.document-root = "/home/markus/Projekte/Homepage/" server.pid-file = "/home/markus/cppcms/url_to_file/build64/cppcms_rundir/srv.pid" server.port = 8080 server.bind = "markusbyte" url.rewrite = ("^(.*)" => "/src/url_to_file/$0") fastcgi.server = ( "/src/url_to_file" => ( "localhost" => ( "check-local" => "disable", "max-procs" => 1, "idle-timeout" => 20, "socket" => "/tmp/fcgi-hello.socket", "allow-x-send-file" => "enable" ))) ----- rewrite config ------- > However I don't think this is really necessary. > > The real issue is that Apache, Nginx and Lighttpd have different semantics > for X-Send-File... So the CppCMS based software should deal with them > differently, when the script tryes to unify the access to all web servers > -- so it some kind of contradiction. You are correct about that. Might not be as useful to have it in default cppcms_run configs. > I would suggest, for special cases where you do need to tweak web server > configuration, just create a configuration file and run web server > directly like: > > /usr/sbin/lighttpd -D -f ligthy.conf > > That's it. You can keep it persistent and not shut down when you work, > because in any case of new connection it would try to make a new one so > when you shut CppCMS application down, web server would not even notice. > > Only thing that remains is to run ./foobar -c config.txt Thank you, good idea. Markus -- http://www.markus-raab.org | Es genügt nicht, keine Gedanken zu haben. -o) | Man muß auch unfähig sein, sie Kernel 2.6.24-1-a /\ | auszudrücken. -- Karl Kraus on a x86_64 _\_v | |
From: Artyom <art...@ya...> - 2009-12-03 14:00:56
|
Hi, > When CppCMS 1.x.x release? Hopefully alpha version would be available withing several months. There is still a lot of work to do. > Are there examples to use CouchDB with CppCMS ? No... Unless you would write some. ;) Best, Artyom __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Vermus <ver...@gm...> - 2009-12-03 12:52:23
|
Hello! When CppCMS 1.x.x release? Are there examples to use CouchDB with CppCMS ? |
From: Artyom <art...@ya...> - 2009-12-01 15:48:16
|
> But because of another bug I can't use lighttpd (at least the 1.4.*): > http://redmine.lighttpd.net/issues/show/729 Have you tried to use it with URL-rewriting? Url rewriting would solve this problem for you. > Any hints? What happens is that you redirect from /logo.png -> /Homepage/logo.png. So then it looks where "/Homepage/log.." is placed and all starts again. I assume that this would be problematic for you to serve files from "/" and do anything else from "/" as I told before. So, for most generic case I would still recommend to use URL-rewriting. > @Artyom: Do you plan to add sendfile support in the cppcms_run configs? At > least for lighttpd it is very easy. I don't, but it shouldn't be too hard. However I don't think this is really necessary. The real issue is that Apache, Nginx and Lighttpd have different semantics for X-Send-File... So the CppCMS based software should deal with them differently, when the script tryes to unify the access to all web servers -- so it some kind of contradiction. I would suggest, for special cases where you do need to tweak web server configuration, just create a configuration file and run web server directly like: /usr/sbin/lighttpd -D -f ligthy.conf That's it. You can keep it persistent and not shut down when you work, because in any case of new connection it would try to make a new one so when you shut CppCMS application down, web server would not even notice. Only thing that remains is to run ./foobar -c config.txt cppcms_run utility was mostly provided to simplify web server configuration for common case. It can't be replacement for real configuration that should be created for the web server. Artyom |
From: Markus R. <us...@ma...> - 2009-12-01 15:24:56
|
Hi list! I tried to use xsendfile to send files to the user from my cppcms application. I succeeded with lighttpd using: add_header("Content-Disposition: attachment; filename=\"" + my_path.leaf() + '"'); add_header("X-LIGHTTPD-send-file: " + root + "/" + file); only adding the option "allow-x-send-file" => "enable" in config file. (section $API.server) But because of another bug I can't use lighttpd (at least the 1.4.*): http://redmine.lighttpd.net/issues/show/729 So I tried the same with nginx - but without success. Maybe someone here can help me? add_header("X-Accel-Redirect: /Homepage/" + file) leads to this sequence of requests[0], having in log[1]. Ok, does not surprise much, because it is not really a sendfile, but rather a redirection feature (which can be misused to send files). So I added: location /Homepage { root /home/markus/Projekte; internal; } in the configuration inside server section. But this does not change anything[0,1]. Seems like that rule is simply ignored, maybe because of the other locations present in the config file? I directly changed cppcms_run to add that config snippet. Any hints? @Artyom: Do you plan to add sendfile support in the cppcms_run configs? At least for lighttpd it is very easy. thanks Markus Raab [0] X-Accel-Redirect: /Homepage/logo.png X-Accel-Redirect: /Homepage/Homepage/logo.png X-Accel-Redirect: /Homepage/Homepage/Homepage/logo.png X-Accel-Redirect: /Homepage/Homepage/Homepage/Homepage/logo.png ... X-Accel-Redirect: /Homepage/Homepage/Homepage/Homepage/Homepage/Homepage/Homepage/Homepage/Homepage/Homepage/Homepage/logo.png [1] 2009/12/01 16:09:42 [error] 4792#0: *1 rewrite or internal redirection cycle while internal redirect to "/Homepage/Homepage/Homepage/Homepage/Homepage/Homepage/Homepage/Homepage/Homepage/Homepage/Homepage/logo.png" while reading response header from upstream, client: 192.168.0.3, server: localhost, request: "GET /logo.png HTTP/1.1", upstream: "fastcgi://unix:/tmp/fcgi-hello.socket:", host: "markusbyte:8080" -- http://www.markus-raab.org | Das Mittelmaß ist gut dem Alter wie der -o) | Jugend, nur Mittelmäßigkeit allein ist Kernel 2.6.24-1-a /\ | keine Tugend. -- G.E.Lessing, Nathan der on a x86_64 _\_v | Weise |
From: Stanimir M. <sta...@zo...> - 2009-11-24 09:34:47
|
Hello, Thanks for the guide, it helped a lot! Reading more deeply the documentation of lighttpd answered my question too, but after your help it was much easier. Greetings, Stanimir On Sat, Nov 21, 2009 at 6:29 PM, Artyom <art...@ya...> wrote: >> I must add that the problem is not in the configuration but >> in the >> regex in the url.add method. >> If the regex is url.add("(.*)", >> boost::bind<void>(&myapp::index,this,_1)); >> it works. However, when I try to display the binded >> argument it is an >> empty string. > > The basic rule. When server matches url it splits it into > "SCRIPT_NAME" and "PATH_INFO" > > Under lighttpd: > > For script "/foo": > > /foo/bar => "/foo" and "/bar" > /foo/ => "/foo" and "/" > /foo => "/foo" and "" > > For script "my_app.fcgi" it would be > > /some/path/my_app.fcgi/bar => "/some/path/my_app.fcgi" and "/bar" > /my_app.fcgi => "/my_app.fcgi" and "" > > As far as I know for script "/" it does wired things... do not > use it directly. Rather rewrite the URL to something like > /bar => /foo/bar > And use script "/foo" > > url.add ALWAYS matches against PATH_INFO. > > So in order to make url parsing work, make sure you get from the > server the correct path info. > > For simplest debugging: > > url.add("^(.*)$",boost::bind(&myapp::index,this,_1)); > > Make sure you make the server sending correct PATH_INFO > variable. > > Best, > Artyom > > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Artyom <art...@ya...> - 2009-11-21 16:29:51
|
> I must add that the problem is not in the configuration but > in the > regex in the url.add method. > If the regex is url.add("(.*)", > boost::bind<void>(&myapp::index,this,_1)); > it works. However, when I try to display the binded > argument it is an > empty string. The basic rule. When server matches url it splits it into "SCRIPT_NAME" and "PATH_INFO" Under lighttpd: For script "/foo": /foo/bar => "/foo" and "/bar" /foo/ => "/foo" and "/" /foo => "/foo" and "" For script "my_app.fcgi" it would be /some/path/my_app.fcgi/bar => "/some/path/my_app.fcgi" and "/bar" /my_app.fcgi => "/my_app.fcgi" and "" As far as I know for script "/" it does wired things... do not use it directly. Rather rewrite the URL to something like /bar => /foo/bar And use script "/foo" url.add ALWAYS matches against PATH_INFO. So in order to make url parsing work, make sure you get from the server the correct path info. For simplest debugging: url.add("^(.*)$",boost::bind(&myapp::index,this,_1)); Make sure you make the server sending correct PATH_INFO variable. Best, Artyom |
From: Artyom <art...@ya...> - 2009-11-21 16:17:09
|
Hello, Shouldn't be > $HTTP["host"] == "www.hostname.com" { > url.rewrite-once => ( "^/$" > => "/index" ), url.rewrite-once => ("^(/.*)$" => "/index($1)") Or I no not understand you correctly. > fastcgi.server = ( "/" => Also I assume it should be "/index" instead of "/" I mean... Create rewrite rules that would convert anything from "/foo-bar" to "/index/foo-bar" and then make script "/index" and match with PATH_INFO for "/foo-bar" > > I am asking because now I want to do the same and with > lighttpd i have > NO success. > With a prefix like "/myapp/" it works but you have to type > www.hostname.com/myapp/index. What are matching patterns in your script? I mean urd.add(Pattern,XYZ) What do you use? > > Stanimir > > On Thu, Oct 29, 2009 at 12:02 AM, Markus Raab <us...@ma...> > wrote: > > Artyom wrote: > > > >> > >>> I tried it with nginx and apache2 and it did > not work for both. > >> > >> I've made a little test with root "/" with > cppcms_run as is > >> > >> - nginx worked but you should assume that path > does not start with "/foo" > >> but rather with "foo" > > > > Could you give me the cppcms_run arguments? > > 1.) cppcms_run -h markusbyte -s /hello hello.fcgi -c > config.txt > > 2.) cppcms_run -h markusbyte -s / hello.fcgi -c > config.txt > > > > 1. line works here (below hello), but for 2. line > nginx gives a 404 on any > > request. > > > >> - apache didn't want to accept my rules but it > looks > >> like problem of configuration > > > > Ok, at the moment it would be enough if I get any > server running with > > root "/". > > > >> Generally you should refer to the web server > fast_cgi configuration to > >> make service work from "/". > >> [...] > > > > I will take a look at it. > > > >>> The file delievery already works btw. > >> > >> BTW CppCMS 1.x.x have its own internal web server > and allows file hosting > >> for development purposes only. > >> > >> See: > >> [...] > >> > >> It may give you some ideas how could this look > like in next version. File > >> Server itself is internal but it can be used as > base for such application. > > > > Interesting, your code looks like a complete duplicate > of mine (or the other > > way round) :-) > > > > I also used a map for the mime_types checking against > extension() and for > > copying I also used the read and write and even the > same buffer size :-) > > > > However I plan for the future to use shared-mime-info, > which has much more > > complete information about mime-types. > > > > Why is this internal file server needed? > > > >> In any case, serving files efficiently is **very** > hard task, and I would > >> recommend you relay on web server that can use > functions like sendfile. Or > >> at least try to use features like X-Send-File > header of lighttp and nginx. > >> Because, be shure they do it better then you can > write with best cache. > > > > If there are performance issues I can use the > X-Send-File feature, thank you > > for the hint. > > > >>> I have not used filters enough up to yet. But > I am sure creating your own > >>> filters can be very handy. > >> > >> Take a look on Wikipp it has "markdown" filter > that is used for formattng > >> pages. > > > > Ohh, thank you, I think I can use that markdown2html. > Supporting a wiki > > syntax is the first extra feature on my wish list. > > > > > > best regards > > Markus Raab > > > > -- > > http://www.markus-raab.org | Glücklicher als der > Glücklichste ist, wer > > -o) | andere > Menschen glücklich machen kann. -- > > Kernel 2.6.24-1-a /\ | Alexandre Dumas > > on a x86_64 _\_v | > > > > > > > ------------------------------------------------------------------------------ > > Come build with us! The BlackBerry(R) Developer > Conference in SF, CA > > is the only developer event you need to attend this > year. Jumpstart your > > developing skills, take BlackBerry mobile applications > to market and stay > > ahead of the curve. Join us from November 9 - 12, > 2009. Register now! > > http://p.sf.net/sfu/devconference > > _______________________________________________ > > Cppcms-users mailing list > > Cpp...@li... > > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal > Reports 2008 30-Day > trial. Simplify your report design, integration and > deployment - and focus on > what you do best, core application coding. Discover what's > new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Stanimir M. <sta...@zo...> - 2009-11-21 16:14:09
|
Hi, I must add that the problem is not in the configuration but in the regex in the url.add method. If the regex is url.add("(.*)", boost::bind<void>(&myapp::index,this,_1)); it works. However, when I try to display the binded argument it is an empty string. So I was not able to figure out what should be the regex for the mapping. Stanimir On Sat, Nov 21, 2009 at 5:05 PM, Stanimir Mladenov <sta...@zo...> wrote: > Did you managed to run any server running with root "/"? > > My goal is when someone types www.hostname.com to be forwarded > automatically to www.hostname.com/index trough the cppcms mapping for > the index page. > Here is my lighty.conf > > server.modules += ("mod_fastcgi") > server.document-root = "/home/stanimir/projects/cppcmstest/build" > mimetype.assign = ( > ".pdf" => "application/pdf", > # default mime type > "" => "application/octet-stream", > ) > > server.port = 80 > server.bind = "www.hostname.com" > $HTTP["host"] == "www.hostname.com" { > url.rewrite-once => ( "^/$" => "/index" ), > fastcgi.server = ( "/" => (( > "bin-path" => > "/home/stanimir/projects/cppcmstest/build/cppcmstest.fcgi -c > /home/stanimir/projects/cppcmstest/build/config.txt", > "check-local" => "disable", > "socket" => "/tmp/cppcmstest.fcgi.socket", > "max-procs" => 1 > ))) > } > > I am asking because now I want to do the same and with lighttpd i have > NO success. > With a prefix like "/myapp/" it works but you have to type > www.hostname.com/myapp/index. > > Stanimir > > On Thu, Oct 29, 2009 at 12:02 AM, Markus Raab <us...@ma...> wrote: >> Artyom wrote: >> >>> >>>> I tried it with nginx and apache2 and it did not work for both. >>> >>> I've made a little test with root "/" with cppcms_run as is >>> >>> - nginx worked but you should assume that path does not start with "/foo" >>> but rather with "foo" >> >> Could you give me the cppcms_run arguments? >> 1.) cppcms_run -h markusbyte -s /hello hello.fcgi -c config.txt >> 2.) cppcms_run -h markusbyte -s / hello.fcgi -c config.txt >> >> 1. line works here (below hello), but for 2. line nginx gives a 404 on any >> request. >> >>> - apache didn't want to accept my rules but it looks >>> like problem of configuration >> >> Ok, at the moment it would be enough if I get any server running with >> root "/". >> >>> Generally you should refer to the web server fast_cgi configuration to >>> make service work from "/". >>> [...] >> >> I will take a look at it. >> >>>> The file delievery already works btw. >>> >>> BTW CppCMS 1.x.x have its own internal web server and allows file hosting >>> for development purposes only. >>> >>> See: >>> [...] >>> >>> It may give you some ideas how could this look like in next version. File >>> Server itself is internal but it can be used as base for such application. >> >> Interesting, your code looks like a complete duplicate of mine (or the other >> way round) :-) >> >> I also used a map for the mime_types checking against extension() and for >> copying I also used the read and write and even the same buffer size :-) >> >> However I plan for the future to use shared-mime-info, which has much more >> complete information about mime-types. >> >> Why is this internal file server needed? >> >>> In any case, serving files efficiently is **very** hard task, and I would >>> recommend you relay on web server that can use functions like sendfile. Or >>> at least try to use features like X-Send-File header of lighttp and nginx. >>> Because, be shure they do it better then you can write with best cache. >> >> If there are performance issues I can use the X-Send-File feature, thank you >> for the hint. >> >>>> I have not used filters enough up to yet. But I am sure creating your own >>>> filters can be very handy. >>> >>> Take a look on Wikipp it has "markdown" filter that is used for formattng >>> pages. >> >> Ohh, thank you, I think I can use that markdown2html. Supporting a wiki >> syntax is the first extra feature on my wish list. >> >> >> best regards >> Markus Raab >> >> -- >> http://www.markus-raab.org | Glücklicher als der Glücklichste ist, wer >> -o) | andere Menschen glücklich machen kann. -- >> Kernel 2.6.24-1-a /\ | Alexandre Dumas >> on a x86_64 _\_v | >> >> >> ------------------------------------------------------------------------------ >> Come build with us! The BlackBerry(R) Developer Conference in SF, CA >> is the only developer event you need to attend this year. Jumpstart your >> developing skills, take BlackBerry mobile applications to market and stay >> ahead of the curve. Join us from November 9 - 12, 2009. Register now! >> http://p.sf.net/sfu/devconference >> _______________________________________________ >> Cppcms-users mailing list >> Cpp...@li... >> https://lists.sourceforge.net/lists/listinfo/cppcms-users >> > |
From: Stanimir M. <sta...@zo...> - 2009-11-21 15:05:49
|
Did you managed to run any server running with root "/"? My goal is when someone types www.hostname.com to be forwarded automatically to www.hostname.com/index trough the cppcms mapping for the index page. Here is my lighty.conf server.modules += ("mod_fastcgi") server.document-root = "/home/stanimir/projects/cppcmstest/build" mimetype.assign = ( ".pdf" => "application/pdf", # default mime type "" => "application/octet-stream", ) server.port = 80 server.bind = "www.hostname.com" $HTTP["host"] == "www.hostname.com" { url.rewrite-once => ( "^/$" => "/index" ), fastcgi.server = ( "/" => (( "bin-path" => "/home/stanimir/projects/cppcmstest/build/cppcmstest.fcgi -c /home/stanimir/projects/cppcmstest/build/config.txt", "check-local" => "disable", "socket" => "/tmp/cppcmstest.fcgi.socket", "max-procs" => 1 ))) } I am asking because now I want to do the same and with lighttpd i have NO success. With a prefix like "/myapp/" it works but you have to type www.hostname.com/myapp/index. Stanimir On Thu, Oct 29, 2009 at 12:02 AM, Markus Raab <us...@ma...> wrote: > Artyom wrote: > >> >>> I tried it with nginx and apache2 and it did not work for both. >> >> I've made a little test with root "/" with cppcms_run as is >> >> - nginx worked but you should assume that path does not start with "/foo" >> but rather with "foo" > > Could you give me the cppcms_run arguments? > 1.) cppcms_run -h markusbyte -s /hello hello.fcgi -c config.txt > 2.) cppcms_run -h markusbyte -s / hello.fcgi -c config.txt > > 1. line works here (below hello), but for 2. line nginx gives a 404 on any > request. > >> - apache didn't want to accept my rules but it looks >> like problem of configuration > > Ok, at the moment it would be enough if I get any server running with > root "/". > >> Generally you should refer to the web server fast_cgi configuration to >> make service work from "/". >> [...] > > I will take a look at it. > >>> The file delievery already works btw. >> >> BTW CppCMS 1.x.x have its own internal web server and allows file hosting >> for development purposes only. >> >> See: >> [...] >> >> It may give you some ideas how could this look like in next version. File >> Server itself is internal but it can be used as base for such application. > > Interesting, your code looks like a complete duplicate of mine (or the other > way round) :-) > > I also used a map for the mime_types checking against extension() and for > copying I also used the read and write and even the same buffer size :-) > > However I plan for the future to use shared-mime-info, which has much more > complete information about mime-types. > > Why is this internal file server needed? > >> In any case, serving files efficiently is **very** hard task, and I would >> recommend you relay on web server that can use functions like sendfile. Or >> at least try to use features like X-Send-File header of lighttp and nginx. >> Because, be shure they do it better then you can write with best cache. > > If there are performance issues I can use the X-Send-File feature, thank you > for the hint. > >>> I have not used filters enough up to yet. But I am sure creating your own >>> filters can be very handy. >> >> Take a look on Wikipp it has "markdown" filter that is used for formattng >> pages. > > Ohh, thank you, I think I can use that markdown2html. Supporting a wiki > syntax is the first extra feature on my wish list. > > > best regards > Markus Raab > > -- > http://www.markus-raab.org | Glücklicher als der Glücklichste ist, wer > -o) | andere Menschen glücklich machen kann. -- > Kernel 2.6.24-1-a /\ | Alexandre Dumas > on a x86_64 _\_v | > > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry(R) Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9 - 12, 2009. Register now! > http://p.sf.net/sfu/devconference > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Artyom <art...@ya...> - 2009-11-12 09:10:26
|
Announcement: CppCMS 1.x.x branch moved to CMake >= 2.4 Autotools would no longer be supported. CppCMS primary branch (0.0.x) -- trunk would continue to work with autotools. See: http://art-blog.no-ip.info/cppcms/blog/post/51 I hope this change would be understood by CppCMS users community. Artyom |
From: Markus R. <us...@ma...> - 2009-11-11 17:00:20
|
Artyom wrote: > Hello... > >> >> Searching for libs is very easy - if there is already >> support for it. It is >> also often done without pkg-config. Something like >> find_package(Boost 1.34 REQUIRED COMPONENTS thread >> date_time program_options >> regex filesystem) >> may be enough. > > Good you mentioned it ;-) Just to make my points better. > Ok lets try to search a library by myself and check if I can > find all I need... Find 5 libraries... but second > if(X and Y and Z and T) does not work in CMake syntax... > So lets write long-long tests... The tests are quite long, but hopefully they will be shared along projects soon or accepted into cmake core. > Ok lets check where we have socket? in libc, nls, or socket > (AC_SEARCH_LIBS) there is no such thing (note it is quite > different from find library)... > > Write long macros again. Yes > Now, lets check for simple C++0x feature "auto"... Wait a second > for TRY_COMPILE I need to create a project instead of writing > 3 lines. WTF??? You are writing for boost, so you can simply use BOOST_NO_AUTO_DECLARATIONS and don't need to write the checks yourself :-) > ----------------------------- > In other words... > > CMake is almost as useable as... handly written configure script. > It is just too verbose, It is more > verbose by an order of magnitude then auto* even for simple > tasks you take for granted. It is verbose, no question about that. I am asking myself how happy you will be with Jam :-) Markus -- http://www.markus-raab.org | Nur wer gegen den Strom schwimmt, kann zu -o) | Quelle gelangen. -- Chinesisches Kernel 2.6.24-1-a /\ | Sprichwort on a x86_64 _\_v | |
From: Artyom <art...@ya...> - 2009-11-10 21:32:07
|
Hello... > > Searching for libs is very easy - if there is already > support for it. It is > also often done without pkg-config. Something like > find_package(Boost 1.34 REQUIRED COMPONENTS thread > date_time program_options > regex filesystem) > may be enough. Good you mentioned it ;-) Just to make my points better. This exactly what stucks me now. I have two versions of boost, system installed 1.35 and local 1.39 I give CMake Paths to library headers and libs... It seearches... finds 1.39 but... Instead of linking with /some/path/to/libboost_foo_bar.so it links to /usr/lib/libboost_foo_bar.so Headers and libraries of different version!!! WTF?? All I need to do with auto is ./configure CXXFLAGS=-I/path/inc LIBS=-L/path/lib But CMake is smarter... Ok lets try to search a library by myself and check if I can find all I need... Find 5 libraries... but second if(X and Y and Z and T) does not work in CMake syntax... So lets write long-long tests... Ok lets check where we have socket? in libc, nls, or socket (AC_SEARCH_LIBS) there is no such thing (note it is quite different from find library)... Write long macros again. Now, lets check for simple C++0x feature "auto"... Wait a second for TRY_COMPILE I need to create a project instead of writing 3 lines. WTF??? ----------------------------- In other words... CMake is almost as useable as... handly written configure script. It is just too verbose, It is more verbose by an order of magnitude then auto* even for simple tasks you take for granted. > > Btw. have you already read > http://www.rrsd.com/software_development/boost/oopsla05.pdf > Thanks for the link... No I still didn't Artyom |
From: Markus R. <us...@ma...> - 2009-11-10 20:48:35
|
Artyom wrote: > Hello, > >> I see that you use cmake for boost.locale - are you >> planning to use it for >> cppcms too? > > Unfortunatly I think I would have to. There is no other > way to support MSVC, I may want to in future. I don't care about windows, but I still look forward to see cmake :-) >> - separate build directory > > No problems to do this with autotools as well. > > To be honest... For me cmake is far behind autotools. > It misses lots of features: > > - Even simple and frequent things like "AC_SEARCH_LIBS", > AC_TRY_COMPILE become very inconvinient. Searching for libs is very easy - if there is already support for it. It is also often done without pkg-config. Something like find_package(Boost 1.34 REQUIRED COMPONENTS thread date_time program_options regex filesystem) may be enough. For detection of boost (and many graphic libs) you can take a look at the sourcecode of performous.org. I think about 30% of their source code is cmake code - mostly checkers for many libraries. > - Support of static/shared builds, is very unfriendly. I think thats taste - I found libtool unfriendly. > - Switching compilers works very bad Ok, I have no experience on that. > - Documentation total crap, seriously. Documenation could be always improved. > - Shared Objects versioning is quite bad and non standard Isn't that the programmers job? > - Unintall support is none. Mmmh, I would say its better because you can make native packages which uninstall really clean. make uninstall is always a hassle, because it does not work on other versions than the one you used for installation. > CMake may be good for Windows programming but it does not fit > well in Unix world too good -- and this is my primary target > platform. > > In any case I'm still checking if CMake fits my needs at all. > > Bottom line, if you do not care about Windows, autotools > still are best. autotools have a greater beginners barrier. You need to learn a lot about portable shell, m4, Makefile, Makefile.in (and maybe Makefile.am)... For cmake you basically only need to learn the very easy syntax: http://www.cmake.org/cmake/help/syntax.html Btw. have you already read http://www.rrsd.com/software_development/boost/oopsla05.pdf It might help you. Markus -- http://www.markus-raab.org | Wir leben in einem gefährlichen Zeitalter: -o) | Der Mensch beherrscht die Natur, bevor er Kernel 2.6.24-1-a /\ | gelernt hat, sich selbst zu beherrschen. on a x86_64 _\_v | -- Schweitzer, Albert |
From: Artyom <art...@ya...> - 2009-11-10 19:40:36
|
Hello, > I see that you use cmake for boost.locale - are you > planning to use it for > cppcms too? Unfortunatly I think I would have to. There is no other way to support MSVC, I may want to in future. > - separate build directory No problems to do this with autotools as well. To be honest... For me cmake is far behind autotools. It misses lots of features: - Even simple and frequent things like "AC_SEARCH_LIBS", AC_TRY_COMPILE become very inconvinient. - Support of static/shared builds, is very unfriendly. - Switching compilers works very bad - Documentation total crap, seriously. - Shared Objects versioning is quite bad and non standard - Unintall support is none. I used CMake for Boost.Locale just because I needed MSVC support. If libtool would support MSVC I would not think twice I still making a usability test of CMake, because there are lots of non-trivial things I may want to do. CMake may be good for Windows programming but it does not fit well in Unix world too good -- and this is my primary target platform. In any case I'm still checking if CMake fits my needs at all. Bottom line, if you do not care about Windows, autotools still are best. Artyom |
From: Markus R. <us...@ma...> - 2009-11-10 18:31:58
|
Artyom wrote: > To be honest, this tool is not missing only in Web development. > The situation with Localization is quite bad in any areas. Wow, I am impressed what you already achieved! boost.locale is really missing - and you are doing a great job and it seems like you have a lot of experience in that field. I see that you use cmake for boost.locale - are you planning to use it for cppcms too? Some features are very convenient: - separate build directory - far less required files in root (cppcms 0.0.4 has everything in root - together with autotools this situation is not optimal) - cpack makes e.g. deb packages for local install - dependency tracking is very good - a CMakeLists.txt per directory - and best of all - cppcms could be easily copied as subproject into projects using it, without running configure twice :-) The last point is of course not very important once cppcms is available as package in major distros. Of course there are also many pros for autotools - I am just asking. thank you Markus |
From: Artyom <art...@ya...> - 2009-11-10 17:36:55
|
Hello, > Without stdio.h sscanf is not defined in the > cppcms::encryptor constructor. thanks, fixed in trunk. > > Artyom, congratulations for the Boost.Locale! You have the > ability to > spot exactly where is the missing tool for c++ web > development and > most importantly you have the courage to work and implement > it :) > To be honest, this tool is not missing only in Web development. The situation with Localization is quite bad in any areas. In any case, it would be extreamly helpful if Boost.Locale would be reviewed by many eyes, and the review notes would be sent to Boost mailing list. Preliminary review is very important in order to make it possible to submit the library in future for formal review and make it included in Boost. Thanks, Artyom |
From: Stanimir M. <sta...@zo...> - 2009-11-10 17:05:18
|
Mine gcc version is 4.4.1 Without stdio.h sscanf is not defined in the cppcms::encryptor constructor. Artyom, congratulations for the Boost.Locale! You have the ability to spot exactly where is the missing tool for c++ web development and most importantly you have the courage to work and implement it :) Stanimir On Tue, Nov 10, 2009 at 5:51 PM, Artyom <art...@ya...> wrote: >> You can compile it just by adding in >> the session_sid.h and encryptor.h >> the following includes: >> >> #include <stdint.h> >> #include <stdio.h> > > I see, you really need stdint.h, but do you need stdio.h? > > I'll fix in trunk ASAP. > > What gcc version are you using? > > Artyom > > > > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Artyom <art...@ya...> - 2009-11-10 15:51:18
|
> You can compile it just by adding in > the session_sid.h and encryptor.h > the following includes: > > #include <stdint.h> > #include <stdio.h> I see, you really need stdint.h, but do you need stdio.h? I'll fix in trunk ASAP. What gcc version are you using? Artyom |
From: Stanimir M. <sta...@zo...> - 2009-11-10 15:28:20
|
You can compile it just by adding in the session_sid.h and encryptor.h the following includes: #include <stdint.h> #include <stdio.h> That worked for me, but I am sure that after your report Artyom will fix it in the trunk too. Greetings, Stanimir On Tue, Nov 10, 2009 at 3:39 PM, Mike Axiak <mi...@ax...> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > First of all, I'd like to thank the work on this project. I'm very > excited to start using this. > I'm currently using Ubuntu 9.10 and trying to compile this project > (using both the release and svn head). > After installing all the dependencies (which involve specifying boost > version 1.40), it still will not compile. > I got this error: > > In file included from hmac_encryptor.h:3, > from session_cookies.cpp:5: > encryptor.h:18: error: ‘uint16_t’ does not name a type > > > - -Mike > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.9 (GNU/Linux) > Comment: Use GnuPG with Firefox : http://getfiregpg.org (Version: 0.7.10) > > iEYEARECAAYFAkr5bPoACgkQ3wH7qi4osjgywACfS6rMRTMCm0mM1grZP1+mcCFs > 5IUAoM0fGmtRxyKONGXZtuOFA+L/5K7j > =gg6F > -----END PGP SIGNATURE----- > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
From: Mike A. <mi...@ax...> - 2009-11-10 14:00:58
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 First of all, I'd like to thank the work on this project. I'm very excited to start using this. I'm currently using Ubuntu 9.10 and trying to compile this project (using both the release and svn head). After installing all the dependencies (which involve specifying boost version 1.40), it still will not compile. I got this error: In file included from hmac_encryptor.h:3, from session_cookies.cpp:5: encryptor.h:18: error: ‘uint16_t’ does not name a type - -Mike -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Use GnuPG with Firefox : http://getfiregpg.org (Version: 0.7.10) iEYEARECAAYFAkr5bPoACgkQ3wH7qi4osjgywACfS6rMRTMCm0mM1grZP1+mcCFs 5IUAoM0fGmtRxyKONGXZtuOFA+L/5K7j =gg6F -----END PGP SIGNATURE----- |
From: Markus R. <us...@ma...> - 2009-10-28 22:03:55
|
Artyom wrote: > >> I tried it with nginx and apache2 and it did not work for both. > > I've made a little test with root "/" with cppcms_run as is > > - nginx worked but you should assume that path does not start with "/foo" > but rather with "foo" Could you give me the cppcms_run arguments? 1.) cppcms_run -h markusbyte -s /hello hello.fcgi -c config.txt 2.) cppcms_run -h markusbyte -s / hello.fcgi -c config.txt 1. line works here (below hello), but for 2. line nginx gives a 404 on any request. > - apache didn't want to accept my rules but it looks > like problem of configuration Ok, at the moment it would be enough if I get any server running with root "/". > Generally you should refer to the web server fast_cgi configuration to > make service work from "/". > [...] I will take a look at it. >> The file delievery already works btw. > > BTW CppCMS 1.x.x have its own internal web server and allows file hosting > for development purposes only. > > See: > [...] > > It may give you some ideas how could this look like in next version. File > Server itself is internal but it can be used as base for such application. Interesting, your code looks like a complete duplicate of mine (or the other way round) :-) I also used a map for the mime_types checking against extension() and for copying I also used the read and write and even the same buffer size :-) However I plan for the future to use shared-mime-info, which has much more complete information about mime-types. Why is this internal file server needed? > In any case, serving files efficiently is **very** hard task, and I would > recommend you relay on web server that can use functions like sendfile. Or > at least try to use features like X-Send-File header of lighttp and nginx. > Because, be shure they do it better then you can write with best cache. If there are performance issues I can use the X-Send-File feature, thank you for the hint. >> I have not used filters enough up to yet. But I am sure creating your own >> filters can be very handy. > > Take a look on Wikipp it has "markdown" filter that is used for formattng > pages. Ohh, thank you, I think I can use that markdown2html. Supporting a wiki syntax is the first extra feature on my wish list. best regards Markus Raab -- http://www.markus-raab.org | Glücklicher als der Glücklichste ist, wer -o) | andere Menschen glücklich machen kann. -- Kernel 2.6.24-1-a /\ | Alexandre Dumas on a x86_64 _\_v | |
From: Artyom <art...@ya...> - 2009-10-28 20:23:39
|
> I tried it with nginx and apache2 and it did not work for both. I've made a little test with root "/" with cppcms_run as is - nginx worked but you should assume that path does not start with "/foo" but rather with "foo" - apache didn't want to accept my rules but it looks like problem of configuration Generally you should refer to the web server fast_cgi configuration to make service work from "/". When CppCMS recieves a request it uses "PATH_INFO" CGI variable for matching the URLs so if PATH_INFO is provided correctly it should work. Its a metter of correct web server configuration. > The file delievery already works btw. BTW CppCMS 1.x.x have its own internal web server and allows file hosting for development purposes only. See: http://cppcms.svn.sourceforge.net/viewvc/cppcms/framework/branches/refactoring/internal_file_server.h?revision=770&view=markup http://cppcms.svn.sourceforge.net/viewvc/cppcms/framework/branches/refactoring/internal_file_server.cpp?revision=790&view=markup It may give you some ideas how could this look like in next version. File Server itself is internal but it can be used as base for such application. In any case, serving files efficiently is **very** hard task, and I would recommend you relay on web server that can use functions like sendfile. Or at least try to use features like X-Send-File header of lighttp and nginx. Because, be shure they do it better then you can write with best cache. > I have not used filters enough up to yet. But I am sure creating your own > filters can be very handy. Take a look on Wikipp it has "markdown" filter that is used for formattng pages. Also I > There is a telnet session at the end. Do you need other information? As I send in previous mail. Thanks for the bug report. Fixed in trunk. > Ok, now I can't await CppCMS 1.x.x :-) Me too ;) Artyom. |
From: Markus R. <us...@ma...> - 2009-10-28 18:15:32
|
Artyom wrote: >> Can someone explain me how to use cppcms_run for a production release or >> is it not suitable for that? > > Defenatly not. cppcms_run is just tool for debugging and testing the > framework agains different web servers. Thanks for making that clear. I have to admit that it is great tool for debugging and testing! > For example. This is configuration of production CppCMS wiki service for > lighttpd. Thank you for your configuration and explanation! I am not sure at the moment which server to use. >> I am a bit confused why the document root is an absolut path, while the >> fcgi process must be relative: >> /usr/local/bin/cppcms_run: line 474: ./MY_ABS_PATH/hello.fcgi: File not >> found (so ./ is prefixed there) > > It is just because I'm too lazy to write full path. So cppcms_run assumes > that the script is placed in current working directory and it names script > -- the base path according to program name by default. Ok, this makes perfectly sense when it is used for debugging. >> 2.) How can I run the site at the root of the server? >> >> When I use -s /hello, I can access the site at >> http://markusbyte:8080/hello/. How can I completely avoid the /hello/ to >> access the site at http://markusbyte:8080/. >> >> I hope it can be done without rewrite rules. It would be perfect if there >> is a webserver independend way? > > > Generally it is **bad** idea. And I explain why. Web server does much more > then providing fast-cgi service it also serves files. If hello is related > to / then if you want to get a file "/hello.css" you need to know how to > serve it VIA your program, and beleve me YOU DO NOT want to do this > because serving files has LOTs of security issues that should be handled > correctly. It is easy to give exceptions that specific paths or file extensions are not handeled by a fcgi program. At least with mod_rewrite for apache. I absolutely agree that for a normal web application or cms the normal file delievery should be done by the web server because of the security issues. But for the project I am writing these security issues do not exist. All files are in a single directory where the user has only read, but no write permissions. For my system it is not possible to distinguish between content and media files, because all can be delieverd as they are or rendered to html files. Besides that I want full control over the delievery and want my own code to design what to do with a specific mime type and so on. Delievering everything myself also makes it possible to have a global caching strategy for all files. I also want syndication for all directories. The file delievery already works btw. > Generally you may specify as script "/", but some web servers have problem > with that. I tried it with nginx and apache2 and it did not work for both. >> 3.) Using filters in other classes than base_view. >> >> The filters like escape can be only used in base_view classes (or classes >> inheriting from it) and I don't see any reason why. In addition to that >> there are not const, but they don't modify the object (they just return a >> string). >> > > They are not const but some filter may be non-const. Just think that you > may to access DB from filter if cache is not avalible (not that it is > correct way to do this) const only refers to the state of the object, not to global sideeffects like network or database. For caching you can use the keyword mutable. >> I would suggest to make them as functions or static methods. >> --------- > > In CppCMS 1.x.x they are static methods. Ok, this is perfect then. Up to that I need a copy of encode in my code. > There is one more important quite technical point why these functions are > members. I have not used filters enough up to yet. But I am sure creating your own filters can be very handy. >> 4.) Wrong mime type for failure pages. >> >> For 500 internal server errors, 404 document not found and so on the >> Content-Type is text/plain even though a html page is shown[0]. > > Ok I need to check this. When do you get page of size "0" generally when > 500 or 404 error occures an html page is generated as well? How do you > get such error? There is a telnet session at the end. Do you need other information? >> 5.) Interface to set_header. >> >> In cppcms::application set_header takes a pointer to HTTPHeader. When I >> look into cppcms::worker_thread::set_header I see that a auto_ptr is >> taking ownership of this pointer. Maybe the documentation points out that >> too, but it would be much clearer if the the auto_ptr is used in the >> interface. Having that, it would be easy to see that you can pass a fresh >> allocated object without having to worry what will happen. So it should >> read: >> >> void set_header(std::auto_ptr<cgicc::HTTPHeader> h) { >> worker.set_header(h); } >> > > I am absolutly agree, but I must admit that all http headers stuff is > quite conceptually broken because of very bad design of CgiCC library > CppCMS uses. It is totally rewritten in CppCMS 1.x.x Ok, now I can't await CppCMS 1.x.x :-) thank you Markus Raab -- http://www.markus-raab.org | Einsicht ist der erste Schritt zur -o) | Besserung. -- Sprichwort Kernel 2.6.24-1-a /\ | on a x86_64 _\_v | |