1. 설치할 것 : 

1) VirtualBox 6.x, or VMWare

2) Vagrant

 

Downloads | Vagrant by HashiCorp

Vagrant enables users to create and configure lightweight, reproducible, and portable development environments.

www.vagrantup.com

3) git bash

 

2. 홈스테드 Vagrant Box 설치하기

1) 커맨드 창에 아래의 명령어 입력

vagrant box add laravel/homestead

2) provider 선택지 : virtualbox 선택

vagrant box 설치

3) success 시 완료

 

3. 홈스테드 설치하기

1) Git bash로 home 디렉토리안에 Homestead 폴더로 저장소를 복제하기

git clone https://github.com/laravel/homestead.git ~/Homestead

 

2) master 브랜치는 개발중이라 안정적이지 않을 수도 있기 때문에, 태그를 지정한 버전을 체크아웃 

cd ~/Homestead

git checkout release

 

4. Homestead 설정하기 (Homestead.yalm)

 

1) C:\Users\사용자\Homestead\resources 에서 Homestead.yalm 수정

2) C:\Users\사용자\Homestead 에서 init.bat 실행하면 Homestead 폴더에도 Homestead.yalm 생성

 

3) Homestead.yalm 

 

folders : map은 로컬에서 프로젝트 코드의 위치, to는 가상머신 vagrant의 경로

folders:
    - map: C:/Users/사용자/project/code
      to: /home/vagrant/code

sitest : map은 가상도메인

sites:
    - map: homestead.test
      to: /home/vagrant/code/생성할 프로젝트폴더명(project1)/public

 

Homestead.yalm

 

5. ssh 키 생성

ssh-keygen -t ras -C "메일주소"

Enter passpahrase : 개인키 암호

6. host 설정

1) 메모장을 관리자 권한으로 실행한 다음 C:\Windows\System32\drivers\etc\hosts 파일 열기

2) homestead.yalm 파일에서의 ip 와 sites의 map 부분과 같아야 함

192.168.56.56           homestead.test

 

7. Vagrant Box 구동 & ssh를 통해 홈스테드 환경에 접속

vagrant up : vagrant box 구동

vagrant reload --provision : 설정 변경 후 다시 가동

vagrant ssh : ssh를 통해 홈스테드 환경에 접속

vagrant up

vagrant reload --provision (설정 변경 후 vagrant 다시 실행시)

vagrant ssh

 

8. 프로젝트 생성

 

cd ~/code
laravel new proejct1

9. homestead.test


WRITTEN BY
beautifulhill

,