Thread: [Cppcms-users] Attempting to run cppcms at webroot
Brought to you by:
artyom-beilis
From: David E. <dav...@gm...> - 2011-08-31 05:08:12
|
Artyom, As cppcms is the only application im going to be running, i want to run it at web root. I modified the "root" property of blog in config.js to "/" but that did not work, I eventually modified it to just "" and that seemed to work. I also set the http.script param "/". However, something with the regex seems to be weird because the home page works fine, but any other page requires two "/" to work, i.e. 127.0.0.1//admin. If I set the http.script to "" nothing works. Any ideas? Would these problems go away if I were using lighttd or some other "real" webserver? Thanks, -dave |
From: Allan S. <all...@su...> - 2011-09-01 22:38:58
|
Sorry for the late answer, actually I was not registered on the user list (you know "I will do that tomorrow") I'm not an apache wizard, far from that, but here is what I've written to make it run there http://tato.sysko.fr (It's my alpha version of the website, directly plug on the master branch, so if it's broken when you read this message, just try a little later:-P) cat /etc/apache2/sites-enabled/tatoebacpp FastCGIConfig -maxProcesses 1 -processSlack 1 <VirtualHost *:80> ServerName tato.sysko.fr ServerAlias *.tato.sysko.fr # Usually it is given in fastcgi.conf by default FastCgiServer /blablabla/tatoebacpp_git/build/tatoeba -initial-env CPPCMS_CONFIG=/blablabla/tatoebacpp_git/config.js -socket /tmp/hello-fcgi-socket ScriptAliasMatch ^(.*)$ /blablabla/tatoebacpp_git/build/tatoeba$1 AddHandler fastcgi-script /blablabla/tatoebacpp_git/build/tatoeba </VirtualHost> nothing else, no url rewriting inside apache, and on the same apache I've also my blog running with an instance of cppcms blog with the same configuration as below, except of course the server name (here if you ask why I have a ServerAlias directive, it's because I use the subdomain to choose the interface language en.website.ltd fr.website.ltd etc.) After I don't know if this configuration file is made in the rules of the art, but well it works, so I haven't touched it since. hope it helps. Regards, Allan |
From: Artyom B. <art...@ya...> - 2011-08-31 05:28:19
|
You need to use some URL rewriting. The point is that there are files that should be served by the web server like "/media/*.css" "/media/*.png" and more. So you need to do apply some URL rewriting rules such that path "/something" would map to lets say "/blog.cgi/something" where "/blog.cgi" is the FastCGI script name. I think Allan Simon that is on this mailing list did that... Allan? Artyom Beilis >________________________________ >From: David Elrom <dav...@gm...> >To: cpp...@li... >Sent: Wednesday, August 31, 2011 8:07 AM >Subject: [Cppcms-users] Attempting to run cppcms at webroot > > >Artyom, > > > >As cppcms is the only application im going to be running, i want to run it at web root. I modified the "root" property of blog in config.js to "/" but that did not work, I eventually modified it to just "" and that seemed to work. I also set the http.script param "/". However, something with the regex seems to be weird because the home page works fine, but any other page requires two "/" to work, i.e. 127.0.0.1//admin. > > >If I set the http.script to "" nothing works. > > >Any ideas? > > >Would these problems go away if I were using lighttd or some other "real" webserver? > > >Thanks, >-dave >------------------------------------------------------------------------------ >Special Offer -- Download ArcSight Logger for FREE! >Finally, a world-class log management solution at an even better >price-free! And you'll get a free "Love Thy Logs" t-shirt when you >download Logger. Secure your free ArcSight Logger TODAY! >http://p.sf.net/sfu/arcsisghtdev2dev >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
From: augustin <aug...@ov...> - 2011-08-31 07:57:38
|
On Wednesday, August 31, 2011 01:28:12 PM Artyom Beilis wrote: > So you need to do apply some URL rewriting rules such that path > "/something" would map to lets say "/blog.cgi/something" where "/blog.cgi" > is the FastCGI script name. I am not Allan, but that's what I did, too. David doesn't say which web server he uses. mod_rewrite with apache2 works like a charm. .htaccess: <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ my_app.cgi/$1 [L,QSA] </IfModule> Of course, Apache2 must be properly configured to allow .htaccess override of mod_rewrite. David: this is likely to become a FAQ (literally): can you add a new page about this somewhere in the wiki? Blessings, Augustin. -- Friends: http://www.reuniting.info/ My projects: http://astralcity.org/ http://3enjeux.overshoot.tv/ http://linux.overshoot.tv/ http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ http://openteacher.info/ http://minguo.info/ http://www.wechange.org/ http://searching911.info/ . |
From: David E. <dav...@gm...> - 2011-09-01 01:19:29
|
i was going to use lighttpd. On Wed, Aug 31, 2011 at 3:40 AM, augustin <aug...@ov...>wrote: > On Wednesday, August 31, 2011 01:28:12 PM Artyom Beilis wrote: > > So you need to do apply some URL rewriting rules such that path > > "/something" would map to lets say "/blog.cgi/something" where > "/blog.cgi" > > is the FastCGI script name. > > I am not Allan, but that's what I did, too. > > David doesn't say which web server he uses. > mod_rewrite with apache2 works like a charm. > > .htaccess: > > <IfModule mod_rewrite.c> > RewriteEngine on > > RewriteCond %{REQUEST_FILENAME} !-f > RewriteCond %{REQUEST_FILENAME} !-d > RewriteRule ^(.*)$ my_app.cgi/$1 [L,QSA] > </IfModule> > > > Of course, Apache2 must be properly configured to allow .htaccess override > of > mod_rewrite. > > David: this is likely to become a FAQ (literally): can you add a new page > about this somewhere in the wiki? > > Blessings, > > Augustin. > > > > -- > Friends: http://www.reuniting.info/ > My projects: > http://astralcity.org/ http://3enjeux.overshoot.tv/ > http://linux.overshoot.tv/ > http://overshoot.tv/ http://charityware.info/ http://masquilier.org/ > http://openteacher.info/ http://minguo.info/ > http://www.wechange.org/ http://searching911.info/ > > > > > > > > > > > > > . > > > ------------------------------------------------------------------------------ > Special Offer -- Download ArcSight Logger for FREE! > Finally, a world-class log management solution at an even better > price-free! And you'll get a free "Love Thy Logs" t-shirt when you > download Logger. Secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsisghtdev2dev > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |