어제와 똑같이 살면서 다른 미래를 기대하지 말자

윈도우 Vagrant 개발환경 설정 (Laravel) 본문

IT관심분야/Windows

윈도우 Vagrant 개발환경 설정 (Laravel)

플랜액터 2018. 12. 21. 16:56

1. VirtualBox 다운로드 및 설치

https://www.virtualbox.org/wiki/Downloads

Virtualbox 6.0이 있지만 Homestead가 현재 5.2까지만 지원합니다. 

Virtualbox 5.2 버전을 다운로드 후 설치해주세요.


2. Vagrant 다운로드 및 설치

https://www.vagrantup.com/ 


3. Vagrant Box 검색/설치

https://app.vagrantup.com/boxes/search

$ vagrant.exe box add laravel/homestead-7

...

1) virtualbox

2) vmware_desktop

Enter your choice: 1


4. Homestead 설치

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

Cloning into 'Homestead'...

remote: Enumerating objects: 20, done.

remote: Counting objects: 100% (20/20), done.

remote: Compressing objects: 100% (9/9), done.

remote: Total 3199 (delta 10), reused 16 (delta 10), pack-reused 3179

Receiving objects: 100% (3199/3199), 683.47 KiB | 579.00 KiB/s, done.

Resolving deltas: 100% (1915/1915), done.

$ cd ~/Homestead

$ git checkout v7.19.2

Previous HEAD position was 986f3db 💎 🔖 Tagging v7.9.0

HEAD is now at 234a43b 💎 🔖 Tagging v7.19.2

$ ./init.bat (윈도우) 

$ vi ~/Homestead/Homestead.yaml

---

ip: "192.168.10.10" memory: 2048 cpus: 1 provider: virtualbox authorize: ~/.ssh/id_rsa.pub keys: - ~/.ssh/id_rsa folders: - map: D:\Workspace\Atom_Workspace\project_root to: /home/vagrant/code/project_name sites: - map: project_name.test to: /home/vagrant/code/project_name/public_html databases: - homestead # ports: # - send: 50000 # to: 5000 # - send: 7777 # to: 777 # protocol: udp # blackfire: # - id: foo # token: bar # client-id: foo # client-token: bar # zray: # If you've already freely registered Z-Ray, you can place the token here. # - email: foo@bar.com # token: foo # Don't forget to ensure that you have 'zray: "true"' for your site.


※ ssh key 쌍이 존재하지 않는경우 생성

$ ssh-keygen -t rsa -C "e-mail"


5. Vagrant 실행

$ vagrant.exe up


6. php.ini 설정

기본적으로 PHP short tag를 이용하기 위해서 public_html에 .user.ini를 생성하여 서버설정을 하면 됩니다.

$ vi .user.ini

[PHP]

short_open_tag = On


7. hosts 파일 수정

C:\Windows\System32\drivers\etc\hosts

192.168.10.10 project_name.test 추가

'IT관심분야 > Windows' 카테고리의 다른 글

Powershell 2 to 5.1 업그레이드  (0) 2019.03.22
윈도우 톰보이(Tomboy) 설치  (0) 2009.01.12
Comments