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

비밀번호

댓글 작성자
 




... 61  62  63  64  65  66  67  68  69  [70]  71  72  73  74  75  ...
NoWriterDateCnt.TitleFile(s)
11897정성태5/16/201920640오류 유형: 536. Visual Studio - "Developer Pack"을 설치했는데도 "대상 프레임워크" 목록에 나오지 않는 경우 [2]
11896정성태5/15/201915353개발 환경 구성: 440. C#, C++ - double의 Infinity, NaN 표현 방식파일 다운로드1
11895정성태5/12/201913759.NET Framework: 832. ML.NET Model Builder - 회귀(Regression), 다중 분류(Multi-class classification) 예제파일 다운로드1
11894정성태5/10/201914915VS.NET IDE: 135. Visual Studio - ML.NET Model Builder 소개 [5]
11893정성태5/10/201912518오류 유형: 535. C# 6.0 이상의 문법을 컴파일 시 오류가 발생한다면?
11892정성태5/10/201912559웹: 38. HTTP Cookie의 expires 시간 형식(RFC7231)
11891정성태5/9/201915042.NET Framework: 831. (번역글) .NET Internals Cookbook Part 12 - Memory structure, attributes, handles
11890정성태5/8/201910788개발 환경 구성: 439. "Visual Studio Enterprise is required to execute the test." 메시지와 관련된 코드 기록
11889정성태5/8/201911646개발 환경 구성: 438. mstest, QTAgent의 로그 파일 설정 방법
11888정성태5/8/201926880.NET Framework: 830. C# - 비동기 호출을 취소하는 CancellationToken의 간단한 예제 코드 [1]파일 다운로드1
11887정성태5/8/201913370.NET Framework: 829. C# - yield 문을 사용할 수 있는 메서드의 조건
11886정성태5/7/201912434오류 유형: 534. mstest.exe 실행 시 "Visual Studio Enterprise is required to execute the test." 오류 [2]
11885정성태5/7/20199397오류 유형: 533. mstest.exe 실행 시 "File extension specified '.loadtest' is not a valid test extension." 오류 발생
11884정성태5/5/201913079.NET Framework: 828. C# DLL에서 Win32 C/C++처럼 dllexport 함수를 제공하는 방법 - 두 번째 이야기
11883정성태5/3/201917393.NET Framework: 827. C# - 인터넷 시간 서버로부터 받은 시간을 윈도우에 적용하는 방법파일 다운로드1
11882정성태5/2/201914310.NET Framework: 826. (번역글) .NET Internals Cookbook Part 11 - Various C# riddles파일 다운로드1
11881정성태4/28/201914552오류 유형: 532. .NET Core 프로젝트로 마이그레이션 시 "CS0579 Duplicate 'System.Reflection.AssemblyCompanyAttribute' attribute" 오류 발생
11880정성태4/25/201911244오류 유형: 531. 이벤트 로그 오류 - Task Scheduling Error: m->NextScheduledSPRetry 1547, m->NextScheduledEvent 1547
11879정성태4/24/201916483.NET Framework: 825. (번역글) .NET Internals Cookbook Part 10 - Threads, Tasks, asynchronous code and others파일 다운로드2
11878정성태4/22/201914472.NET Framework: 824. (번역글) .NET Internals Cookbook Part 9 - Finalizers, queues, card tables and other GC stuff파일 다운로드1
11877정성태4/22/201914452.NET Framework: 823. (번역글) .NET Internals Cookbook Part 8 - C# gotchas파일 다운로드1
11876정성태4/21/201914267.NET Framework: 822. (번역글) .NET Internals Cookbook Part 7 - Word tearing, locking and others파일 다운로드1
11875정성태4/21/201914632오류 유형: 530. Visual Studo에서 .NET Core 프로젝트를 열 때 "One or more errors occurred." 오류 발생
11874정성태4/20/201914651.NET Framework: 821. (번역글) .NET Internals Cookbook Part 6 - Object internals파일 다운로드1
11873정성태4/19/201913594.NET Framework: 820. (번역글) .NET Internals Cookbook Part 5 - Methods, parameters, modifiers파일 다운로드1
11872정성태4/17/201914071.NET Framework: 819. (번역글) .NET Internals Cookbook Part 4 - Type members파일 다운로드1
... 61  62  63  64  65  66  67  68  69  [70]  71  72  73  74  75  ...