简体   繁体   English

如何从另一台计算机或设备访问XAMPP虚拟主机?

[英]How to access XAMPP virtual host from another computer or device?

I want to access my virtual host using my phone or my other computer the problem is I cannot access my site using the server name I can only access the site using the IP address of the server. 我想使用手机或其他计算机访问虚拟主机,问题是我无法使用服务器名称访问站点,只能使用服务器的IP地址访问站点。 I changed the port to 7777 我将端口更改为7777

When I tried www.tbs.com:7777/index.php I am getting " site cannot be reached " 当我尝试www.tbs.com:7777/index.php时,我得到“ 无法访问网站

Virtual Host Config: 虚拟主机配置:

<VirtualHost *:7777>
DocumentRoot "c:/xampp/htdocs/TBSApp"
ServerName www.tbs.com
ServerAlias tbs.com
ServerAdmin webmaster@localhost
<Directory "c:/xampp/htdocs/TBSApp">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    order allow,deny
    allow from all
</Directory>
</VirtualHost>

Host Config 主机配置

192.168.120.9    www.tbs.com

You need to use the ip address instead of the domain as it is a local host configuration. 您需要使用IP地址而不是域,因为它是本地主机配置。 To use the domain across all devices you need to setup a DNS server. 要在所有设备上使用域,您需要设置DNS服务器。

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

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