如何从同一网络中的另一台计算机访问Laragon Localhost

发布于 2025-01-31 07:40:29 字数 773 浏览 4 评论 0原文

我想查看我从另一台连接到同一网络的计算机中安装在本地中的Laravel项目。我使用Laragon。

我不想用PHP Artisan发球来做到这一点。

我想设置一个新的虚拟主机。

我该怎么做。

我已经研究了很多。我在我发现的结果中更改了http-vhosts.confhosts文件。但这无效。

这些文件的原始内容如下。

http-vhosts.conf:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "${SRVROOT}/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

主机:

127.0.0.1      appik.test 

I want to view my Laravel project installed in local from another computer connected to the same network.I use laragon.

I don't want to do this with php artisan serve.

I want to set up a new virtual host.

How can I do it.

I have researched this subject a lot. I made changes to the http-vhosts.conf and hosts files in the results I found. but it didn't work.

The originals of these files are below.

http-vhosts.conf:

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "${SRVROOT}/docs/dummy-host2.example.com"
ServerName dummy-host2.example.com
ErrorLog "logs/dummy-host2.example.com-error.log"
CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>

hosts:

127.0.0.1      appik.test 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

沉默的熊 2025-02-07 07:40:29

您无法从不同的设备访问本地主机。您需要打开指向机器的端口。

有一种简单的方法,您可以使用ngrok( https://ngrok.com/ ),创建隧道和隧道为您的http:// localhost分配一个实时链接

,然后您可以访问您的项目,例如

httpp ://ngrok-link.com/your-project/public

You can't access your localhost from different device. You need to open a port which point to your machine.

There is a simple way, you can use ngrok (https://ngrok.com/) which creates a tunnel and assign you a live link for your http://localhost

you can then access your project something like this

http://ngrok-link.com/your-project/public

转身以后 2025-02-07 07:40:29

Laragon 6.0上的一些问题
我可以在LAN上的另一个客户端访问,但是现在在www/index.php上显示一个laragon根页面,

我的laravel项目在文件夹www/donate上

Some problem on Laragon 6.0
I can access on another client on LAN but now showing a laragon root page on www/index.php

my laravel project on folder www/donate

鸩远一方 2025-02-07 07:40:29

我假设您想从同一网络上的另一台计算机上访问计算机。从Machine B中,您需要在机器A上查看一个站点。

假设:LARAGRE安装在MachineA上。机器A具有主机名称-A。

在机器A上,为该站点创建文件夹,然后重新启动Laragon。这将创建虚拟主机配置文件。重新启动laragon后,从右键单击&gt;打开SiteName.conf文件。 Apache&gt;启用站点的&gt; Sitename.conf。将端口80更改为首选未使用的端口,例如8095。So&lt; VirtualHost *:80&gt; 更改为&lt; virtualHost *:8095&gt; 。我仍在尝试找出HTTPS模式,但让我们来管理。

另外,从右键单击&gt; Apache&gt; http.conf。搜索收听80。在其下方添加第二个听8095 。我知道您可以在所有端口上收听,但这是一个安全问题。

重新启动apache。

从机器B中,尝试从浏览器打开http:// machine-a:8095。它应该起作用。

I am assuming you want to access your machine from another machine on the same network. From Machine B, you want to view a site on Machine A.

Assumptions: Laragon is installed on Machine A. Machine A has a hostname machine-a.

On Machine A, create the folder for the site and restart Laragon. This creates the virtual host profile. After restarting Laragon, open the sitename.conf file from Right Click > Apache > sites-enabled > sitename.conf. Change port 80 to a preferred unused port e.g 8095. So <VirtualHost *:80> changes to <VirtualHost *:8095>. I am still trying to figure out the https mode, but let's manage this.

Also, open http.conf from Right Click > Apache > http.conf. Search for Listen 80. Add a second Listen 8095 below it. I know you can listen on all port but that is a security concern.

Restart Apache.

From Machine B, try to open http://machine-a:8095 from your browser. It should work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文