Jump to content
과거의 기술자료(읽기 전용): https://tech.devgear.co.kr ×
과거의 기술자료(읽기 전용): https://tech.devgear.co.kr

RAD 서버를 윈도우 서버 2019 IIS 10 환경에 설치하기


Recommended Posts

Durch Matthias Eissing이 작성한 Installation des „RAD Server“ auf Windows 2019 (oder Windows 10) mit IIS 10(독일어)를 번역했습니다.

  • 2020년 11월 작성된 글로, 내용 중 일부 경로 및 버전이 변경 될 수 있습니다.
  • 독일어로된 일부 이미지를 한글/영문 이미지로 교체되었습니다.
  • 원본 비디오(독일어)를 통해 글에 담지 못한 과정을 자세히 확인할 수 있습니다.(54분)
  • 이글은 윈도우 서버 2019버전을 대상으로 하지만, 내용을 참고해 Windows 10 등의 다른 윈도우 버전에도 설치할 수 있습니다.

얼마전 우리는 RAD 서버를 설치할 수 있는 설치파일을 최적화했다. 최신 윈도우 버전(IIS 10; Internet Information Server, Microsoft의 웹서버)에 원할하게 설치할 수 있지만, 몇가지 고려해야하는 사항이 있다.

엠바카데로는 공식적으로 IIS7 기준으로 RAD 서버를 지원한다.(참고: DocWiki) 하지만 그것은 과거의 관행이다....

 

준비물

  • RAD 스튜디오(델파이 / C++빌더) IDE(겟잇 패키지 매니저를 사용하기 위함. 자세한 내용은 뒤에서 설명)
  • IIS가 설치될 윈도우 시스템(여기서는 Windows Server 2019 사용)
  • RAD 서버 시리얼 번호
  • 운영환경(서버) 컴퓨터에서 인터넷 연결

지침

먼저 배포 대상 시스템에 IIS를 설치한다. Windows Server 2019의 서버 관리자를 통해 설치 중(웹서버(IIS) > 관리 도구 > IIS 관리 콘솔) ISAPI 확장도 설치해야 한다.(역할 및 기능 추가에서 찾을 수 있다.)

K-8.jpg

IIS가 실행 중인지 확인하기 위해 간단히 테스트 할 수 있다. (역자 주: 웹브라우저에서 http://localhost/ 이동)

IISinstalliert-7572623.png

 

다음으로, RAD 스튜디오(델파이/C++빌더)에서 RAD 서버용 설치 패키지를 다운로드 받는다. 겟잇 패키지 매너저(Tools | Getit Package Manager...) 실행 후 "RAD Server" 키워드로 검색해 찾을 수 있다.

GetItSucheNachRADServer-2604448.png

여기에서 설치 프로그램 패키지를 다운로드 할 수 있다.  이 설치 프로그램 패키지는 실제 RAD 서버 설치(IIS, Apache용 BPL을 포함해 설치를 위한 DLL)와 InterBase 2020(RAD 서버의 구성 데이터용) 두가지가 포함되어 있다. "RAD Server Installer for Windows 1.0" 패키지를 다운로드 후 윈도우 파일 탐색기가 열리고 다운로드된 파일이 표시된다.(경로: C:\Users\<사용자 이름>\Documents\Embarcadero\Studio\<버전>\CatalogRepository\RADServerInstallerforWindows-<버전>-1.0)

Windows-ExplorerMitRADServerDateien-1912261.png

주의: 버전 번호 "1.0"을 걱정하지 않기바란다. 이 패키지는 최근 자주/정기적으로 업데이트 되고있다.

위 파일 중 다음 두 파일을 대상 시스템으로 복사한다.(FTP, 파일 공유, USB 메모리 등 이용)

  • RADServer.exe
  • InterBase_2020_Windows.zip

이 두 파일에는 윈도우 서버에 설치하기 위한 모든 것들이 포함되어 있으며, 대상 시스템의 공통 디렉토리에 복사한다. 여기서는 바탕화면에 복사했다.

DateienAufWindowsServer2019-5299344.png

RADServer.exe를 실행한다. 이 설치는 비교적 쉬운 단계이나 몇가지 고려사항이 있다.

  • "RAD 서버 DB(InterBase 2020)"과 "RAD 서버"는 반드시 설치해야 한다. 전체설치를 권장한다.
  • 아키텍처(32/64 비트)는 64비트로 선택해야 한다.(IIS는 32비트 ISAPI DLL 실행도 지원하지만 구성 작업이 필요하다.)
  • Web Server : IIS(이 글에서는)
  • Site Configuration: radserver / radconsole(URL의 엔드포인트에 반영됨)
  • 사이트 이름(IIS 관리내의 구성: RAD 서버 / 80)

물론 80번 포트는 IIS의 표준 사이트와 충돌하지만 나중에 자세히 다룬다.

 

이제 InterBase 2020 서버 설치를 활성화해야 한다. 이 작은 바로 수행해야 한다.(RADServer.exe는 EMSServer.ini, InterBase 서버 등 필요한 모든 설정을 구성한다. 이를 위해 InterBase 서버는 이미 실행 중이어야 한다.)

LicenseInterBase-6533077.png

설치 중 RAD 서버를 활성화/라이선스 적용할 수 있는 Embarcadero License Manager가 표시된다. 여기에 RAD 서버 시리얼 번호를 입력한다.(RAD 스튜디오, 델파이, InterBase 시리얼 번호가 아니다.)(역자주: RAD 서버 시리얼 번호는 제품 구입 시 받은 ESD 메일에서 찾을 수 있다.)

우측 Registrer... 버튼 클릭 > Serial Number와 계정 입력 > Register 버튼 클릭

RegRADServer-8417786.jpg

성공: 

RADServerMultiSiteRegistered-7050995.jpg

확인 후 라이선스 매니저 창을 닫는다.

LicenseInterBase-6533077.png

성공 후 Continue 버튼을 누른다.

나머지 설치 동안 두개의 오류 메시지가 나타나지만 문제가되지 않는다.

IBClient64Error-7909136.png

여기가 InterBase 서버가 실행 중인지 확인할 수 있는 좋은 기회이다. 윈도우 시작 메뉴에서 "InterBase Server Manager"를 실행하고, "Running"으로 표시됨을 확인한다. 이후 "Yes to All" 버튼을 눌러 계속 진행한다.

관심이 있는 경우(선택사항): 설치가 완료되기 전 실행된 PowerShell 명령은 %TEMP% 디렉토리에서 찾을 수 있다.(예. C:\Users\Administrator\AppData\Local\Temp\I1604922298\InstallerData\Disk1\InstData\Resource1.zip\$IA_PROJECT_DIR$). 
여기에서 RADServer_IIS_Config.ps1 및 RADConsole_IIS_Config.ps1을 확인할 수 있다.

RADServer_IIS_Config.ps1

BAT에서 호출

PowerShell -NoProfile -ExecutionPolicy Bypass -Command „& {Start-Process %WINDIR%\sysnative\WindowsPowerShell\v1.0\powershell.exe -ArgumentList ‚-NoExit -NoProfile -ExecutionPolicy Bypass -File „“““%PowerShellScriptPath%““““ -SiteName „““%2″““ -Port „“““%3″“““ -RootPath „““%4″““ -SiteDirectory „““%5″““ -Architecture „““%6″““ -INIFilePath „““%7″““ -SelectedFeatures „““%8″““ ‚ -Verb RunAs}“;

#Parameters from command line
param (
[string]$SiteName,
[string]$Port,
[string]$RootPath,
[string]$SiteDirectory,
[string]$Architecture,
[string]$INIFilePath,
[string]$SelectedFeatures
)

function Set-OrAddIniValue
{
Param(
[string]$FilePath,
[hashtable]$keyValueList
)
$content = Get-Content $FilePath
$keyValueList.GetEnumerator() | ForEach-Object {
if ($content -match "^$($_.Key)=")
{
$content= $content -replace "^$($_.Key)=(.*)", "$($_.Key)=$($_.Value)"
}
else
{
$content += "$($_.Key)=$($_.Value)"
}
}
$content | Set-Content $FilePath
}

#Variables used for creating iis modules
$DriveSitePath = $SiteDirectory
$AppPool = $RootPath
$IISEMSPath = 'IIS:\sites\' + $SiteName + '\' + $RootPath
$DriveEMSPath = $DriveSitePath + '\' + $RootPath
$DLLPath = $DriveEMSPath + "\EMSServer.dll"
$WebAppName = $RootPath
$INIFile = $INIFilePath

function Set-SwaggerValue
{
Param(
[string]$FilePath
)
$content = Get-Content $FilePath
$replaceContent = 'url: "/'+$RootPath+'/EMSServer.dll/API/APIDoc.json",'
$content= $content -replace 'url: "../API/APIDoc.json",', $replaceContent
$content | Set-Content $FilePath
}

#needed for apppool check
import-module webadministration


#check if website exists with the same site name
if(!(Test-Path IIS:\AppPools\$AppPool))
{
#app pool doesn't exist
if ((Test-Path $IISEMSPath) -and ($DriveSitePath.Contains('inetpub\wwwroot')))
{
$AppPool = "DefaultAppPool"
}
else
{
#website doesn't exist
#Create an application pool and website 
New-WebAppPool -Name $AppPool
New-WebSite -Name $SiteName -Port $Port -PhysicalPath $DriveSitePath -ApplicationPool $AppPool
}
}

# Allow EMS website to override server-wide handler configurations
Set-WebConfiguration //System.webServer/handlers -metadata overrideMode -value Allow -PSPath IIS:/ -verbose

# Allow execute permissions for the EMS handler
Set-WebConfiguration -filter "/system.webServer/handlers/@AccessPolicy" -PSPath $IISEMSPath -value "Read, Script, Execute" -verbose

# Set up the EMS handler
Set-WebHandler -Name "ISAPI-dll" -Path "*.dll" -PSPath $IISEMSPath -RequiredAccess Execute -ScriptProcessor $DLLPath -ResourceType File -Modules IsapiModule -Verb '*'

# Create the EMS web app
New-WebApplication -Name $WebAppName -Site $SiteName -PhysicalPath $DriveEMSPath -ApplicationPool $AppPool -force

# Add exception to ISAPI and CGI Restrictions
Add-WebConfiguration -pspath 'MACHINE/WEBROOT/APPHOST' -filter "system.webServer/security/isapiCgiRestriction" -value @{description='EMSServerRestriction';path=$DLLPath;allowed='True'}

#check if 32 bit mode was selected
if ($Architecture -contains '32Bit')
{
# Enable 32-bit applications
set-itemProperty IIS:\apppools\$AppPool -name "enable32BitAppOnWin64" -Value "true"
}
else 
{
set-itemProperty IIS:\apppools\$AppPool -name "enable32BitAppOnWin64" -Value "false"
}

if ($SelectedFeatures -match 'SUI')
{
$SiteDirectory = $SiteDirectory.Replace('\', '\\')
$SwaggeruiDir=$SiteDirectory+'\\swaggerui'
$PublicPaths='{"path": "swaggerui", "directory": "' + $SwaggeruiDir + '", "default": "index.html", "extensions": ["js", "html", "css", "map", "png"], "charset": "utf-8"}'
Set-OrAddIniValue -FilePath $INIFile -keyValueList @{
swaggerui=$PublicPaths
}
$SwaggeruiDir= $SwaggeruiDir.Replace("\\", "\") + "\index.html"
Set-SwaggerValue -FilePath $SwaggeruiDir
}

RADConsole_IIS_Config.ps1

#Parameters from command line
param (
[string]$SiteName,
[string]$Port,
[string]$RootPath,
[string]$SiteDirectory,
[string]$Architecture,
[string]$INIFilePath,
[string]$SelectedFeatures
)

#This is used to search the ini file and update it to include the correct location for the resources folder
function Set-OrAddIniValue
{
Param(
[string]$FilePath,
[hashtable]$keyValueList
)
$content = Get-Content $FilePath
$keyValueList.GetEnumerator() | ForEach-Object {
if ($content -match "^$($_.Key)=")
{
$content= $content -replace "^$($_.Key)=(.*)", "$($_.Key)=$($_.Value)"
}
else
{
$content += "$($_.Key)=$($_.Value)"
}
}
$content | Set-Content $FilePath
}

#Variables used for creating iis modules
$DriveSitePath = $SiteDirectory
$AppPool = $RootPath
$IISEMSPath = 'IIS:\sites\' + $SiteName + '\' + $RootPath
$DriveEMSPath = $DriveSitePath + '\' + $RootPath
$DLLPath = $DriveEMSPath + "\EMSConsole.dll"
$WebAppName = $RootPath
$INIFile = $INIFilePath

#needed for apppool check
import-module webadministration


#check if website exists with the same site name
if(!(Test-Path IIS:\AppPools\$AppPool))
{
#app pool doesn't exist
if ((Test-Path $IISEMSPath) -and ($DriveSitePath.Contains('inetpub\wwwroot')))
{
$AppPool = "DefaultAppPool"
}
else
{
#website doesn't exist
#Create an application pool and website 
New-WebAppPool -Name $AppPool
New-WebSite -Name $SiteName -Port $Port -PhysicalPath $DriveSitePath -ApplicationPool $AppPool
}
}

# Allow EMS website to override server-wide handler configurations
Set-WebConfiguration //System.webServer/handlers -metadata overrideMode -value Allow -PSPath IIS:/ -verbose

# Allow execute permissions for the EMS handler
Set-WebConfiguration -filter "/system.webServer/handlers/@AccessPolicy" -PSPath $IISEMSPath -value "Read, Script, Execute" -verbose

# Set up the EMS handler
Set-WebHandler -Name "ISAPI-dll" -Path "*.dll" -PSPath $IISEMSPath -RequiredAccess Execute -ScriptProcessor $DLLPath -ResourceType File -Modules IsapiModule -Verb '*'

# Create the EMS web app
New-WebApplication -Name $WebAppName -Site $SiteName -PhysicalPath $DriveEMSPath -ApplicationPool $AppPool -force

# Add exception to ISAPI and CGI Restrictions
Add-WebConfiguration -pspath 'MACHINE/WEBROOT/APPHOST' -filter "system.webServer/security/isapiCgiRestriction" -value @{description='EMSConsoleRestriction';path=$DLLPath;allowed='True'}

#check if 32 bit mode was selected
if ($Architecture -contains '32Bit')
{
# Enable 32-bit applications
set-itemProperty IIS:\apppools\$AppPool -name "enable32BitAppOnWin64" -Value "true"
}
else 
{
set-itemProperty IIS:\apppools\$AppPool -name "enable32BitAppOnWin64" -Value "false"
}

# Optional: Allow CORS
Add-WebConfigurationProperty //system.webServer/httpProtocol/customHeaders $IISEMSPath -AtIndex 0 -Name collection -Value @{name='Access-Control-Allow-Origin';value='*'}

#Modify emserver.ini to include resources directory
Set-OrAddIniValue -FilePath $INIFile -keyValueList @{
ResourcesFiles=$DriveEMSPath
}

if ($SelectedFeatures -match 'SUI')
{
if ($SelectedFeatures -match 'RS')
{
$SiteDirectory = $SiteDirectory.Replace('\', '\\')
$SwaggeruiDir=$SiteDirectory+'\\swaggerui'
$PublicPaths='{"path": "swaggerui", "directory": "' + $SwaggeruiDir + '", "default": "index.html", "extensions": ["js", "html", "css", "map", "png"], "charset": "utf-8"}'
Set-OrAddIniValue -FilePath $INIFile -keyValueList @{
swaggerui=$PublicPaths
}
}
}
#Copy the ini file from the public documents directory to the radconsole directory
#Copy-Item $INIFile -Destination $DriveEMSPath

설치가 완료되면 서버가 이미 실행되어야 한다. 🙂

StopDefaultStartRADServer-1308721.png

그러면 다음 호출이 정상 작동해야 한다.(대상 시스템의 Internet Explorer 에서)

http://localhost/radserver/emsserver.dll

또는

http://localhost/radserver/emsserver.dll/버전

Internet Explorer에서 JSON 파일을 인식하지 못할수도 있다.

VersionInfoEMSServer-1661415.png

(선택사항)IE에서 JSON 파일을 인식하려면 다음 코드를 *.reg 확장자 파일을 만들어 실행하면 된다.

;
; Tell IE to open JSON documents in the browser. 
; 25336920-03F9-11cf-8FD0-00AA00686F13 is the CLSID for the "Browse in place" .
;
 
[HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/json]
"CLSID"="{25336920-03F9-11cf-8FD0-00AA00686F13}"
"Encoding"=hex:08,00,00,00
 
[HKEY_CLASSES_ROOT\MIME\Database\Content Type\text/json]
"CLSID"="{25336920-03F9-11cf-8FD0-00AA00686F13}"
"Encoding"=hex:08,00,00,00

그러면, IE에서도 작동한다.

IEOK-9733713.png

비고, 

  • RADServer.exe 설치에는 EMSServer.ini(C:\Users\Public\Documents\Embarcadero\EMS\emsserver.ini) 파일 구성이 포함되며, 중요한 매개변수들이 설정되어 있다.
  • 파일의 위치는 다음 레지스트리에 저장된다.
    HKEY_LOCAL_MACHINE\SOFTWARE\Embarcadero\EMS
  • 개발한 BPL 파일은 파일 시스템 어느 곳에나 있을 수 있지만, EMSServer.ini의 [Server.Packages] 섹션에 등록해야 한다.
  • 만약, RAD 서버 콘솔(http://localhost/radconsole/emsconsole.dll)이 LOADING만 제공하는 경우가 있을 수 있다.
    EMSConsoleLoading-8531388.png
    해결책: "C:\inetpub\RADServer\radconsole\EMSDevConsole.exe"를 실행하고 로그인(consoleuser / consolepass)하면 정상 작동한다.(8081 포트 접속 후 80번 포트 접속)
    RADConsoleLogin-9308841.png
    로그인 이후 80번 포트로 접속
     
    RADConsolePort80-3176466.png

참고자료

이 댓글 링크
다른 사이트에 공유하기

  • 험프리 changed the title to RAD 서버를 윈도우 서버 2019 IIS 10 환경에 설치하기

이 토의에 참여하세요

지금 바로 의견을 남길 수 있습니다. 그리고 나서 가입해도 됩니다. 이미 회원이라면, 지금 로그인하고 본인 계정으로 의견을 남기세요.

Guest
이 토픽(기고/질문)에 답하기

×   서식있는 텍스트로 붙여넣기.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   이전에 작성한 콘텐츠가 복원되었습니다..   편집창 비우기

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

중요한 정보

이용약관 개인정보보호정책 이용규칙 이 사이트가 더 잘 작동하기 위해 방문자의 컴퓨터에 쿠키가 배치됩니다. 쿠키 설정 변경에서 원하는 설정을 할 수 있습니다. 변경하지 않으면 쿠키를 허용하는 것으로 이해합니다.