[英]Laravel - How to share application to another stations
I developed an application with laravel and i put it in a local server and i need that other computer access it. 我用laravel开发了一个应用程序,并将其放在本地服务器中,我需要其他计算机来访问它。
I think that have 2 solutions: 我认为有2个解决方案:
First: Access to laravel server (port 8000) Second: Put the project in xampp 第一:访问laravel服务器(端口8000) 第二:将项目放入xampp
What is the best solution? 最好的解决方案是什么?
With the first option i can't access and with xampp it doesn't access well to routes and doesn't load the css and js files. 使用第一个选项,我无法访问,使用xampp,它不能很好地访问路由,也无法加载css和js文件。 If i access to root folder it list the project folders and i have to go to public folder but doesn't load stylesheet files.
如果我访问根文件夹,它将列出项目文件夹,而我必须转到公用文件夹,但不会加载样式表文件。
How can i do that? 我怎样才能做到这一点?
UPDATE: 更新:
I did this steps and this not work yet. 我做了这个步骤,这还行不通。
In httpd.conf
enable this line Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
在
httpd.conf
启用此行Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
Next i add a host in in hosts file: 接下来,我在主机文件中添加主机:
127.0.0.1 arquivo.localhost
Next i'm going to httpd-vhosts.conf
and add this: 接下来,我要转到
httpd-vhosts.conf
并添加以下内容:
<VirtualHost *:8888>
DocumentRoot "/Applications/MAMP/htdocs/arquivo/public"
ServerAdmin arquivo.localhost
<Directory "/Applications/MAMP/htdocs/arquivo/public">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Next i restart the apache and when i try to access to http://arquivo.localhost
this give me This site can't be reached
接下来,我重新启动apache,当我尝试访问
http://arquivo.localhost
这给了我This site can't be reached
访问的机会
What i'm doing wrong? 我做错了什么?
Thank you 谢谢
create virtualhost under xampp/apache/conf/extra/httpd-vhost.conf like this 像这样在xampp / apache / conf / extra / httpd-vhost.conf下创建virtualhost
<VirtualHost *:80>
ServerAdmin webmaster@localhost.com
DocumentRoot "C:/xampp/htdocs/laravel/public"
ServerName laravel.localhost
ErrorLog "logs/laravel-error.log"
CustomLog "logs/laravel-access.log" common
</VirtualHost>
and access with http://laravel.localhost/ 并使用http://laravel.localhost/访问
If its working fine on your localhost, other person can access your site using your Ip
address, provided you both are on same local network. 如果它在您的本地主机上运行正常,那么只要您俩都在同一本地网络上,其他人就可以使用您的
Ip
地址访问您的站点。
For more you can see this reference : Accessing localhost (xampp) from another computer over LAN network - how to? 有关更多信息,请参见以下参考: 通过LAN网络从另一台计算机访问localhost(xampp)-如何?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.