【问题标题】:Vagrant Share - Laravel Homestead, UbuntuVagrant Share - Laravel Homestead,Ubuntu
【发布时间】:2019-08-02 03:34:00
【问题描述】:

当我运行vagrant share id-goes-here --http 80 时,终端卡住并且没有显示 URL:

==> homestead-7: Detecting network information for machine...
    homestead-7: Local machine address: 127.0.0.1
    homestead-7:  
    homestead-7: Note: With the local address (127.0.0.1), Vagrant Share can only
    homestead-7: share any ports you have forwarded. Assign an IP or address to your
    homestead-7: machine to expose all TCP ports. Consult the documentation
    homestead-7: for your provider ('virtualbox') for more information.
    homestead-7:  
    homestead-7: Local HTTP port: 80
    homestead-7: Local HTTPS port: disabled
    homestead-7: Port: 2222
    homestead-7: Port: 27017
    homestead-7: Port: 33060
    homestead-7: Port: 4040
    homestead-7: Port: 44300
    homestead-7: Port: 54320
    homestead-7: Port: 8000
    homestead-7: Port: 8025
==> homestead-7: Creating Vagrant Share session...

但是当我转到https://dashboard.ngrok.com/status 时,已经为我创建了一个 URL。例如http://eaeefc3d.ngrok.io

但是,当我转到此 URL 时,我会看到默认的 Apache 欢迎页面。

我也尝试过 ssh 进入宅基地并运行命令: serve eaeefc3d.ngrok.io ~/Code/myapp/public/(正如我在此线程中读到 Mike Miller 的回答:vagrant share with laravel homestead)这给了我输出:

dos2unix: converting file /vagrant/scripts/serve-laravel.sh to Unix format... 但我仍然看到 Apache 欢迎页面。

有什么想法吗?

【问题讨论】:

    标签: laravel homestead ngrok vagrant-share


    【解决方案1】:

    感谢@MikeMiller 在this thread 中的评论为我指明了正确的方向

    这是我让 ngrok 工作的方法:

    1. ssh 进入宅基地,即。 homestead uphomestead ssh
    2. cd 到项目目录,即。 cd Code/foodonsale/
    3. 运行 ngrok 并将 -host-header 设置为项目名称: ngrok http -host-header=rewrite myproject.test:80
    4. 您将获得如下输出: 来自@inconshreveable的ngrok

      Session Status         online                                                           
      Session Expires        7 hours, 59 minutes                                               
      Update                 update available (version 2.3.18, Ctrl-U to update)              
      Version                2.2.8                                                            
      Region                 United States (us)                                               
      Web Interface          http://192.168.10.10:4040                                        
      Forwarding             http://0b7f6aa0.ngrok.io -> myproject.test:80                   
      Forwarding             https://0b7f6aa0.ngrok.io -> myproject.test:80   
      
    5. 转到Web Interface 指定的URL。您可以在此处监控应用程序的请求。
    6. 单击httphttps 选项可重定向到您的应用程序的实时公共版本。

    有用的链接: - ngrok DOC

    【讨论】:

      猜你喜欢
      • 2017-04-25
      • 2020-02-22
      • 1970-01-01
      • 2017-05-31
      • 2015-02-27
      • 2017-05-05
      • 2016-07-06
      • 1970-01-01
      • 2020-09-14
      相关资源
      最近更新 更多