使用域名从其他计算机访问htdocs

时间:2018-11-09 17:20:25

标签: xampp hosting

我想在本地Windows 7系统上托管一个网站。

为此,我正在使用“ xampp-win32-7.2.5-0-VC15”

首先,我在此路径C:\xampp\htdocs\public下创建了一个目录

我使用以下标记创建了文件index.html

<html>
<header><title>Home Website</title></header>
<body>
test
</body>
</html>

然后:由于我没有静态IP,并且我不想将服务用作dydns或noip,所以我使用静态本地IP 192.168.1.10转发了rooter上的端口888

然后:在httpd.conf文件中,我将默认值更改为:

-ServerName localhost:888
-Listen 888 ( i even tried listen 127.0.0.1:888)

然后使用“ httpd-vhosts.conf”文件执行操作:

<VirtualHost *:888>
 DocumentRoot "C:/xampp/htdocs/public"
 ServerName www.mywebsitetesttt.com
 ServerAlias mywebsitetesttt.com
 <Directory "C:/xampp/htdocs/public">
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

然后:在win7主机文件中,我添加了以下几行:

127.0.0.1 mywebsitetesttt.com  
127.0.0.1 www.mywebsitetesttt.com

现在:我的浏览器可以正确显示网址为

的网站
www.mywebsitetesttt.com:888

但不希望通过家庭连接以外的其他计算机访问该站点,并显示此消息

  

无法找到服务器www.mywebsitetesttt.com的IP地址

我在做什么错了?

0 个答案:

没有答案
相关问题