简体   繁体   English

无法从本地网络上的 web 服务器访问 localhost

[英]Can't access localhost from a web server on my local network

This question will look like an essay because it is really weird (at least I can't see the logic on the problem.这个问题看起来像一篇文章,因为它真的很奇怪(至少我看不到这个问题的逻辑。

I am running two computers right now, one Toshiba NB510 which I want to use as a web server, with XAMPP and controlled with VNC from my second (and main) computer, an MSI 2qe (with also XAMPP installed). I am running two computers right now, one Toshiba NB510 which I want to use as a web server, with XAMPP and controlled with VNC from my second (and main) computer, an MSI 2qe (with also XAMPP installed).

The problem is that when I run Apache and MySQL from the MSI, I can write to my local IP to access from any device on my LAN to access "localhost" (until this all ok) but when I run XAMPP on the web server I can only access to localhost from that computer (using the local IP). The problem is that when I run Apache and MySQL from the MSI, I can write to my local IP to access from any device on my LAN to access "localhost" (until this all ok) but when I run XAMPP on the web server I只能从该计算机访问 localhost(使用本地 IP)。

Maybe it's a problem on my network?可能是我的网络有问题?

Here is a map of the network (done in paint sorry)这是网络的map(在油漆中完成抱歉)

在此处输入图像描述

You have two pcs.你有两台电脑。 Both with your servers running, but you can't access one of them correct?两者都在运行您的服务器,但您无法正确访问其中一个?

The usual troubleshooting for this is:通常的故障排除是:

  • first to check if you can ping it (to make sure it's on the network)首先检查您是否可以ping它(以确保它在网络上)

  • second to check if the ports you will use are open (tipically, 80 for web)其次检查您将使用的端口是否打开(通常为 80 用于网络)

  • finally to check if your server is set to accept incoming connection (Apache config)最后检查您的服务器是否设置为接受传入连接(Apache config)

EDIT:编辑:

I've seen your picture now.我现在看到你的照片了。 If as you said, both PCs can "see" each other (as in, Toshiba can ping and access MSI, and MSI can ping toshiba but not access it) check if your commumator is the source of the problem如果如您所说,两台 PC 可以“看到”对方(例如,东芝可以 ping 并访问 MSI,而 MSI 可以 ping 东芝但不能访问它)检查您的通信器是否是问题的根源

All server have their own port number, like mysql have 80. Find your server portnumber and type in browser localhost/(portnumber)/phpmyadmin/所有服务器都有自己的端口号,例如 mysql 有 80。找到您的服务器端口号并在浏览器中输入localhost/(portnumber)/phpmyadmin/

All solved, I installed windows 10 x64 instead of x32 and reinstalled xampp and all works全部解决,我安装了 windows 10 x64 而不是 x32 并重新安装了 xampp 并且一切正常

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

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