c++ - Installing a Test Application on Amazon EC2 -
i want use aws products build application on it. now, want test -
1) create webpage hosted @ aws simple text box , submit button, checking if number prime. 2) compile c++ program on ec2 accept number , reply if prime.
can list steps involved in doing this? (the above example mirrors simplistically actual application have in mind, http frontend , c++ backend)
if use default linux ami, gave standard apache installation ready go. sounds invocation style of app request-response, @ least begin with, use cgi apache run app.
to achieve this, this:
- create static html page form , submit button passes form data app via cgi
- install app appropriate directory (see apache config details) run via cgi, taking care ensure correct permissions set
- have app parse cgi environment variables gather input
- perform processing required
- generate resulting output http response (to started, use text/plain).
please note there many security issues keep in mind here, important perform strict validation on data supplied web user escaping issues, buffer overflows , on.
if aren't familiar above, need read on html forms, apache configuration , basic http headers @ at minimum. there plenty of examples out there, , great books covering topic.
to end, various libraries have been developed facilitate this:
there many other options interfacing app apache, such fastcgi.
Comments
Post a Comment