ThingWorx Flow > ThingWorx Flow 설치 및 관리 > ThingWorx Flow 업데이트
ThingWorx Flow 업데이트
다음 버전에 대해 ThingWorx Flow 업데이트가 수동으로 지원됩니다.
이전 버전의 8.4.x에서 최신 버전의 8.4.x로
8.4.x에서 8.5.x로
이전 버전의 8.5.x에서 최신 버전의 8.5.x로
* 
새로 설치한 ThingWorx Flow 8.4.x에서 9.x로의 수동 업그레이드를 사용할 수 없습니다. 새로 설치한 ThingWorx Flow 8.4.x를 9.x로 업그레이드하려면 ThingWorx Flow를 마이그레이션해야 합니다.
* 
새로 설치한 ThingWorx Flow 8.5.x 이상을 9.x로 업그레이드하려면 ThingWorx Flow 자동 업그레이드 설치 관리자를 사용해야 합니다.
이 절차에서는 현재 <older-8.x.x>를 사용 중이며 <newer-8.x.x>로 업데이트하려고 한다고 가정합니다.
사전 요구 사항
ThingWorx Flow를 업데이트하기 전에 다음 사전 요구 사항을 설정했는지 확인하십시오.
서비스에 대해 설치된 모든 파일을 수정하는 데 필요한 권한이 있습니다.
PTC 소프트웨어 다운로드 웹 사이트에서 운영 체제에 적절한 ThingWorx Flow 패치 업데이트 <newer-8.x.x> 버전을 다운로드했습니다.
이 프로세스의 주요 단계는 다음과 같습니다.
1단계: ThingWorx FoundationThingWorx Flow 서비스 중지
운영 체제에 따라 서비스 제어 도구인 sc 또는 서비스(Windows의 경우) 및 sysctl(Linux의 경우)을 사용하여 다음 서비스를 중지합니다.
ThingWorxOrchestrationNginx 또는 nginx
ThingWorx-Foundation
ThingWorx-Flow
RabbitMQ/rabbitmq.service
해당하는 프로세스가 모두 완전히 중지되었는지 확인합니다. 실행 중인 프로세스로 인해 폴더를 업데이트하는 동안 이후 단계에서 문제가 발생할 수 있습니다.
2단계: 기존 설치 백업
다음을 포함(이에 국한되지 않음)하여 기존 설치를 백업합니다.
ThingWorx Foundation 설치 폴더의 ThingworxPlatformThingworxStorage 폴더
ThingWorx Flow 구성 요소가 설치된 ThingworxOrchestration 폴더
ThingWorx FoundationThingWorx Flow 데이터베이스
기본 제공된 시설을 사용하여 데이터베이스 솔루션으로 백업을 만드는 것이 좋습니다.
PostgreSQL에서 pg_dump 도구를 사용합니다. Microsoft SQL Server에서 SQL Server Management Studio를 사용합니다.
가상 컴퓨터에 ThingWorx Flow 및/또는 ThingWorx Foundation이 설치되어 있는 경우 기본 스냅샷 기능을 사용하여 업데이트를 롤백합니다. 스냅샷으로 되돌리는 경우 데이터베이스가 별도의 서버 또는 가상 컴퓨터에 호스팅되어 있으면 데이터베이스 백업을 복원해야 합니다.
3단계: ThingWorx Foundation을 <newer–8.x.x> 업데이트
8.4.x에서 8.5.x로 업데이트하는 경우 Upgrading to ThingWorx 8.5(ThingWorx 8.5로 업그레이드) 안내서에서 운영 체제 및 데이터베이스 유형에 적합한 단원을 참조하십시오.
이전 버전의 8.4.x에서 최신 버전의 8.4.x로 업데이트하거나, 이전 버전의 8.5.x 버전을 최신 버전의 8.5.x로 업데이트하는 경우 Thingworx.war 파일만 바꿀 수도 있습니다.
4단계: ThingWorx Flow 업데이트 tar 콘텐츠를 임시 폴더에 추출
1. /ThingworxOrchestration 폴더에서 새 폴더인 modules-<newer-8.x.x>를 만듭니다.
modules-<newer-8.x.x> 폴더는 기존 modules 폴더에 평행해야 합니다.
2. flow-upgrade-<newer-8.x.x>.tar.gz 패치 업데이트의 콘텐츠를 modules-<newer-8.x.x> 폴더에 추출합니다.
tar의 콘텐츠 압축을 푼 후에는 /ThingworxOrchestration/modules-<newer-8.x.x>/ 폴더에 다음 폴더가 있어야 합니다.
configs
db_seed
engine
exchange
lookup
oauth
8.4.12 이상, 8.5.8 이상 - ptc-flow-pm2 / pm2
README.pdf
static-ux
symphony-cli
symphony-connectors
symphony-deploy
symphony-sdk
symphony-test-helper
trigger
tw-security-common-nodejs
ux
(Windows에만 해당) 8.4.12 이상, 8.5.8 이상 - nginx-1.18.0.zip
(Windows에만 해당) 8.4.12 이상, 8.5.8 이상 - node-v12.16.3-win-x64.tar.gz
8.4.15 이상, 8.5.11 이상 - node-v12.19.0-win-x64.tar.gz
5단계: ThingWorx Flow 서비스를 해당 패치된 버전으로 바꾸기
1. 기존 ThingWorx Flow 구성 설정을 패치 소프트웨어와 병합하려면 기존 ThingWorxOrchestration/modules/ 폴더에서 /ThingWorxOrchestration/modules-<newer-8.x.x> 폴더로 다음 특정 파일 또는 폴더를 복사합니다.
복사 원본
복사 대상
/ThingworxOrchestration/modules/db_seed/config
/ThingworxOrchestration/modules-<newer-8.x.x>/db_seed/
/ThingworxOrchestration/modules/db_seed/migration_config.json
/ThingworxOrchestration/modules-<newer-8.x.x>/db_seed/
/ThingworxOrchestration/modules/db_seed/SHA1
선택 사항(존재하는 경우만 해당)
/ThingworxOrchestration/modules-<newer-8.x.x>/db_seed/
/ThingworxOrchestration/modules/engine/config
/ThingworxOrchestration/modules-<newer-8.x.x>/engine/
/ThingworxOrchestration/modules/engine/deploymentConfig.json
/ThingworxOrchestration/modules-<newer-8.x.x>/engine/
/ThingworxOrchestration/modules/engine/SHA1
선택 사항(존재하는 경우만 해당)
/ThingworxOrchestration/modules-<newer-8.x.x>/engine/
/ThingworxOrchestration/modules/exchange/config
/ThingworxOrchestration/modules-<newer-8.x.x>/exchange/
/ThingworxOrchestration/modules/exchange/deploymentConfig.json
/ThingworxOrchestration/modules-<newer-8.x.x>/exchange/
/ThingworxOrchestration/modules/exchange/SHA1
선택 사항(존재하는 경우만 해당)
/ThingworxOrchestration/modules-<newer-8.x.x>/exchange/
/ThingworxOrchestration/modules/lookup/config
/ThingworxOrchestration/modules-<newer-8.x.x>/lookup/
/ThingworxOrchestration/modules/lookup/deploymentConfig.json
/ThingworxOrchestration/modules-<newer-8.x.x>/lookup/
/ThingworxOrchestration/modules/lookup/SHA1
선택 사항(존재하는 경우만 해당)
/ThingworxOrchestration/modules-<newer-8.x.x>/lookup/
/ThingworxOrchestration/modules/oauth/config
/ThingworxOrchestration/modules-<newer-8.x.x>/oauth/
/ThingworxOrchestration/modules/oauth/deploymentConfig.json
/ThingworxOrchestration/modules-<newer-8.x.x>/oauth/
/ThingworxOrchestration/modules/oauth/SHA1
선택 사항(존재하는 경우만 해당)
/ThingworxOrchestration/modules-<newer-8.x.x>/oauth/
/ThingworxOrchestration/modules/static-ux/config
/ThingworxOrchestration/modules-<newer-8.x.x>/static-ux/
/ThingworxOrchestration/modules/static-ux/SHA1
선택 사항(존재하는 경우만 해당)
/ThingworxOrchestration/modules-<newer-8.x.x>/static-ux/
/ThingworxOrchestration/modules/trigger/config
/ThingworxOrchestration/modules-<newer-8.x.x>/trigger/
/ThingworxOrchestration/modules/trigger/deploymentConfig.json
/ThingworxOrchestration/modules-<newer-8.x.x>/trigger/
/ThingworxOrchestration/modules/trigger/SHA1
선택 사항(존재하는 경우만 해당)
/ThingworxOrchestration/modules-<newer-8.x.x>/trigger/
/ThingworxOrchestration/modules/ux/config
/ThingworxOrchestration/modules-<newer-8.x.x>/ux/
/ThingworxOrchestration/modules/ux/deploymentConfig.json
/ThingworxOrchestration/modules-<newer-8.x.x>/ux/
/ThingworxOrchestration/modules/ux/SHA1
선택 사항(존재하는 경우만 해당)
/ThingworxOrchestration/modules-<newer-8.x.x>/ux/
/ThingworxOrchestration/modules/orchestration.pm2.json
/ThingworxOrchestration/modules-<newer-8.x.x>/
/ThingworxOrchestration/modules/cache
/ThingworxOrchestration/modules-<newer-8.x.x>/
/ThingworxOrchestration/modules/node_modules/config
/ThingworxOrchestration/modules-<newer-8.x.x>/symphony-connectors/node_modules/
2. 다음 폴더와 파일을 /ThingworxOrchestration/modules-<newer-8.x.x>/symphony-connectors/에서 /ThingworxOrchestration/modules-<newer-8.x.x>/로 이동합니다.
node_modules
package.json
package-lock.json
3. /ThingworxOrchestration/modules-<newer-8.x.x>/에서 빈 symphony-connectors 폴더를 삭제합니다.
4. ThingWorx Flow 8.4.x에서 ThingWorx Flow 8.5.x로 업그레이드하는 경우 /ThingworxOrchestration/modules-<newer-8.x.x>/engine/ 폴더 아래의 deploymentConfig.json 파일에 다음 줄을 추가합니다.
"ENGINE_SIZE": "1802",
"KILL_WORKER_AFTER_RUN": "false",
"AVAILABLE_WORKER_CHECK_TRIES": "10",
"AVAILABLE_WORKER_CHECK_INTERVAL": "3000",
"WORKER_DISMISS_INTERVAL": "1800",
5. ThingWorx Flow 8.4.x에서 ThingWorx Flow 8.5.x로 업그레이드하는 경우 /ThingworxOrchestration/modules-<newer-8.x.x>/ux/ 폴더 아래의 deploymentConfig.json 파일에 다음 줄을 추가합니다.
"EXCHANGE": {
"HOST": "localhost",
"PORT": "7822"
},
"lookup": {
"host": "http://localhost:8077"
},
6. 흐름 유틸리티를 업데이트하려면 다음 단계를 수행합니다.
a. /ThingWorxOrchestration/packages에서 다음 폴더를 삭제합니다.
symphony-cli
symphony-deploy
symphony-sdk
symphony-test-helper
b. 다음 폴더를 /ThingworxOrchestration/modules-<newer-8.x.x>에서 /ThingWorxOrchestration/packages로 이동합니다.
symphony-cli
symphony-deploy
symphony-sdk
symphony-test-helper
c. ThingWorx Flow를 설치한 사용자에게 모든 흐름 유틸리티에 대한 완전한 소유권 및 권한이 있는지 확인합니다.
예를 들어, /ThingWorxOrchestration/packages 폴더로 이동하고 다음 명령을 실행합니다.
chown -R flowuser:flowuser symphony-cli
flowuserThingWorx Flow 설치 관리자를 실행한 사용자로 바꿉니다.
7. (Linux에만 해당) ThingWorx Flow를 설치한 사용자에게 modules-<newer-8.x.x> 폴더에 대한 완전한 소유권 및 권한이 있는지 확인합니다.
ThingWorxOrchestration 폴더로 이동하고 다음 명령을 실행합니다.
chown -R flowuser:flowuser modules-<newer-8.x.x>
flowuserThingWorx Flow 설치 관리자를 실행한 사용자로 바꿉니다.
8. (Windows에만 해당) RabbitMQ 폴더를 modules 폴더에서 modules-<newer-8.x.x> 폴더로 복사합니다.
9. 모든 구성 설정을 복사한 후에는 다음 폴더의 이름을 변경해야 합니다.
a. 기존 modules 폴더의 이름을 modules-<이전 버전-8.x.x>로 바꿉니다.
b. modules-<newer-8.x.x> 폴더의 이름을 modules로 바꿉니다.
* 
Windows에서 폴더의 이름을 바꾸기 전에 epmd.exe 프로세스를 중지해야 합니다.
예를 들어, Linux 폴더의 이름을 바꾸려면 다음 명령을 실행합니다.
a. mv /ThingworxOrchestration/modules /ThingworxOrchestration/modules-<이전 버전-8.x.x>
b. mv /ThingworxOrchestration/modules-<newer-8.x.x> /ThingworxOrchestration/modules
10. (Linux에만 해당) ThingWorxOrchestration 폴더로 이동한 후 다음 명령을 실행하여 modules 폴더에 대한 전체 권한을 설정합니다.
chmod -R 777 modules
11. (Linux에만 해당) ThingWorxOrchestration/modules 폴더로 이동한 후 다음 명령을 실행하여 static-ux 폴더에 대한 올바른 보안 컨텍스트를 설정합니다.
chcon -R -t httpd_sys_content_t static-ux
12. 다음 폴더의 이름을 바꾸고 해당 폴더를 이동합니다.
a. /ThingWorxOrchestration/cryptography에 있는 기존 tw-security-common-nodejs 폴더의 이름을 tw-security-common-nodejs_<이전 버전-8.x.x>로 바꿉니다.
b. /ThingworxOrchestration/modules/에서 /ThingWorxOrchestration/cryptographytw-security-common-nodejs 폴더를 이동합니다.
c. ThingWorx Flow를 설치한 사용자에게 tw-security-common-nodejs 폴더에 대한 완전한 소유권 및 권한이 있는지 확인합니다.
예를 들어, /ThingWorxOrchestration/cryptography 폴더로 이동하고 다음 명령을 실행합니다.
chown -R flowuser:flowuser tw-security-common-nodejs
flowuserThingWorx Flow 설치 관리자를 실행한 사용자로 바꿉니다.
d. 8.4.x로 업데이트하는 경우 /ThingWorxOrchestration/cryptography/tw-security-common-nodejs 폴더로 이동하고 다음 명령을 실행합니다.
Windows에서 npm install을 실행합니다.
Linux에서 sudo npm install을 실행합니다.
Linux에서 sudo chown -R flowuser:flowuser node_modules를 실행합니다.
flowuserThingWorx Flow 설치 관리자를 실행한 사용자로 바꿉니다.
6단계: Nginx, PM2 및 NodeJS를 아직 업데이트하지 않은 경우 업데이트합니다(8.4.12 이상, 8.5.8 이상).
다음 버전을 이미 사용하고 있는 경우 이 단계를 건너뜁니다.
Nginx - 1.18.0
PM2 - 4.4.0
NodeJS - 12.19.x
* 
이 단계를 건너뛰는 경우 modules 폴더에서 다음 폴더를 삭제합니다.
ptc-flow-pm2 / pm2
nginx-1.18.0.zip
node-v12.19.0-win-x64.tar.gz
Nginx
Windows
1. C:\Program Files\nginx-1.13.12C:\Program Files\nginx-1.13.12_old로 이름을 바꿉니다.
2. <Flow 설치 디렉터리>\modules에서 C:\Program Filesnginx-1.18.0.zip의 압축을 풉니다. C:\Program Files\nginx-1.18.0\nginx.exe가 있는지 확인합니다.
3. C:\Program Files\nginx-1.18.0C:\Program Files\nginx-1.13.12로 이름을 바꿉니다.
4. C:\Program Files\nginx-1.13.12\conf\nginx.conf 파일을 C:\Program Files\nginx-1.13.12_old\conf\nginx.conf 파일로 대체합니다.
5. C:\Program Files\nginx-1.13.12_old\conf\conf.d 파일을 C:\Program Files\nginx-1.13.12\conf\에 복사합니다.
6. <Flow 설치 디렉터리>\modules에서 nginx-1.18.0.zip을 삭제합니다.
Linux
1. 다음 콘텐츠를 사용하여 /etc/yum.repos.d/nginx.repo 파일을 만듭니다.
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
2. sudo yum upgrade nginx 명령을 실행합니다.
PM2
Windows
1. <Flow 설치 디렉터리>\packages\ptc-flow-pm2\node_modules\pm2-windows-service-nosetup\src\daemon 폴더를 백업합니다.
ThingWorx Flow 8.4.x를 사용하는 경우, ptc-flow-pm2 폴더는 pm2이라는 이름으로 되어 있습니다.
2. <Flow 설치 디렉터리>\packages\ptc-flow-pm2 폴더의 이름을 ptc-flow-pm2_old로 바꿉니다.
ThingWorx Flow 8.4.x를 사용하는 경우, pm2의 이름을 pm2_old로 바꿉니다.
3. 8.4.x에서 업데이트하는 경우 다음을 수행합니다.
a. pm2 폴더를 <Flow 설치 디렉터리>\modules에서 <Flow 설치 디렉터리>\packages로 이동한 다음 이름을 pm2로 바꿉니다.
b. 다음 경로가 유효하도록 <Flow 설치 디렉터리>\packages\pm2\node_modules\pm2-windows-service-nosetup\src\daemon\thingworxflow.xml 파일을 편집합니다.
<argument>C:\ThingWorxOrchestration\packages\pm2\node_modules\node-windows\lib\wrapper.js</argument>
c. 경로 환경 변수에 다음을 추가합니다.
C:\ThingWorxOrchestration\packages\pm2\node_modules\.bin
d. 다음 환경 변수를 추가합니다.
PM2_SERVICE_PM2_DIR = C:\ThingWorxOrchestration\packages\pm2\node_modules\pm2
4. 8.5.x에서 업데이트하는 경우, <Flow 설치 디렉터리>\packages\ptc-flow-pm2<Flow 설치 디렉터리>\modulesptc-flow-pm2 폴더로 바꿉니다.
5. 백업한 디몬 디렉터리를 <Flow 설치 디렉터리>\packages\ptc-flow-pm2\node_module\pm2-windows-service-nosetup\src에 복사합니다.
ThingWorx Flow 8.4.x를 사용하는 경우, ptc-flow-pm2 폴더는 pm2이라는 이름으로 되어 있습니다.
Linux
1. <Flow 설치 디렉터리>/packages/ptc-flow-pm2<Flow 설치 디렉터리>\modulesptc-flow-pm2 폴더로 바꿉니다.
ThingWorx Flow 8.4.x를 사용하는 경우, packages 아래의 ptc-flow-pm2 폴더는 pm2라는 이름으로 되어 있습니다.
2. 8.4.x에서 업데이트하는 경우 다음을 수행합니다.
a. <Flow 설치 디렉터리>/packages/pm2 폴더의 이름을 pm2_old로 바꿉니다.
b. ptc-flow-pm2 폴더를 <Flow 설치 디렉터리>/modules에서 <Flow 설치 디렉터리>/packages로 이동한 다음 이름을 pm2로 바꿉니다.
NodeJS
Windows
1. <Flow 설치 디렉터리>\modules에서 node-v12.19.0-win-x64.tar.gz의 압축을 풉니다.
2. <Flow 설치 디렉터리>\node 폴더를 압축을 푼 폴더로 대체합니다.
3. <Flow 설치 디렉터리>\modules에서 node-v12.19.0-win-x64.tar.gz를 삭제합니다.
Linux
다음 명령을 실행합니다.
1. sudo su
2. sudo curl -sL https://rpm.nodesource.com/setup_12.x | bash
3. sudo yum install nodejs
4. sudo yum remove rh-nodejs8
5. sudo rm -R /opt/rh
7단계: Nginx에서 업로드 크기를 1GB로 제한합니다(8.4.x에서 8.5.x로 업그레이드하는 경우에만).
1. <Nginx 구성 디렉터리>\conf.d\vhost-flow.conf 파일에서 다음 줄을 찾습니다.
client_max_body_size 18M;
2. 값을 18M에서 1000M로 업데이트합니다.
3. 결과가 다음과 같은지 확인합니다.
client_max_body_size 1000M;
8단계: Nginx 개인 키를 암호화합니다(8.4.14 이상, 8.5.10 이상).
다음 섹션에서는 기본 제공 키 파일을 암호화하기 위해 수행해야 하는 단계에 대해 설명합니다. 다른 .key 파일을 사용하는 경우 모든 orchestration.key 참조를 키 파일 이름으로 바꿉니다.
1. <Flow 설치 디렉터리>\SSL 폴더 아래에서 암호화된 개인 키에 대한 암호를 포함하는 nginx-keyfile 파일을 만듭니다.
2. openssl 유틸리티를 사용하여 다음 명령을 실행합니다.
<openssl_cmd> rsa -aes256 -passout pass:<nginx-keyfile에 정의된 암호와 동일한 암호> -in "<Flow 설치 디렉터리>\SSL\orchestration.key" -out "<Flow 설치 디렉터리>\SSL\orchestration_enc.key"
Windows: <openssl_cmd> - cd C:/opscode/chef/embedded/bin를 실행한 다음 openssl을 입력하고 위 명령을 실행합니다.
Linux: <openssl_cmd> - openssl을 입력하고 위 명령을 실행합니다.
3. orchestration.key를 삭제하고 orchestration_enc.key의 이름을 orchestration.key로 변경합니다.
4. <Nginx 구성 디렉터리>\conf.d\vhost-flow.conf 파일에서 ssl_certificate_key 매개 변수 다음에 다음 줄을 추가합니다.
ssl_password_file "<Flow 설치 디렉터리>\SSL\nginx-keyfile";
여기서, Windows의 경우 <Nginx 구성 디렉터리>C:\Program Files\nginx-1.18.0\conf이며 Linux의 경우 /etc/nginx입니다.
5. (Linux에만 해당) 다음 명령을 실행합니다.
a. sudo chown flowuser:flowuser <Flow 설치 디렉터리>\SSL\orchestration.key - 여기서 flowuserThingWorx Flow 설치 관리자를 실행한 사용자입니다.
b. sudo chcon -t httpd_sys_content_t <Flow 설치 디렉터리>\SSL\orchestration.key
c. sudo chown flowuser:flowuser <Flow 설치 디렉터리>\SSL\nginx-keyfile - 여기서 flowuserThingWorx Flow 설치 관리자를 실행한 사용자입니다.
d. sudo chcon -t httpd_sys_content_t <Flow 설치 디렉터리>\SSL\nginx-keyfile
9단계: Nginx 구성에서 보안을 변경합니다(8.4.14 이상, 8.5.10 이상).
1. <Nginx 구성 디렉터리>\nginx.conf 파일을 업데이트하여 Nginx에서 무차별 암호 대입 공격으로부터 보호하고 속도 제한 메커니즘을 설정합니다. 이 메커니즘을 설정하면 특정 IP 주소에서 수행되는 요청의 수가 제한됩니다.
a. 다음 줄을 찾습니다.
# limit_req_zone $limit_key zone=by_ip:10m rate=100r/s;
# limit_req_zone $limit_method zone=post:10m rate=20r/s;
# limit_req_zone $request_uri zone=by_uri:10m rate=500r/m;
# # limit_req_zone "$binary_remote_addr$request_uri" zone=by_uri_ip:10m rate=2r/s;
# # limit_req_zone $http_authorization zone=by_oauth_token:100m rate=1r/m;
# limit_req_status 429;
b. 첫 번째와 마지막 줄의 주석 처리를 제거합니다.
c. 첫 번째 줄에서 속도를 500r/s로 수정합니다.
* 
속도(초당 요청 수)를 다른 숫자로 설정할 수 있습니다. 그러나, 500r/s는 불법 클라이언트가 도달할 수 없는 합리적인 초당 요청 수입니다.
d. 결과가 다음과 같은지 확인합니다.
limit_req_zone $limit_key zone=by_ip:10m rate=500r/s;
# limit_req_zone $limit_method zone=post:10m rate=20r/s;
# limit_req_zone $request_uri zone=by_uri:10m rate=500r/m;
# # limit_req_zone "$binary_remote_addr$request_uri" zone=by_uri_ip:10m rate=2r/s;
# # limit_req_zone $http_authorization zone=by_oauth_token:100m rate=1r/m;
limit_req_status 429;
2. <Nginx 구성 디렉터리>\nginx.conf 파일을 업데이트하여 캐시 컨트롤 헤더를 캐시 없음으로 설정합니다.
a. 다음 줄을 찾습니다.
map $sent_http_content_type $expires {
b. text/html의 값을 -1로 변경합니다.
c. 결과가 다음과 같은지 확인합니다.
map $sent_http_content_type $expires {
default off;
text/html -1;
text/css 30d;
application/javascript 7d;
~image/ 30d;
}
3. <Nginx 구성 디렉터리>\conf.d\vhost-flow.conf 파일을 업데이트하여 HEAD HTTP 메서드를 차단합니다.
a. 다음 줄을 찾습니다.
if ($scheme = "https") {
set $secure_var "secure";
}
b. 위의 줄 앞에 다음 줄을 추가합니다.
# block 'head' http method for security reasons
if ($request_method = 'HEAD') {
return 405;
}
c. 결과가 다음과 같은지 확인합니다.
set $proxy_scheme $scheme;
# block 'head' http method for security reasons
if ($request_method = 'HEAD') {
return 405;
}
if ($scheme = "https") {
set $secure_var "secure";
}
4. <Nginx 구성 디렉터리>\conf.d\vhost-flow.conf 파일을 업데이트하여 location ~ ^(/config|/js|/locales|/resources)로의 외부 리디렉션을 피합니다.
a. 다음 줄을 찾습니다.
location /Thingworx/Flow {
rewrite /Thingworx/Flow/(.*) /$1 break;
try_files $uri $uri/ @flow_api;
}
b. try_files $uri $uri/ @flow_api;try_files $uri @flow_api;로 변경합니다.
c. 위의 줄 다음에 다음 줄을 추가합니다.
# avoid external redirects for bellow locations
location ~ ^(/config|/js|/locales|/resources) {
internal;
}
d. 결과가 다음과 같은지 확인합니다.
location /Thingworx/Flow {
rewrite /Thingworx/Flow/(.*) /$1 break;
try_files $uri @flow_api;
}
# avoid external redirects for bellow locations
location ~ ^(/config|/js|/locales|/resources) {
internal;
}
location @flow_api {
5. <Nginx 구성 디렉터리>\conf.d\vhost-flow.conf 파일을 업데이트하여 다음 위치에 대해 options HTTP 메서드를 차단하고 무차별 암호 대입 공격으로부터 보호하기 위한 속도 제한을 추가합니다.
위치
1단계: 위치 찾기
2단계: 해당 위치 다음에 지정된 콘텐츠 추가
3단계: 지정된 줄의 주석 처리 제거
4단계: 주석 처리가 제거된 줄에 지정된 콘텐츠 추가
5단계: 결과 확인
location /Thingworx/Oauths
location /Thingworx/Oauths {
# limit_req zone=by_ip;
# limit_conn addr 500;
# block 'options' http method for security reasons
if ($request_method = 'OPTIONS') {
return 405;
}
# limit_req zone=by_ip;
burst=10 nodelay
location /Thingworx/Oauths {
# block 'options' http method for security reasons
if ($request_method = 'OPTIONS') {
return 405;
}
limit_req zone=by_ip burst=10 nodelay;
# limit_conn addr 500;
location /Thingworx/Triggers
location /Thingworx/Triggers {
# limit_req zone=by_ip;
# limit_conn addr 500;
# block 'options' http method for security reasons
if ($request_method = 'OPTIONS') {
return 405;
}
# limit_req zone=by_ip;
burst=10 nodelay
location /Thingworx/Triggers {
# block 'options' http method for security reasons
if ($request_method = 'OPTIONS') {
return 405;
}
limit_req zone=by_ip burst=10 nodelay;
# limit_conn addr 500;
location @flow_api
location @flow_api {
# limit_req zone=by_ip;
# limit_conn addr 500;
# block 'options' http method for security reasons
if ($request_method = 'OPTIONS') {
return 405;
}
# limit_req zone=by_ip;
burst=10 nodelay
location @flow_api {
# block 'options' http method for security reasons
if ($request_method = 'OPTIONS') {
return 405;
}
limit_req zone=by_ip burst=10 nodelay;
# limit_conn addr 500;
6. <Nginx 구성 디렉터리>\conf.d\vhost-flow.conf 파일을 업데이트하여 다음 위치에 대해 무차별 암호 대입 공격으로부터 보호하기 위한 속도 제한을 추가합니다.
위치
1단계: 위치 찾기
2단계: 지정된 줄의 주석 처리 제거
3단계: 주석 처리가 제거된 줄에 지정된 콘텐츠 추가
4단계: 결과 확인
location /Thingworx/Composer/apps/flow
location /Thingworx/Composer/apps/flow {
rewrite /Thingworx/Composer/apps/flow/(.*) /$1 break;
# limit_req zone=by_ip;
# limit_conn addr 500;
# limit_req zone=by_ip;
burst=10 nodelay
location /Thingworx/Composer/apps/flow {
rewrite /Thingworx/Composer/apps/flow/(.*) /$1 break;
limit_req zone=by_ip burst=10 nodelay;
# limit_conn addr 500;
location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff2?)$
location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff2?)$ {
rewrite /Thingworx/Composer/apps/flow/(.*) /$1 break;
# limit_req zone=by_ip burst=10 nodelay;
expires $expires;
# limit_req zone=by_ip burst=10 nodelay;
-
location ~* \.(jpg|jpeg|png|gif|ico|css|js|svg|woff2?)$ {
rewrite /Thingworx/Composer/apps/flow/(.*) /$1 break;
limit_req zone=by_ip burst=10 nodelay;
expires $expires;
location /Thingworx/Lookups
location /Thingworx/Lookups {
# limit_req zone=by_ip;
burst=10 nodelay
location /Thingworx/Lookups {
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET,POST,PUT,DELETE,OPTIONS,HEAD';
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Length, X-Requested-With, application_uid, application_id, application_api_key, authtoken, Content-Type';
add_header 'Access-Control-Max-Age' '1728000';
if ($request_method = 'OPTIONS') {
return 200;
}
limit_req zone=by_ip burst=10 nodelay;
# limit_conn addr 500;
location /Thingworx/WS
location /Thingworx/WS {
# limit_req zone=by_ip;
burst=10 nodelay
location /Thingworx/WS {
limit_req zone=by_ip burst=10 nodelay;
# limit_conn addr 500;
location /Thingworx/RemoteTunnel
location /Thingworx/RemoteTunnel {
# limit_req zone=by_ip;
burst=10 nodelay
location /Thingworx/RemoteTunnel {
limit_req zone=by_ip burst=10 nodelay;
# limit_conn addr 500;
location /Thingworx/WSTunnelClient/
location /Thingworx/WSTunnelClient/ {
# limit_req zone=by_ip;
burst=10 nodelay
location /Thingworx/WSTunnelClient/ {
limit_req zone=by_ip burst=10 nodelay;
# limit_conn addr 500;
location /Thingworx/WSTunnelServer/
location /Thingworx/WSTunnelServer/ {
# limit_req zone=by_ip;
burst=10 nodelay
location /Thingworx/WSTunnelServer/ {
limit_req zone=by_ip burst=10 nodelay;
# limit_conn addr 500;
location /Thingworx
location /Thingworx {
# limit_req zone=by_ip;
burst=10 nodelay
location /Thingworx {
limit_req zone=by_ip burst=10 nodelay;
# limit_conn addr 500;
(선택 사항) 10단계: ThingWorx FoundationThingWorx Flow의 구성 변경
필요한 경우 ThingWorx FoundationThingWorx Flow 서비스의 구성을 변경합니다.
패치에서 새 구성 설정을 도입하는 경우 이 작업이 필요할 수 있습니다. 새 구성 설정 및 해당 설정을 사용할 수 있는 파일에 대한 자세한 내용은 릴리즈 정보를 참조하십시오.
11단계: ThingWorx Flow에 대한 최신 업데이트로 데이터베이스 다시 시드
ThingWorx Flow 데이터베이스를 다시 시드하는 경우 워크플로 또는 트리거와 같은 기존 사용자 소유 엔티티에는 영향을 주지 않습니다.
1. 명령 프롬프트를 실행하고 /ThingWorxOrchestration/modules/db_seed로 이동합니다.
2. 다음 명령을 실행합니다.
flow-deploy migrate -u <흐름 DB 사용자 이름> -p <흐름 DB 암호> -s <흐름 설치 디렉터리>
Linux에서 루트가 아닌 사용자로 flow-deploy 명령을 실행합니다.
(선택 사항) 12단계: 사용자 정의 커넥터 배포
* 
ThingWorx Flow SDK를 사용하여 사용자 정의 커넥터를 개발한 경우에만 이 단원의 단계를 완료합니다.
1. 소스 코드를 동일한 시스템에서 사용할 수 있는지 확인합니다.
2. 커넥터의 루트 디렉터리로 이동하고 flow-deploy connector 명령을 실행합니다.
자세한 내용은 커넥터 배포를 참조하십시오.
3. 다음 명령을 실행하여 데이터베이스에서 사용자 정의 커넥터를 시드합니다.
flow-deploy migrate -u <흐름 DB 사용자 이름> -p <흐름 DB 암호> -s <흐름 설치 디렉터리>
13단계: 서비스 시작 및 상태 확인
1. 1단계에서 중지된 서비스를 다음 순서대로 시작합니다.
a. RabbitMQ/rabbitmq.service
* 
다음 서비스를 시작하기 전에 RabbitMQ 로그를 확인하여 RabbitMQ 서비스가 완전히 시작되었는지 확인합니다.
Windows: /ThingworxOrchestration/modules/RabbitMQ/log/rabbit@{호스트 이름}.log
Linux: /var/log/rabbitmq/rabbit@{호스트 이름}.log
b. ThingWorx-Foundation
c. ThingWorx-Flow
d. ThingWorxOrchestrationNginx 또는 nginx
2. ThingWorx Foundation 로그를 검토하고 시작하는 동안 예기치 않은 오류 또는 경고가 발생하지 않았는지 확인합니다.
3. ThingWorx Flow가 제대로 업데이트되었는지 확인하려면 관리자 권한으로 명령 프롬프트를 시작하고 다음 명령을 실행합니다.
pm2 ls
다음 ThingWorx Flow 구성 요소의 상태는 '온라인'이어야 합니다.
flow-api
flow-engine
flow-exchange
flow-lookup
flow-oauth-server
flow-trigger
개별 서비스의 로그를 보려면 pm2 logs <서비스 이름> 명령을 실행합니다.
14단계: 워크플로 하위 시스템 재시작
1. ThingWorx Foundation에 로그인합니다.
2. 하위 시스템 > 워크플로 하위 시스템으로 이동합니다.
3. 재시작을 클릭합니다.
15단계: 기능이 예상대로 작동하는지 확인
ThingWorx FoundationThingWorx Flow의 기능을 테스트하여 예상대로 작동하는지 확인합니다. ThingWorx Composer 및 워크플로 편집기에서 워크플로를 작성할 수 있는지 확인합니다. 예를 들어, 다음 작업을 수행할 수 있습니다.
ThingWorx Flow 대시보드에 로그인합니다. ThingWorx FlowThingWorx Composer에 액세스하는 방법을 알려면 ThingWorx Flow 및 ThingWorx Composer 액세스를 참조하십시오.
사용할 각 커넥터에 대해 승인연결을 작성합니다.
16단계: tw-security-common-nodejs_<이전 버전-8.x.x> 폴더 삭제
/ThingWorxOrchestration/cryptography 폴더에서 tw-security-common-nodejs_<이전 버전-8.x.x> 폴더를 삭제합니다.
(선택 사항) 17단계: modules-<이전 버전-8.x.x> 폴더 삭제
업데이트가 성공하고 흐름이 성공적으로 실행 중인지 검증하고 확인했으며 이전 릴리즈가 더 이상 필요하지 않으면 modules-<older-8.x.x> 폴더를 삭제합니다.
ThingWorx Flow를 성공적으로 업데이트했습니다.
* 
엔진의 흐름 실행이 갑자기 멈추면 ThingWorx Flow 설치 문제 해결 단계를 수행합니다.