我无法从我的Andr​​oid设备访问我的Apache服务器 [英] I can't access my Apache server from my Android device

查看:148
本文介绍了我无法从我的Andr​​oid设备访问我的Apache服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我第二次要求计算器上的问题。我在我的Andr​​oid手机上尝试访问到我设置了我的台式电脑在我的本地Apache服务器(IP与即开始。192.168.1。*的 的**)。但不知何故,不允许我在所有访问服务器! :(奇怪的是,有时它确实让我访问服务器哈哈!但它只是一出20对每个尝试。此外,它不允许我去访问服务器上的我的笔记本电脑无论是..我真的需要一些帮助家伙..当我在我的本地台式电脑中使用模拟器的工作是工作的罚款。我已经做了相当多的研究这件事,但是我没能找到任何解决方案。

it is my second time asking a question on stackoverflow. I'm trying to access to my local apache server that I've set up on my desktop computer (ip that starts with ie. 192.168.1*.**)on my android phone. but somehow it does not allow me to access to the server at all! :( strangely, sometimes it does allow me to access to the server lol! but it's only one out of 20 for each attempts. Also, it doesn't allow me to access to the server on my laptop either.. I really need some help guys.. it was working fine when i was working locally within my desktop pc by using emulator. I've done quite a lot of research about it but i wasn't able to find any solutions.

感谢你们

=====================================

=====================================

ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();

HttpClient client = new DefaultHttpClient(setHttpParams());
HttpPost request = new HttpPost(PATH + FILENAME);

if (json != null) {

        request.setEntity(new ByteArrayEntity(json.toString().getBytes("UTF8")));
        request.setHeader("json", json.toString());

} else {


        request.setEntity(new UrlEncodedFormEntity(nameValuePairs));
}



HttpResponse response = client.execute(request);

所以这是code,当它试图执行请求时发生错误。请求包括Apache服务器的IP路径(192.168。 ** )+ FILE_NAME(即的index.php)。我知道为什么它会导致错误,因为我不能访问到192.168。 *的 服务器和读取所需的文件。我需要帮助与此= 的(

so that is the code, error occurs when it tries to execute the request. request includes the apache server ip PATH (192.168.**) + FILE_NAME(ie. index.php). I know why it causes the error because i cannot access to the 192.168.* server and read the desired file. I need help with this =(

推荐答案

有关运行Web服务器计算机:

For the computer running the webserver:


  • 确保您的个人防火墙规则并不preventing访问Web服务器。

  • 为您的手机在服务器需要通过Web访问的空气访问Web服务器。这可能是因为你的机器是一个企业防火墙是从外部来源给它preventing访问后面。

  • 如果您只是想从手机访问,确保两个Web服务器和电话都是同一个网络,即它们具有相同的地址范围的IP地址上。你可以做你的机器连接到无线接入点(通过以太网或无线),并确保您的电话连接到同一个无线AP。

另外我刚刚看了一遍你的问题,并注意到行

Moreover I just read your question again and noticed the line

它不允许访问到我的笔记本电脑,服务器或者

it does not allow access to to the server on my laptop either

如果你不能在本地访问它是在捉迷藏机器上的Web服务器,然后有什么不对你的Web服务器配置的方式。
因此,首先要确保您的Web服务器正在运行并正确配置。打开浏览器并转到的http://本地主机 HTTP://192.168.xx 如果一切配置正确你将能够访问你的网页。

If you cannot access the webserver locally on the machine it is runnning on then there is something wrong in the way you configured your web server. So first make sure that your web server is running and configured properly. Open a browser and go to http://localhost or http://192.168.x.x if everything is configured right you will be able to access your web pages.

基本上,这是网络101,如果它仍然是给你的问题​​后的一些细节,例如web服务器是什么,有什么端口等。

Basically this is networking 101, if it is still giving you problem post some details such as what webserver, what port etc.

如果你是新的网络概念,不知道如何配置Web服务器说的Apache 只是谷歌如何配置Apache或使用一种叫做 XAMPP 这是一个包含Apache,MySQL和PHP开发人员友好的捆绑,FileZilla中等等。注意,XAMPP永远不会在生产环境中使用它的默认配置做的方式,使其更容易安装,配置和新的用户运行上面提到的包。

If you are new to networking concepts and don't know how to configure a web server say Apache just Google how to configure Apache or use something called XAMPP which is a developer friendly bundle containing Apache, MySQL, PHP, FileZilla etc. Note that XAMPP shall never be used in a production environment as its default configuration is done in a way to make it easier to install, configure and run above mentioned packages for new users.

这篇关于我无法从我的Andr​​oid设备访问我的Apache服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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