使 WAMP www 在本地网络上可用

发布于 2024-11-01 04:11:57 字数 519 浏览 1 评论 0原文

我知道有类似的问题,但没有一个能解决我的具体情况。

我有一个用于开发一些网站的 WAMP 服务器设置,它运行得很好。我需要它可以通过无线路由器供本地网络上的另一台计算机使用。另一台电脑实际上是Mac,我只需要能够通过浏览器查看开发站点(不需要访问phpmyadmin或mySQL)。

我可以使用我的 Windows 计算机的 IP 通过浏览器访问运行 WAMP 的本地主机(显示默认的 WAMP 页面,其中包含指向站点项目的链接)。显然,单击链接会导致找不到页面,因为 URL 是相对于 localhost 的,但即使我显式输入带有 IP 的 URL (http://192.168.2.1/myproject) 我还是一无所获。 (即使我如图所示输入,网址也会重定向到 localhost/myproject)

我的主机有一个动态 IP,但由于它硬连线到调制解调器和路由器,因此 IP 不会更改,除非我重置路由器/调制解调器。不过,我看不出这是问题所在,因为我可以使用 Mac 的 IP 访问默认的 WAMP 页面。

有什么想法吗?

I know there are questions similar to this, but none address my specific situation.

I have a WAMP server setup for developing some websites, and it's running great. I need it to be available to another computer on my local network via a wireless router. The other computer is actually a Mac, and I only need to be able to view the development sites through a browser (do not need to access phpmyadmin or mySQL).

I am able to access the localhost on which WAMP is running through the browser (the default WAMP page is displayed with links to the site projects) using the IP of my windows machine. Obviously clicking on the links would result in page not found since the URL is relative to localhost, but even if I explicitly type in the url with the IP (http://192.168.2.1/myproject) i still get nothing. (and the url redirects to localhost/myproject even if I type it in as shown)

My host machine has a dynamic IP, but since it is hard-wired to the modem and router the IP does not change unless I reset the router/modem. I can't see this being the problem though since I am able to access the default WAMP page using the IP from the Mac.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

多孤肩上扛 2024-11-08 04:11:57

默认情况下,httpd.conf 有以下设置。

 Deny from all

您必须进行以下更改。

 Allow from all

并使WAMP成为在线。

您可以通过网络中的 IP 地址或计算机名称访问您的站点。

By default httpd.conf have the following settings.

 Deny from all

you have to make the below mentioned changes.

 Allow from all

and make WAMP as a online.

You can access you site by IP address or Computer name from Network.

本王不退位尔等都是臣 2024-11-08 04:11:57

我的 WordPress 网站也遇到了同样的问题。我的目标是通过 LAN 上另一个 PC/Linux 工作站的浏览器查看开发网站。以下步骤为我解决了这个问题:

  1. 转到 WordPress 设置 >一般> WordPress 地址 (URL) 和站点地址 (URL)

  2. 将运行 WAMP 服务器的本地 PC 的本地 IP 地址添加到字段中并保存设置。 (例如http://192.168.0.101/wordpress;在DOS命令窗口中使用ipconfig获取本地主机的IP地址)。

  3. 从系统托盘上的 WAMP 服务器菜单“Put Online”。现在,LAN 中的任何其他设备都可以在浏览器上使用 IP 地址 (http://192.168.0.106/wordpress) 查看网站,并且链接现在应该可以工作。

I had the same problem with my Wordpress site. My aim was to see the developmental website from a browser in another PC/Linux Workstation on the LAN. Following steps resolved the issue for me:

  1. Go to WordPress Settings > General > WordPress Address (URL) and Site Address (URL)

  2. Add local IP address of the localhost PC where WAMP server is running to the fields and save the settings. (e.g. http:// 192.168.0.101/wordpress; Use ipconfig in a DOS command window to get IP address of the localhost).

  3. From the WAMP server menu on system tray "Put Online". Now any other devices in the LAN can view the website using the IP address on a browser (http:// 192.168.0.106/wordpress) and the links should be working now.

余厌 2024-11-08 04:11:57

尝试这些建议。我的建议是检查 Apache 是否仅绑定到 127.0.0.1 (localhost),如果不存在则添加 192.168.2.1 映射。添加后不要忘记重新启动 Apache。

Try these recommendations. My suggestion would be to check if Apache is bind only to 127.0.0.1 (localhost) and add 192.168.2.1 mapping if it is not there. Don't forget to restart Apache after adding it.

傲世九天 2024-11-08 04:11:57

如果您在 Windows 上使用 wamp,请将 Windows 防火墙设置更改为关闭模式,然后重新启动服务器并检查。

控制面板-->系统和安全-->Windows 防火墙-->关闭 Windows 防火墙

只需进行上述更改即可看到效果。

干杯
阿米特

If you are using wamp on windows than please change your windows firewall settings to OFF mode and restart your server and check.

Control Panel-->System and Security-->Windows Firewall-->Turn off windows Firewall

Just make the above change and see this will work.

cheers
Amit

晨与橙与城 2024-11-08 04:11:57

现在我已经弄清楚了,这是有道理的。

重定向到 localhost 实际上是由构建站点的 CMS 的配置文件引起的(因此它会显示主 WAMP 页面,但无法加载项目站点)。

Makes sense now that I have figured it out.

The redirect to localhost was actually caused by the configuration file for the CMS that the site was built on (thus why it would bring up the main WAMP page, but not be able to load the project site).

复古式 2024-11-08 04:11:57

首先,将您的 wamp 放到仪表板上。稍后,如果 httpd.conf 文件中有一个设置 Listen 80(如果与此不同)。

将其更改为Listen 80,然后禁用防火墙并重新启动 Wamp 所有服务。

First of all put online your wamp on your dashboard. Later on if there is a setting in httpd.conf file Listen 80 if this is different than that.

Change it to Listen 80 then disable your firewall restart Wamp all services.

耳根太软 2024-11-08 04:11:57

首先,将您的 wamp 放到仪表板上。然后关闭防火墙稍后,如果httpd.conf文件中有一个设置Listen 127.0.0.80(如果这与此不同)。

将其更改为 Listen 127.0.0.80 以允许所有重新启动 Wamp 所有服务。

First of all put online your wamp on your dashboard. And then put off your firewall Later on if there is a setting in httpd.conf file Listen 127.0.0.80 if this is different than that.

Change it to Listen 127.0.0.80 to Allow for all restart Wamp all services.

爱,才寂寞 2024-11-08 04:11:57

您可以尝试将服务器的主机名添加到 Mac 上的主机文件中。然后您将使用有效的主机名访问 HTTP 服务器。

You could try adding the hostname of the server to the hosts file on the Mac. Then you're hitting the HTTP server using a valid hostname.

此岸叶落 2024-11-08 04:11:57

我认为您使用了错误的 IP 地址,因为大多数路由器本身使用 192.168.1.1。
这就是为什么您无法查看任何内容,即您的计算机具有不同的 IP 地址。

要解决这个问题,首先你需要知道你的计算机的IP地址
我窗
转到命令
并输入 ipconfig
在那里您可以看到您的计算机的 IPv4 局域网 IP 地址

使用此 IP 地址连接到 wamp 服务器。

希望这对您有帮助

I think you are using wrong ip address as most of router uses 192.168.1.1 for itself.
Thats why you are not able to view anything i.e your computer has different ip address.

To solve it, first you need to know ip address of your ow computer
I window
go to cmd
and type ipconfig
there you can see your computer lan ip address in IPv4

Use this ipaddress to connect to wamp server.

Hope this help you

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文