问题
Homestead 2 is awesome, but I can't seem to get new sites to work without going through the following process.
- I do
homestead edit
to setup the new site paths and domains etc - I edit
hosts
to set up the domain - I do
homestead halt
thenhomestead up
to restart
This is when I think things should be working... but they don't. I have to run the additional step of
- Running
vagrant global-status
getting the id and runningvagrant provision <id>
.
Everything works except running provision again wipes out all the databases! How do I add new sites without having to provision again?
回答1:
Instead of step 3 use vagrant provision
in your homestead directory (~/.composer/vendor/laravel/homestead/
).
As I know Taylor is already planning a "provision" flag, until that you can feel free to use vagrant commands.
回答2:
this works for me
homestead halt && homestead up --provision
回答3:
Here is my ~/homestead/.Homestead.yaml
file, it contains a configuration for two apps, one with HHVM enabled and one with HHVM disabled(default in homestead).
Homestead will create the database for you in MySQL and PostgreSQL server, when running homestead up
.
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Projects
to: /home/vagrant/Projects
sites:
- map: jobs.app
to: /home/vagrant/Projects/jobs/public
- map: messages.app
to: /home/vagrant/Projects/messages/web
hhvm: true
databases:
- jobs
- messages
variables:
- key: APP_ENV
value: local
You can now run:
$ homestead up
and then:
$ homestead ssh
and then run byobu(for tmux):
$ byobu
and cd into the project:
$ cd Projects/jobs
and run composer:
$ composer update
来源:https://stackoverflow.com/questions/27892861/laravel-homestead-2-0-adding-new-sites