从本地xampp服务器移至在线服务器 [英] move from local xampp server to online server

查看:106
本文介绍了从本地xampp服务器移至在线服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个android应用程序,为了进行开发,我使用了本地XAMPP服务器。在服务器端,我使用mysql db和一些包含查询的php文件。在android方面,我使用HttpURLConnection,如下所示。

  url = new URL(AppHelper.SERVER_URL + phpFile); 
connection =(HttpURLConnection)url.openConnection();
connection.setDoOutput(true);
connection.setRequestProperty( Content-Type, application / x-www-form-urlencoded);
connection.setRequestMethod( POST);

request = new OutputStreamWriter(connection.getOutputStream());
request.write(参数);
request.flush();
request.close();
字符串行=;
InputStreamReader isr = new InputStreamReader(connection.getInputStream());
BufferedReader reader = new BufferedReader(isr);
StringBuilder sb = new StringBuilder();

现在我正处于一个阶段,我希望一些朋友试用该应用程序,所以我想设置托管的网络服务器。现在,我希望获得使用哪种服务的建议,以便我可以挽救和回收大多数代码和文件。请注意,我对此非常陌生,因此用户友好性是重要的标准。从本地服务器迁移到托管服务器解决方案的首选方式是什么?

解决方案

您可以使用 heroku 用于托管服务器端应用程序。您只需遵循来自heroku的教程,您就可以在几分钟内运行服务器端网络服务,并获取服务器端网络服务的URL。



此处是heroku的文档。



您也可以使用 openshift



对于我来说Heroku效果很好。 / p>

I wrote an android app and for development, I used a local XAMPP server. On the server side I use a mysql db and a few php files that contain the queries. On the android side, I use HttpURLConnection as shown below

url = new URL(AppHelper.SERVER_URL + phpFile);
connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
connection.setRequestMethod("POST");

request = new OutputStreamWriter(connection.getOutputStream());
request.write(parameters);
request.flush();
request.close();
String line = "";
InputStreamReader isr = new InputStreamReader(connection.getInputStream());
BufferedReader reader = new BufferedReader(isr);
StringBuilder sb = new StringBuilder();

Now I am at a stage where I would like some friends try out the app, so I want to set up a hosted webserver. Now I am hoping to get suggestions which service to use so that I can salvage and recycle most of my code and files. Please note that I am very unfamiliar with this, so user-friendliness is an important criteria. What are the preferred ways of moving from a local server to a hosted server solution?

解决方案

You can use heroku for hosting your serverside app. You Just only have to follow the tutorials from heroku and you will get your serverside webservice running in minutes and get URL for your server side webservice.

here is documentation for heroku.

You can also use openshift alternatively.

As for me Heroku works well.

这篇关于从本地xampp服务器移至在线服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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