Microsoft MVP성태의 닷넷 이야기
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 2개 있습니다.)

비주얼 스튜디오에서 IIS 웹 서버로 "Web Deploy"를 이용해 배포하는 방법

Visual Studio의 "Publish" 기능에 보면,


[그림 1: Publish - Web Server (IIS)]
iis_publish_1.png

"Web Server (IIS)" 배포 방식이 있습니다. 이게 가능하려면 해당 웹 서버 측에 몇 가지 설정을 해야 하는데요, 이에 대해 정리를 해봅니다. ^^




우선, 웹 서버 측에 2가지 서비스를 설치해야 합니다. 첫 번째는 "wmsvc(Management Service)"로,

[Add Roles and Features]
Web Server (IIS)
    - Management Tools
        - Management Service

간단하게 PowerShell 스크립트를 이용해 설치한 후,

PS C:\Windows\system32> Install-WindowsFeature -Name "Web-Mgmt-Service"

Success Restart Needed Exit Code      Feature Result
------- -------------- ---------      --------------
True    No             Success        {Management Service}

시작 유형과 서비스 상태를 변경합니다.

c:\temp> sc config wmsvc start= auto
c:\temp> net start wmsvc

두 번째는 "Web Deployment Tool"을 다운로드해,

Installing the Web Deployment Tool.
; https://learn.microsoft.com/en-us/iis/publish/using-web-deploy/use-the-web-deployment-tool

Web Deployment Tool
; https://www.iis.net/downloads/microsoft/web-deploy
; https://www.microsoft.com/en-us/download/details.aspx?id=43717

설치 유형을 "Complete"로 선택하거나, 아니면 Custom으로 하는 경우 "IIS Deployment Handler"와 "Remote Agent Service"는 꼭 추가하도록 합니다.

여기까지, 서버 수준의 환경 설정은 완료됩니다. (참고로, 반드시 wmsvc 설치 후 "Web Deployment Tool"을 설치합니다. 반대로 하는 경우, 추가 구성이 필요합니다.)




이제 Visual Studio에서 IIS 웹 서버 쪽으로 배포를 해야 하는데, '그림 1'에서처럼 "Web Server (IIS)" 항목으로 배포해도 되지만, 바로 그 아래의 "Import Profile"을 이용하면 더 편리하게 배포할 수 있습니다. 이를 위해 "publish settings" 파일이 필요한데, 이것은 웹 서버 쪽에서 해당 웹 사이트를 우 클릭해 "배포(Deploy)" / "웹 배포 게시 설정(Configure Web Deploy Publishing)..." 메뉴를 선택해 구할 수 있습니다.

iis_publish_2.png

이렇게 구한 "PublishSettings" 파일은 대략 다음의 형식으로 저장됩니다.

<?xml version="1.0" encoding="utf-8"?>
<publishData>
  <publishProfile
    publishUrl="https://TESTPC:8172/msdeploy.axd"
    msdeploySite="TestWeb"
    destinationAppUrl="http://TESTPC:8080/"
    mySQLDBConnectionString=""
    SQLServerDBConnectionString=""
    profileName="Default Settings"
    publishMethod="MSDeploy"
    userName="TESTPC\testusr" />
</publishData>

대충 짐작 가능한 값들이기 때문에 굳이 IIS의 메뉴를 이용하지 않고도 저 값을 채워 사용해도 무방합니다. 마지막으로 이 파일을 "Import Profile"로 읽어와 배포하면 끝!

참고로, 대상 IIS 웹 서버가 Azure VM이라면 방법이 바뀌는데 이에 대해선 다음의 글에서 설명하고 있습니다.

Azure 가상 머신에 Web Application을 배포하는 방법
; https://www.sysnet.pe.kr/2/0/11491




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 3/15/2023]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 31  32  33  34  35  36  [37]  38  39  40  41  42  43  44  45  ...
NoWriterDateCnt.TitleFile(s)
12708정성태7/14/202110300Linux: 41. 리눅스 환경에서 디스크 용량 부족 시 원인 분석 방법
12707정성태7/14/202177560오류 유형: 734. MySQL - Authentication method 'caching_sha2_password' not supported by any of the available plugins.
12706정성태7/14/20218741.NET Framework: 1076. C# - AsyncLocal 기능을 CallContext만으로 구현하는 방법 [2]파일 다운로드1
12705정성태7/13/20218912VS.NET IDE: 168. x64 DLL 프로젝트의 컨트롤이 Visual Studio의 Designer에서 보이지 않는 문제 - 두 번째 이야기
12704정성태7/12/20218053개발 환경 구성: 576. Azure VM의 서비스를 Azure Web App Service에서만 접근하도록 NSG 설정을 제한하는 방법
12703정성태7/11/202113686개발 환경 구성: 575. Azure VM에 (ICMP) ping을 허용하는 방법
12702정성태7/11/20218838오류 유형: 733. TaskScheduler에 등록된 wacs.exe의 Let's Encrypt 인증서 업데이트 문제
12701정성태7/9/20218475.NET Framework: 1075. C# - ThreadPool의 스레드는 반환 시 ThreadStatic과 AsyncLocal 값이 초기화 될까요?파일 다운로드1
12700정성태7/8/20218869.NET Framework: 1074. RuntimeType의 메모리 누수? [1]
12699정성태7/8/20217673VS.NET IDE: 167. Visual Studio 디버깅 중 GC Heap 상태를 보여주는 "Show Diagnostic Tools" 메뉴 사용법
12698정성태7/7/202111635오류 유형: 732. Windows 11 업데이트 시 3% 또는 0%에서 다운로드가 멈춘 경우
12697정성태7/7/20217524개발 환경 구성: 574. Windows 11 (Insider Preview) 설치하는 방법
12696정성태7/6/20218128VC++: 146. 운영체제의 스레드 문맥 교환(Context Switch)을 유사하게 구현하는 방법파일 다운로드2
12695정성태7/3/20218172VC++: 145. C 언어의 setjmp/longjmp 기능을 Thread Context를 이용해 유사하게 구현하는 방법파일 다운로드1
12694정성태7/2/202110114Java: 24. Azure - Spring Boot 앱을 Java SE(Embedded Web Server)로 호스팅 시 로그 파일 남기는 방법 [1]
12693정성태6/30/20217859오류 유형: 731. Azure Web App Site Extension - Failed to install web app extension [...]. {1}
12692정성태6/30/20217735디버깅 기술: 180. Azure - Web App의 비정상 종료 시 남겨지는 로그 확인
12691정성태6/30/20218593개발 환경 구성: 573. 테스트 용도이지만 테스트에 적합하지 않은 Azure D1 공유(shared) 요금제
12690정성태6/28/20219405Java: 23. Azure - 자바(Java)로 만드는 Web App Service - Tomcat 호스팅
12689정성태6/25/20219942오류 유형: 730. Windows Forms 디자이너 - The class Form1 can be designed, but is not the first class in the file. [1]
12688정성태6/24/20219626.NET Framework: 1073. C# - JSON 역/직렬화 시 리플렉션 손실을 없애는 JsonSrcGen [2]파일 다운로드1
12687정성태6/22/20217607오류 유형: 729. Invalid data: Invalid artifact, java se app service only supports .jar artifact
12686정성태6/21/202110060Java: 22. Azure - 자바(Java)로 만드는 Web App Service - Java SE (Embedded Web Server) 호스팅
12685정성태6/21/202110304Java: 21. Azure Web App Service에 배포된 Java 프로세스의 메모리 및 힙(Heap) 덤프 뜨는 방법
12684정성태6/19/20218757오류 유형: 728. Visual Studio 2022부터 DTE.get_Properties 속성 접근 시 System.MissingMethodException 예외 발생
12683정성태6/18/202110232VS.NET IDE: 166. Visual Studio 2022 - Windows Forms 프로젝트의 x86 DLL 컨트롤이 Designer에서 오류가 발생하는 문제 [1]파일 다운로드1
... 31  32  33  34  35  36  [37]  38  39  40  41  42  43  44  45  ...