简体   繁体   English

无法在我的 android 设备上访问 wamp 服务器(本地主机)

[英]Can't Access wamp server (localhost) on my android device

I am developing a responsive website and i want to check it on my android devices (mobile, tablet).我正在开发一个响应式网站,我想在我的 android 设备(手机、平板电脑)上检查它。 I am trying to access my server in the mobile browser's window using my ip (192.168.1.100).我正在尝试使用我的 ip (192.168.1.100) 在移动浏览器的窗口中访问我的服务器。 I have tried various methods discussed here like access-localhost-from-mobile-phone我尝试过这里讨论的各种方法,比如access-localhost-from-mobile-phone

I have also edited my apache config file as suggested but nothing working.我还按照建议编辑了我的 apache 配置文件,但没有任何效果。 No matter what i do, i get Forbidden, you don't have permission to access / on this server.无论我做什么,我都被禁止,您无权访问 / 在此服务器上。 I am running apache 2.4我正在运行 apache 2.4

I have also tried我也试过

<Directory />
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

then然后

<Directory />
Options FollowSymLinks
AllowOverride All
Require ip 255.255.255 (my subnet)
</Directory>

then然后

<Directory />
Options FollowSymLinks
AllowOverride All
Require ip 192.168.1.100(my IPv4)
</Directory>

Nothing works for me...没有什么对我有用...

You probably won't be able to access server via "192.168.1.100" even on your computer.即使在您的计算机上,您也可能无法通过“192.168.1.100”访问服务器。 Try confirming it by typing the ip address on your PC.尝试通过在您的 PC 上键入 IP 地址进行确认。 I was running into the same issue.我遇到了同样的问题。 Then found the solution.然后找到了解决办法。

Basicallly,基本上,

"Order Allow,Deny" would not work for apache 2.4 “订单允许,拒绝”不适用于 apache 2.4

just use Require all granted instead.只需使用Require all grant代替。

Thanks to: QuantumHive感谢: QuantumHive

In PLEX I was able to add an HTML to previous older versions.在 PLEX 中,我能够向以前的旧版本添加 HTML。 That bug was fixed and the new feature is that you must access the pages via 32400 hardcoded in the system.该错误已修复,新功能是您必须通过系统中的 32400 硬编码访问页面。 Well that did not work as human nature is to type movies.com and the page to open not movie.com:32400 to open it.好吧,因为人类的本性是输入movies.com和打开的页面而不是movie.com:32400来打开它。

I am using version 3.x apache and this issue still exists in the script that the server auto-creates with.我使用的是 3.x 版 apache,这个问题仍然存在于服务器自动创建的脚本中。 I spent lots of time looking for this GEM of a fix.我花了很多时间寻找这个 GEM 的修复程序。

On the LOCAL server, things worked great but from any other device on the network, I got the forbidden even with the firewall shut down, and "put online clicked"(wamp).在本地服务器上,一切正常,但是从网络上的任何其他设备上,即使防火墙关闭,我也被禁止,并“点击在线”(wamp)。 this simple change fixed it.这个简单的改变修复了它。 Why it is not fixed or even more heavily discussed I have no idea as it took me 3 hours to locate this and 2 minutes to fix the problem.为什么它没有被修复或者更深入地讨论我不知道,因为我花了 3 个小时找到这个问题,花了 2 分钟来解决这个问题。

Working now as expected, but not sure about this error (IP 192.168.3.111 for Servername plex is not valid in file c:/wamp64/bin/apache/apache2.4.39/conf/extra/httpd-vhosts.conf)现在按预期工作,但不确定此错误(服务器名称 plex 的 IP 192.168.3.111 在文件 c:/wamp64/bin/apache/apache2.4.39/conf/extra/httpd-vhosts.conf 中无效)

I had the same problem.我有同样的问题。 That's what I did: First, I wrote on my terminal: ifconfig |这就是我所做的:首先,我在我的终端上写道: ifconfig | grep "inet " | grep "inet" | grep -v 127.0.0.1 Then, I knew my ipV4. grep -v 127.0.0.1 然后,我知道我的 ipV4。 After that, I change my file.conf (on Mac OS is in /etc/apache2/users) and I deleted the line "Require ....".之后,我更改了我的 file.conf(在 Mac OS 上是在 /etc/apache2/users 中)并删除了“Require ....”行。

Now I have access from my android device to my ipV4 :)现在我可以从我的 android 设备访问我的 ipV4 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM