无法从我的本地网络访问 XAMPP (1.7.3)

发布于 2024-09-07 16:09:56 字数 411 浏览 2 评论 0原文

我在 Windows 7 上运行 XAMPP 1.7.3。我的问题是,当我尝试从另一台计算机访问我的服务器 (localhost) 时,服务器没有响应。例如,[在我的计算机上]当我输入“http://localhost”时,我的页面就会出现。但是,当我尝试从计算机访问“http://192.168.0.102”时,没有任何反应。当我输入外部 IP 时,没有任何显示,但是当将 HTTPS 添加到外部 IP 时,会显示我的 Linksys WRT54GS 配置页面,要求输入密码。我已经尝试过端口转发和本地“静态IP”,但没有运气,除了我的本地IP从未改变。谁能帮助我吗?

I am running XAMPP 1.7.3 on windows 7. My problem is that when I try to access my server (localhost) from another computer, the server does not respond. For example, [on my computer] when I type in 'http://localhost', my pages come up. However, when I try accessing 'http://192.168.0.102' from my computer, nothing happens. When I type in my external IP, nothing shows up, but when add HTTPS to the external IP, my Linksys WRT54GS config page shows up, asking for a password. I have already tried port forwarding and a local "static IP", and no luck, other than my local IP never changing. Can anyone help me?

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

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

发布评论

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

评论(1

伤痕我心 2024-09-14 16:09:56

以下是我配置 XAMPP 安装的方式。也许它对你有用。

  • 打开 C:\xampp\apache\conf\extra\httpd-vhosts.conf

  • 为每个添加一个 VirtualHost 块您正在运行的站点:

Apache config

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot C:/path/to/website/files
    ServerName exampledomain.dev

    <Directory "C:/path/to/website/files">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
  • 向您的主机添加一行

    127.0.0.1 exampledomain.dev

  • 在连接计算机的主机文件上:

    192.168.0.102 exampledomain.dev

您可以使用 ctrl+r 并运行
轻松访问您的主机文件
记事本%SYSTEMROOT%\system32\drivers\etc\hosts

Here's how I have my XAMPP installation configured. Maybe it will work for you.

  • Open C:\xampp\apache\conf\extra\httpd-vhosts.conf

  • Add a VirtualHost block for each site you are running:

Apache config

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot C:/path/to/website/files
    ServerName exampledomain.dev

    <Directory "C:/path/to/website/files">
        Options Indexes FollowSymLinks Includes ExecCGI
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
  • Add a line to your hosts

    127.0.0.1 exampledomain.dev

  • On the connecting computer's host file:

    192.168.0.102 exampledomain.dev

You can easily access your hosts file by using ctrl+r and running
notepad %SYSTEMROOT%\system32\drivers\etc\hosts

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