首页 文章

如何从本地网络中的另一台计算机访问localhost网站

提问于
浏览
-1

在修改了文件( httpd-xamp.confhttpd-vhosts.conf )后,我无法在本地主机或其他计算机上访问我的网站 . 在浏览器地址栏中输入: mydomain.local

但是当我们键入“localhost / phpmyadmin /”时它只适用于localhost计算机

当我'd like to allow another computer in the same LAN to access the website. I'已配置其他计算机主机文件包含行: 192.168.1.180 mydomain.loca l其中192.168.1.180是XAMPP计算机的IP地址 . 但在其他计算机浏览器上键入http://mydomain.local后,按Enter键后,地址变为:http://mydomain.local/dashboard,并显示消息"Object not found & error 404" .

到目前为止,我已经这样做了:更改了c:\ xampp \ apache \ conf \ extra \ httpd-xamp.conf文件以包含此内容

顺序拒绝,允许所有允许拒绝来自:: 1 127.0.0.0/8 192.168.1.180 ErrorDocument 403 /error/HTTP_XAMPP_FORBIDDEN.html.var

在我的XAMPP计算机上,我在c:\ xampp \ apache \ conf \ extra \ httpd-vhosts.conf中进行了以下配置:

NameVirtualHost *:80 ServerAdmin postmaster@dummy-host2.localhost DocumentRoot“C:/ xampp / htdocs / myphpapp”ServerName mydomain.local ServerAlias mydomain.local ErrorLog“logs / mydomain.local-error.log”CustomLog“logs / mydomain.local -access.log“合并

选项索引FollowSymLinks包括ExecCGI AllowOverride All Order允许,拒绝所有允许

1 回答

  • 0

    重定向是否适合您的脚本,或者您只是重定向到路由器管理面板?

    顺便说一句,如果你想轻松地完成所有工作,只需看看Ngrok,CLI中的一个小行将解决您的问题,它也将使其在您的本地网络之外可用!

相关问题