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

时间:2010-06-30 17:24:56

标签: xampp port ip apache forward

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

1 个答案:

答案 0 :(得分:1)

以下是我如何配置XAMPP安装的方法。也许它会对你有用。

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

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

Apache配置

<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并运行
来轻松访问您的主机文件 notepad %SYSTEMROOT%\system32\drivers\etc\hosts

相关问题