需要iOS应用程序的基本服务器后端 [英] Need a basic server backend for iOS app

查看:182
本文介绍了需要iOS应用程序的基本服务器后端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发iOS应用程序,并且已达到我需要实现服务器后端以支持核心功能的程度。从本质上讲,该应用程序处理需要上传到服务器的文本字符串。收到字符串后,我需要服务器用它执行一些任务,然后将任务结果(也是基于字符串的)发送回iPhone应用程序。

I'm currently developing an iOS app and have reached the point where I need to implement a server backend in order to support the core functionality. Essentially, the app deals with text strings that need to be uploaded to a server. After receiving the strings, I need the server to perform some tasks with it and then send the result of the tasks (also string-based) back to the iPhone app.

我没有服务器经验,需要一些建议,我应该从哪里开始。为了避免财务风险,我试图避免在初始启动时进行专用托管,因此我想知道在家中服务器托管是否可以用于启动,然后,如果服务器端组件开发得当,如果应用程序的使用保证,只需将软件转移到更永久的专用解决方案。

I have zero server experience and am need of some advisement as to where I should begin with this. In order to avoid financial risk, I am attempting to avoid dedicated hosting at initial launch, and so I was wondering if at-home server hosting would be at all possible for the launch and then, if the server-side component was developed appropriately, simply transfer the software to a more permanent dedicated solution if the app's usage warranted.

我做了一些研究,我发现亚马逊S3是一款流行的iPhone应用服务器解决方案,因为它与流行的包装器ASIHTTPRequest集成。然而,这似乎是一个更永久的托管解决方案。与此同时,对于较小规模的本地应用程序测试,推荐的服务器平台是什么?是什么东西沿着ubuntu安装了LAMP?如果是这样,在本地平台上开发的脚本(我假设在PHP中)是否可以直接转移到更大规模的服务器?

I have done some research and I have found Amazon S3 to be a popular iPhone app server solution due to its integration with the also popular wrapper, ASIHTTPRequest. This seems to be a more permanent hosting solution, however. In the meantime, for local app testing on a smaller scale, what would the recommended server platform be? Something along the lines of ubuntu with LAMP installed? If so, would the scripts developed on the local platform (I'm assuming in PHP) be directly transferrable to a larger-scale server for the most part?

推荐答案

我会选择共享主机: http://webfaction.com http://linode.com 。您的共享主机无法容忍这么多流量,您不太可能容忍它。我毫不费力地在Webfaction上运行了一些高流量的应用程序。

I would go with shared hosting: http://webfaction.com or http://linode.com. It's unlikely that you're going to have so much traffic that your shared host will not be able to tolerate it. I run a few high traffic apps on Webfaction without difficulty.

根据您对应用功能的描述,它似乎并不太复杂,并且不难扩展。

From your description of the functionality in your app, it doesn't seem too complicated, and wouldn't be difficult to scale.

OS X上的PHP开发环境:

OS X已经安装了PHP和Apache。它只需要启用,此页面描述了实现它的过程:

OS X has PHP and Apache already installed. It just needs to be enabled, this page describes the process to get it going:

http://foundationphp.com/tutorials/php_leopard.php

或者你可以安装像MAMP这样的包( http://www.mamp.info/en/index.html ),它将为您提供有一个完整的堆栈。 (这也是我的建议。)

Alternatively you can install a package like MAMP ( http://www.mamp.info/en/index.html ), which will provide you with a full stack. (And is what I would recommend.)

代码:

As对于代码,您很可能使用ASIHttpRequest对服务器上的URI执行POST请求。 URI上的脚本将连接到数据库,存储字符串,然后断开与数据库的连接。

As for the code, you'll more than likely use ASIHttpRequest to do a POST request to URI on your server. The script at the URI will connect to the database, store the string, and then disconnect from the database.

少于10行代码。

这篇关于需要iOS应用程序的基本服务器后端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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