Re: [Cppcms-users] lighttp + fastcgi configuration problem
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-01-16 11:48:13
|
You need URL Rewriting: Read this: http://art-blog.no-ip.info/wikipp/en/page/run_application_web_server_root Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.sf.net/ CppDB - C++ SQL Connectivity: http://cppcms.sf.net/sql/cppdb/ >________________________________ > From: Alexey Umnov <um...@gm...> >To: cpp...@li... >Sent: Monday, January 16, 2012 10:56 AM >Subject: [Cppcms-users] lighttp + fastcgi configuration problem > > >Hello! > > >After running my test app behind the web back-end I've encountered a problem with URL dispatching. >I have a virtual host on my machine "app.net" and appropriate record has been putted to /etc/hosts: "app.net 127.0.0.1". >I'm running my app externally. My lighttp configuration related to subject is as follows: > > >$HTTP["host"] == "app.net" { >server.document-root = "/opt/sites/app/" >alias.url += ("/scripts"=>"/opt/sites/app/scripts") >} > > ># here I expect all address strings which contain "app.net" are delivered to my app >fastcgi.server = ( "/" => (( >"socket" => "/tmp/app-fcgi-socket", >"max-procs" => 1, >"check-local" => "disable" >)) >) > > >My CppCMS config: >{ >"service" : { >"api" : "fastcgi", >"socket" : "/tmp/app-fcgi-socket" >} >} > > >I manage URLs in following way: >MyApp::MyApp(cppcms::service& srv) : >cppcms::application(srv) >{ >dispatcher().assign("", &MyApp::main, this); >dispatcher().assign("/home", &MyApp::main, this); >dispatcher().assign("/page1", &MyApp::page1, this); >dispatcher().assign("/page2", &MyApp::page2, this); >} > > >void MyApp::main() { >content::Home home; >home.text = "Welcome home!"; >render("Home", home); >} > > >void MyApp::page1() { >content::Page1 page; >page.text = "Page 1"; >render("Page", page); >} > > >void MyApp::page2() { >content::Page2 page; >page.text = "Page"; >render("Page2", page2); >} > > >I expected the following behavior: >http://app.net -> "Welcome home!" >http://app.net/page1 -> "Page 1" >http://app.net/page2 -> "Page 2" > > >but I'm getting the following: >http://app.net -> "Welcome home!" >http://app.net/page1 -> "Welcome home!" >http://app.net/page2 -> "Welcome home!" > > >And I've noticed that >http://app.net -> "Welcome home!" >http://app.net/asd/page1 -> "Page 1" >http://app.net/asd/page2 -> "Page 2" > > >(I can use any string in place of "asd" above and it's OK) > > >Seems like there are lighttp configuration problem but I don't know how to cope with it. > > >Any ideas about how to achieve what I expect? >Thank you! >------------------------------------------------------------------------------ >RSA(R) Conference 2012 >Mar 27 - Feb 2 >Save $400 by Jan. 27 >Register now! >http://p.sf.net/sfu/rsa-sfdev2dev2 >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |