Re: [Cppcms-users] Some remarks
Brought to you by:
artyom-beilis
|
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
>>
>
|