로컬(작업컴퓨터)에서 웹페이지 코드를 수정하고 웹서버에 연동하여 개발을 진행하기 위해
XAMPP(Apache) / VS Code(Editer) 설치 및 가상호스트 설정을 하였습니다.
■ 프로그램 설치
- XAMPP : https://www.apachefriends.org/download.html
Download XAMPP
Includes: Apache 2.4.39, MariaDB 10.1.40, PHP 7.1.29 + SQLite 2.8.17/3.7.17 + multibyte (mbstring) support, Perl 5.16.3, ProFTPD 1.3.4c, phpMyAdmin 4.8.5, OpenSSL 1.0.2r, GD 2.0.35, Freetype2 2.4.8, libpng 1.5.26, gdbm 1.8.3, zlib 1.2.11, expat 2.0.1, Sabl
www.apachefriends.org
- VS Code : https://code.visualstudio.com/download
Download Visual Studio Code - Mac, Linux, Windows
Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows. Download Visual Studio Code to experience a redefined code editor, optimized for building and debugging modern web and cloud applications.
code.visualstudio.com
■ 가상호스트 설정
웹서버에서 도매인을 연결하여 웹 브라우저로 웹페이지를 여는 것처럼 로컬에서도 가상호스트 설정을 통해 도메인으로 웹페이지를 확인할 수 있습니다.
- hosts 설정 (경로 : C:\Windows\System32\drivers\etc)
- httpd.conf 설정 (경로 : C:\xampp\apache\conf)
<Directory "D:/project">
AllowOverride None
Require all granted
</Directory>
- httpd-vhost.conf 설정 (경로 : C:\xampp\apache\conf\extra)
<VirtualHost *:80>
##ServerAdmin webmaster@dummy-host.example.com
DocumentRoot "D:/project/test"
ServerName stage.test.devs
ServerAlias stage.test.devs
##ErrorLog "logs/dummy-host.example.com-error.log"
##CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
가상호스트 설정이 모두 완료된 후 XAMPP Apache를 재시작하게 되면 브라우저에서 http://stage.test.devs 주소 접근 시 D:\project\test 폴더 내부의 index파일을 볼 수 있습니다.
여기까지 작업환경 설정이 완료되었습니다.
다음에는 작업환경과 웹서버 연동을 위한 git hub 설치에 대해 포스팅하겠습니다.