[Cppcms-users] RES: RES: RES: RES: Run on Windows 7
Brought to you by:
artyom-beilis
|
From: Renato F. <re....@ay...> - 2011-03-24 12:22:05
|
Hi Artyom,
Thanks a lot of clarification, I will try implement some small site to see
how is develop using it.
But now, I already have a technical question, (is about how load resources,
gif, jpg, css, js etc) for sample this code:
----------------------------------------------------------------------------
---------------------------------------------------------------------------
void test::main(std::string /*url*/)
{
string line;
ifstream myfile ("index2.html");
if (myfile.is_open())
{
while ( myfile.good() )
{
getline (myfile,line);
response().out() << line;
}
myfile.close();
}
else response().out()<< "Unable to open file";
}
============================================================================
================
Load html of disk, and show it, but not show linked resources like: gif,
jpg, css, js
See html:
----------------------------------------------------------------------------
---------------------------------------------------------------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>::</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class="text_gray_login" id="apDiv1">Segunda-feira, 20 de setembro de
2011.</div>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
<tr>
<td bgcolor="#034EA1"><img src="imgs/spacer.gif" width="10"
height="10"></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><table width="100%" border="0">
<tr>
<td><img src="imgs/vgs.gif" width="749" height="189"></td>
</tr>
<tr>
<td></td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#666666"><table width="737" border="0" cellspacing="0"
cellpadding="0">
<tr>
<td width="14"><img src="imgs/spacer.gif" width="14"
height="20"></td>
<td width="723" class="text_white_login"> </td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#F9A51A"><img src="imgs/spacer.gif" width="10"
height="10"></td>
</tr>
</table>
</body>
</html>
============================================================================
================
Things like this, is not loaded:
<link href="style.css" rel="stylesheet" type="text/css">
<img src="imgs/spacer.gif" width="10" height="10">
<img src="imgs/vgs.gif" width="749" height="189">
How solve this?
My plan:
1) Is use EXTJS with CPPCMS (I see that CPPCMS have a good support for JSON)
and EXTJS link all resources.
2) I have a lot of stencil (ATL SERVE) pages, I want design same thing that
allow I use attribute of ATL Server in CPPCMS, I wil design some thing that
handle this:
<title>{{onTitle}}</title>
{{onTitle}} is attribute that will be replaced by some text.
Other question, I'd see "Template System" this is like a: google-ctemplate
(http://code.google.com/p/google-ctemplate/).
And finally, Thanks and congratulations. Sorry for so many questions!
-----Mensagem original-----
De: Artyom [mailto:art...@ya...]
Enviada em: quinta-feira, 24 de março de 2011 04:43
Para: cpp...@li...
Assunto: Re: [Cppcms-users] RES: RES: RES: Run on Windows 7
>
> Now Work... :0) (the problema was that I buid zlib na pcre whong)
>
Building anything on Windows is painful...
> Well I have fell questions, if you have time to answer.
>
> Some introduction:
>
> I look for "CPPCMS" because I have one site that need run fast,
> this site was build in "ATL Server"
> (http://201.44.136.135/ucsws/establishment/authentication/default.srf)
> but now we want move to other technology (or plan is migrate to
> Linux/apache)
>
In any case I'd suggest to move to Linux, CppCMS is developed mostly on
Linux and it is the recommended deploy configuration.
> Questions:
>
> 1) CPPCMS is a good tool to build very large site that need handle many
> (thousands) users?
Yes, this is what it was designed for,
> 2) What is stability of CPPCMS?
See this: http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x
And yes, it is stable, it has some unknown bugs like any other
software but it is tested and stable software.
> 3) We plan use it with FastCGI, because of load balance and failover, how
> CPPCMS handle (distributed) sessions in this case? I need something like
> mencached, or store sessions on data base?
You have several options:
1. You may (and this is best) use encrypted or signed cookies so
you save all the data at client side while the data is digitally
signed so user can't mess with it.
It does not solve **all** problems because sometimes you need
server side storage:
See this:
http://art-blog.no-ip.info/wikipp/en/page/cppcms_1x_config#session
However you can always specify that is certain cases you want
to store data on server side and this is per session option.
2. You may use distributed filesystem like NFS or Windows Share
It is by the way would be generally very fast given
a file system like ext3 that handles many files very well.
(Generally much better then DB)
3. You can provide you own database based session backend (but be aware
that database is slow for this kind of job).
4. It is not implemented yet in CppCMS 1.x.x (it exists in 0.0.x) but
cppcms provides "scalability server" it is memcached like server
that provides support of distributed caching and it should
include support of distributed sessions.
It was removed during rewriting CppCMS 0.0.x to 1.x.x and hadn't
returned back yet.
But it would be ready before RC1 of CppCMS 1.x.x
> 4) CPPCMS is free? I can sale my products with it, or I need open source
of
> my products?
You need to follow LGPLv3 license requirements. It means that you
can use it in closed source products as long as you follow
LGPLv3 license restrictions.
If you don't want to follow LGPL restriction I'll be able to
provide a commercial license, of course for some fee.
> 5) I have plan to mix it with PHP, this is possible? Share sessions
between
> PHP and CPPCMS?
There is no support for this. However the simplest way to share
a data between PHP and CppCMS would be to use a signed cookie.
Create some data in format that C++ and PHP understands sign it
with hmac (CppCMS and PHP has built in support for it) and
then store it as cookie at client side.
> 6) You think that is possible build large site, like Facebook in CPPCMS?
> Facebook convert a lot of code In C++, CPPCMS fit in it?
As I told that it what it was designed for. I'm not ware of
CppCMS based applications deployed for a system of size of Facebook
(but I'm not aware of too many systems of scale of facebook at all)
> CPPCMS is like an
> Thrift? (about performance and scale)
>
See this: http://art-blog.no-ip.info/wikipp/en/page/benchmarks
And it scales very well, I did testing on a small network
of 3-4 computers and it scaled quite lineary.
It is designed to be scalable, it provides memcached like
distributed cache system with two levels of caches, and with
advanced cache invalidation.
Scalability is major goal and consern of CppCMS.
Regards,
Artyom
----------------------------------------------------------------------------
--
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Cppcms-users mailing list
Cpp...@li...
https://lists.sourceforge.net/lists/listinfo/cppcms-users
|