Using vagrant and homestead for multiple sites and per project installation

后端 未结 4 1946
星月不相逢
星月不相逢 2020-12-23 12:04

I have been using XAMPP for quite a time, and after discovering Laravel and finding out, that I quite like it, I also wanted to use Homestead. The problem I\'m having is, th

4条回答
  •  旧巷少年郎
    2020-12-23 12:22

    there is a short cut command to proxy the sites you want to add..

    without having to messed up your Homestead.yaml file and provision your vagrant box all over again...

    This applies to BOTH GLOBAL AND PER PROJECT INSTALLATION

    Just Make sure if you are adding another project...

    You add it the (whole project) on your Shared Folder Declared in your Homestead.yaml

    Assuming your shared folder is C:/Users/MYACCOUNT/Codes

    Add another project in that Folder laravel new homestead.app

    Then

    Assuming your are ssh in your Homestead Type a.) if your using nginx

    serve homestead.app /home/Vagrant/Code/homestead/public

    b.) if your using hhvm serve-hhvm homestead.app /home/Vagrant/Code/homestead/public Just change your domain name and path to public folder of your project

    Then Edit your etc/hosts file as Administrator

    What ever ip address you define in your Homestead.yaml

    usually the default is 192.168.10.10

    Use it instead of 127.0.0.1

    Why? because if you use 127.0.0.1 your url will look like homestead.app:8000

    If you Use the IP address in the Homestead.yaml

    192.168.10.10 homestead.app

    you can access your site without port 8000 and just use homestead.app

    This Solution is Much Better than Provision... And is Faster...

    This is what i Do

提交回复
热议问题