My first homestead project worked without a hitch here's the core part of the homstead.yaml
folders:
- map: C:\dev\bitbucket
to: /home/vagrant/bb
sites:
- map: project.dev
to: /home/vagrant/bb/example/project/public
now I wanted to add a different folder into the mix so I extended the yaml to
folders:
- map: C:\dev\bitbucket
to: /home/vagrant/bb
- map: C:\dev\github
to: /home/vagrant/gh
sites:
- map: project.dev
to: /home/vagrant/bb/example/project/public
- map: another.dev
to: /home/vagrant/gh/example/another/public
I run homestead provision and now I can access another.dev but I got the error No input file specified. So I ran the command homestead ssh and cd /home/vagrant followed by ls and all I see is the bb folder and not the gh
I found multiple places that mention multiple sites syntax, but couldn't find something mentioning multiple folders (although as the name suggests folders is plural, so I thought this should be possible)
What am I missing?
sometimes homestead doesn't provision correctly and needs a full reboot. while this isn't ideal, one workaround is to use homestead halt followed by homestead up to recreate the provisioning process for the VM.
a bit of my homestead file
u are not allowed to change this directory /home/vagrant/Projects to something else
folders:
- map: ~/Projects
to: /home/vagrant/Projects
sites:
- map: aone.dev
to: /home/vagrant/Projects/aone/public
- map: booking.dev
to: /home/vagrant/Projects/booking/public
- map: nish.dev
to: /home/vagrant/Projects/nish/public
- map: shazdekocholo.dev
to: /home/vagrant/Projects/shazdekocholo/public
- map: hejab.dev
to: /home/vagrant/Projects/hejab/public
Related
I've set up the project many times, but this time, when I use vagrant up and try to go into the website, it says "no input file specified".
I have set up the hosts file
I have logged to the vagrant ssh to ensure the files/folders are linking and they are
I have tried destroying the virtual machine, building it again, --provision etc..
This is the code for the project from the Homestead file
folders:
-
map: ~/portfolio
to: /home/vagrant/code
sites:
-
map: portfolio.test
to: /home/vagrant/code/public
php: "7.2"
No matter what I do, I just go between the errors "No input file specified" and "403 Forbidden
nginx/1.15.6"
Check if your path are correct and the folders exist.
Open your command line and move to the location and run following command
pwd
That is going to return the path.
You are also not pointing in to your actual project, shouldn't this:
folders:
-
map: ~/portfolio
to: /home/vagrant/code
sites:
-
map: portfolio.test
to: /home/vagrant/code/public
php: "7.2"
be something like this:
folders:
-
map: ~/portfolio
to: /home/vagrant/code
sites:
-
map: portfolio.test
to: /home/vagrant/code/myapp/public
php: "7.2"
Further you should try following:
homestead up --provision
or
vagrant up --provision
Homestead configuration file, Homestead.yaml, offers way to map domains to folders, like this:
sites:
- map: project.dev
to: /home/vagrant/www/project.dev/public
- map: some-other.dev
to: /home/vagrant/www/some-other.dev/public
# etc.
Is there any way to automate this process and map all .dev domains to the folders, like this?
/home/vagrant/www/{domain}/public
Old thread but you can do this
sites:
- map: '~^(?<project>.+)\.dev$'
to: /home/vagrant/Development/\$project/public
I downloaded phpmyadmin to my /Code folder, and then updated my Homestead.yaml file:
folders:
- map: C:\Users\{ myname }\Code
to: /home/vagrant/Code
- map: C:\Users\{ myname }\Code\phpmyadmin
to: /home/vagrant/Code/phpmyadmin
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
- map: phpmyadmin.app
to: /home/vagrant/Code/phpmyadmin
I updated my hosts file also...
{ ip from homestead.yaml} phpmyadmin.app
When I browse to phpmyadmin.app it displays the same site as homestead.app.
I'm using Windows.
Is there some way to restart homestead? How do I get this to work?
You'll need to reprovision your homestead vm with
vagrant provision
See Adding Additional Sites
I keep getting this error while runing : vagrant up :
Homestead.yaml
folders:
- map: ~/Applications/MAMP/htdocs
to: /home/vagrant/code
sites:
- map: homestead.app
to: /home/vagrant/code/aveniros/Laravel/public
Can someone please point out what I did wrong here ?
I fix this disaster by by deleting the (~)
Homestead.yaml
folders:
- map: /Applications/MAMP/htdocs/code
to: /home/vagrant/code
sites:
- map: homestead.app
to: /home/vagrant/code/aveniros/Laravel/public
It should work now.
Then, if you open up your Virtual Box Application, you should see something like this :
Hope this answer help ! :D
Hee guys, little question: So i have setup the Homestead 2.0 and everything is working fine. I wanted to add another project in the same code directory but link it to another url. So i added it in the sites list but when i visited laravel.app it all works fine, but when I visit larabook.app it shows me the laravel.app page! Both urls are linked to 192.168.10.10 in my /etc/hosts file.
I have tried restarting my mac and restarting the vm but nothing is working :'(
/etc/hosts
192.168.10.10 laravel.app
192.168.10.10 larabook.app
Homestead.yaml
folders:
- map: ~/Code
to: /home/vagrant/Code
sites:
- map: laravel.app
to: /home/vagrant/Code/Laravel/public
- map: larabook.app
to: /home/vagrant/Code/Larabook/public
databases:
- homestead
- larabook
Assuming your Homestead.yaml file above
type in:
$ vagrant global-status
will display something like;
id name provider state directory
--------------------------------------------
77c5c30 default virtualbox running et....
type in:
$ vagrant provision 77c5c30
Of course this assumes you only have 1 VM, if you have others then read the instruction when you run vagrant provision
This works for me, and didn't lose the database:
$ homestead halt
$ homestead up --provision
Try this
folders:
- map: ~/Code/Laravel
to: /home/vagrant/Code/Laravel
- map: ~/Code/Larabook
to: /home/vagrant/Code/Larabook
sites:
- map: laravel.app
to: /home/vagrant/Code/Laravel/public
- map: larabook.app
to: /home/vagrant/Code/Larabook/public
databases:
- homestead
- larabook
Note: look at the changes i have made to the folders section.
find out more from https://www.easylaravelbook.com/blog/configuring-multiple-laravel-homestead-sites-and-databases/#top
after run
$ homestead halt
$ homestead up --provision