[Cppcms-users] Some remarks
Brought to you by:
artyom-beilis
From: Markus R. <us...@ma...> - 2009-10-27 14:19:58
|
Hello list! I am currently working with cppcms for an opensource project. I will announce it (with code) when there is something useful. For now I have some questions and remarks. First I have to thank for the great work already done! Lots of basic technical stuff (manager, application_factory, worker_thread,...) and helpers (cppcms_run) are there which makes working with fcgi much easier and faster. While I was first sceptical about the static templates, I like them very much now too. It is nice that you get a compile error when there is something wrong with the template and it is certainly the solution achieving best performance. 1.) How do use cpp_cms for production server? Can someone explain me how to use cppcms_run for a production release or is it not suitable for that? I want that the user (not root!) running it has access to the document root, but of course no write access to the fcgi program (which should not be inside the document root). 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) 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? 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). I would suggest to make them as functions or static methods. 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]. 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); } This list is now also available as usenet group gmane.comp.lib.cppcms.users. thank you Markus Raab [0] $ telnet markusbyte 8080 Trying 192.168.0.3... Connected to markusbyte.markus-raab.org. Escape character is '^]'. GET / HTTP 1.1 HTTP/1.1 404 Not found Date: Tue, 27 Oct 2009 13:46:24 GMT Server: Apache/2.2.9 (Debian) mod_fastcgi/2.4.6 X-Powered-By: cppcms/0.0.4 Content-Length: 248 Connection: close Content-Type: text/plain <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>404 - Not Found</title> </head> <body> <h1>404 - Not Found</h1> </body> </html> Connection closed by foreign host. |