简体   繁体   English

如何在手机上访问Xampp虚拟主机

[英]how to access xampp virtual host on mobile

as i am a new in developing,,therefore i want to know that how can ai access virtual host of xampp while i have accessed xampp localhost on my mobile deveice(I-phone)..And I have created virtual host in 作为我的新开发人员,因此我想知道当我在移动设备(I-phone)上访问xampp localhost时,如何访问xampp的虚拟主机。

C:\\xampp\\apache\\conf\\extra/httpd-vhosts.conf file as follow: C:\\xampp\\apache\\conf\\extra/httpd-vhosts.conf文件如下:

<VirtualHost yasir.com:80>
  ServerAdmin postmaster@dummy-host2.localhost
  DocumentRoot "C:/xampp/htdocs/yasir"
  ServerName yasir.com
  ServerAlias www.yasir.com
  ErrorLog "logs/yasir.com-error_log"
  CustomLog "logs/yasir.com-error_log" combined
</VirtualHost>

and also added the line 并添加了一行

127.0.0.1    yasir.com

in

C:\Windows\System32\drivers\etc\hosts

I suspect you'll find ngrok to be the easiest solution. 我怀疑您会发现ngrok是最简单的解决方案。

Modifying your local host file will only affect that single PC, you would need to also modify the host file on your mobile (which may not be possible) and specify the external IP of your PC rather than 127.0.0.1 for what you've described to work. 修改本地主机文件仅会影响该单台PC,您还需要修改移动设备上的主机文件(这可能是不可能的),并指定PC的外部IP而不是127.0.0.1的描述。上班。

Change <VirtualHost yasir.com:80> back to <VirtualHost *:80> first though and specify your ngrok domain as a ServerAlias . 但是,首先将<VirtualHost yasir.com:80>更改回<VirtualHost *:80>并将您的ngrok域指定为ServerAlias

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

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