安装在Amazon EC2上测试应用程序 [英] Installing a Test Application on Amazon EC2

查看:236
本文介绍了安装在Amazon EC2上测试应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用AWS产品来构建应用程序的一些就可以了。现在,我要测试的这款 -

I want to use AWS products to build some application on it. For now, i want to test this -

1)创建托管在AWS的网页有一个简单的文本框,一个提交按钮,用于检查一个数是否为素数。 2)编制在EC2上一个C ++程序来接受一些和回复,如果它是一个素数。

1) Create a webpage hosted at AWS with a simple text box and a submit button, for checking if a number is prime. 2) Compile a C++ program on EC2 to accept a number and reply if it is prime.

有人能列出参与做这个步骤? (上面的例子简单地反映实际的应用,我有想法,有一个HTTP前端和C ++后端)

Can someone list the steps involved in doing this? (The above example mirrors simplistically the actual application that i have in mind, with a http frontend and a c++ backend)

推荐答案

如果您使用默认的Linux AMI,你会给出一个标准的Apache安装准备好了。这听起来像您的应用程序的调用方式是请求 - 响应,所以至少要开始,你可以只使用CGI来获得Apache来运行你的应用程序。

If you use the default Linux AMI, you will gave a standard Apache installation ready to go. It sounds like the invocation style of your app is request-response, so at least to begin with, you could just use CGI to get Apache to run your app.

要做到这一点,你会做这样的事情:

To achieve this, you would do something like this:

  1. 与窗体创建一个静态的HTML页面和一个提交按钮,通过CGI传递表单数据到你的应用程序
  2. 在安装你的应用程序到一个合适的目录(见Apache的配置来了解详情)通过CGI运行它,并注意确保正确的权限设置
  3. 让您的应用程序解析CGI环境变量采集输入
  4. 执行所需要的处理
  5. 在生成的HTTP响应结果输出(上手,只需使用纯文本/)。

请注意,有很多安全问题需要记住在这里,所以它是非常重要的是由网络用户为逃避问题,缓冲区溢出等提供的所有数据进行严格的验证。

Please note that there are many security issues to keep in mind here, so it is very important to perform strict validation on all data supplied by the web user for escaping issues, buffer overflows and so on.

如果您不熟悉上述情况,你需要阅读上的HTML表单,Apache的配置和基本的HTTP标头在最小。有很多的例子在那里,一些伟大的著作涵盖的话题。

If you aren't familiar with the above, you will need to read up on HTML forms, Apache configuration and basic HTTP headers at at minimum. There are plenty of examples out there, and some great books covering the topic.

要为此,各种库已开发,以促进此

To this end, various libraries have been developed to facilitate this:

也有许多其他的选择接口与Apache,如FastCGI的您的应用程序。

There are also many other options for interfacing your app with Apache, such as FastCGI.

这篇关于安装在Amazon EC2上测试应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆