Laravel Homestead 2.0 Adding New Sites

不羁岁月 提交于 2019-12-08 04:00:43

问题


Homestead 2 is awesome, but I can't seem to get new sites to work without going through the following process.

  1. I do homestead edit to setup the new site paths and domains etc
  2. I edit hosts to set up the domain
  3. I do homestead halt then homestead up to restart

This is when I think things should be working... but they don't. I have to run the additional step of

  1. Running vagrant global-status getting the id and running vagrant 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!