환경 설정 파일 예제

본 부록에서는 기본 환경 설정, JEUS 연동 환경 설정, 자주 사용되는 환경 설정의 예제를 제공합니다.

기본 환경 설정

WebtoB의 기본적인 환경 설정 파일 예제입니다.

{
    "node": {
        "name": "mynode"
    },
    "server": {
        "http": {
            "common_config": {
                "doc_root": "docs/",
                "access_log": "accesslog",
                "alias": [
                    "alias"
                ]
            },
            "http_servers": [
                {
                    "name": "http1",
                    "port": [
                        8080
                    ]
                }
            ]
        }
    },
    "service": {
        "uri": [
            {
                "name": "uri",
                "match": {
                    "target": "/htmls/",
                    "rewrite": "/"
                },
                "destination": {
                    "type": "HTMLS",
                    "target": "#default_htmls"
                }
            }
        ],
        "ext": [
            {
                "name": "htm",
                "match": {
                    "target": "htm"
                },
                "destination": {
                    "type": "HTMLS",
                    "target": "#default_htmls"
                }
            }
        ]
    },
    "logging": {
        "system_log": [
            {
                "name": "webtob",
                "handlers": {
                    "file_handler": {
                        "file_name": "log/system_%Y%%M%%D%.log"
                    }
                }
            }
        ],
        "access_log": [
            {
                "name": "accesslog",
                "format": "%h %t \"%r\" %s %b %D",
                "handlers": {
                    "file_handler": {
                        "file_name": "log/access_%Y%%M%%D%.log"
                    }
                }
            }
        ],
        "error_log": {
            "format": "%r",
            "handlers": {
                "file_handler": {
                    "file_name": "log/error_%Y%%M%%D%.log"
                }
            }
        }
    }
}

JEUS 연동 환경 설정

WebtoB 환경 설정

JEUS와 연동하기 위한 WebtoB의 환경 설정 파일 예제입니다.

{
    "node": {
        "name": "mynode"
    },
    "server": {
        "http": {
            "common_config": {
                "doc_root": "docs/",
                "access_log": "accesslog"
            },
            "http_servers": [
                {
                    "name": "http1",
                    "port": [
                        8080
                    ]
                }
            ]
        },
        "wjp": {
            "wjp_servers": [
                {
                    "name": "MyGroup",
                    "port": 9999
                }
            ]
        }
    },
    "destination": {
        "jeus": [
            {
                "name": "MyGroup"
            }
        ]
    },
    "service": {
        "uri": [
            {
                "name": "examples",
                "match": {
                    "target": "/examples/"
                },
                "destination": {
                    "type": "JEUS",
                    "target": "MyGroup"
                }
            }
        ],
        "ext": [
            {
                "name": "jsp",
                "match": {
                    "target": "jsp"
                },
                "destination": {
                    "type": "JEUS",
                    "target": "MyGroup"
                }
            },
            {
                "name": "htm",
                "match": {
                    "target": "htm"
                },
                "destination": {
                    "type": "HTMLS",
                    "target": "#default_htmls"
                }
            },
            {
                "name": "html",
                "match": {
                    "target": "html"
                },
                "destination": {
                    "type": "HTMLS",
                    "target": "#default_htmls"
                }
            }
        ]
    },
    "logging": {
        "system_log": [
            {
                "name": "webtob",
                "handlers": {
                    "file_handler": {
                        "file_name": "log/system_%Y%%M%%D%.log"
                    }
                }
            }
        ],
        "access_log": [
            {
                "name": "accesslog",
                "format": "%h %t \"%r\" %s %b %D",
                "handlers": {
                    "file_handler": {
                        "file_name": "log/access_%Y%%M%%D%.log",
                        "enable_sync": true
                    }
                }
            }
        ],
        "error_log": {
            "format": "%r",
            "handlers": {
                "file_handler": {
                    "file_name": "log/error_%Y%%M%%D%.log"
                }
            }
        }
    }
}

JEUS 환경 설정

WebtoB와 연동하기 위한 JEUS의 환경 설정 파일 예제입니다.

아래 예제는 JEUS 9 기준이며, WebtoB 연결은 <webtob-connector>에 설정합니다.

domain.xml
<?xml version="1.0" encoding="UTF-8"?><domain xmlns="http://www.tmaxsoft.com/xml/ns/jeus" version="9.0">
<webtob-connector>
    <name>webtob-connector</name>
    <thread-pool>
        <min>5</min>
        <max>5</max>
        <max-idle-time>300000</max-idle-time>
        <max-queue>-1</max-queue>
        <thread-state-notify>
            <max-thread-active-time>0</max-thread-active-time>
            <interrupt-thread>false</interrupt-thread>
            <active-timeout-notification>false</active-timeout-notification>
            <notify-threshold-ratio>0.0</notify-threshold-ratio>
            <restart-threshold-ratio>0.0</restart-threshold-ratio>
        </thread-state-notify>
    </thread-pool>
    <postdata-read-timeout>30000</postdata-read-timeout>
    <max-post-size>-1</max-post-size>
    <max-parameter-count>-1</max-parameter-count>
    <max-header-count>-1</max-header-count>
    <max-header-size>8192</max-header-size>
    <max-querystring-size>8192</max-querystring-size>
    <wjp-version>2</wjp-version>
    <registration-id>MyGroup</registration-id>
    <hth-count>1</hth-count>
    <connection-count>5</connection-count>
    <threshold>-1</threshold>
    <use-nio>false</use-nio>
    <network-address>
        <port>9999</port>
        <ip-address>localhost</ip-address>
    </network-address>
    <read-timeout>120000</read-timeout>
    <reconnect-interval>5000</reconnect-interval>
    <reconnect-count-for-backup>12</reconnect-count-for-backup>
    <request-prefetch>false</request-prefetch>
</webtob-connector>

자주 사용되는 환경 설정

WebtoB에서 자주 사용하는 설정이 포함된 환경 설정 파일의 예제입니다.

{
    "node": {
        "name": "mynode",
    },
    "server": {
        "http": {
            "common_config": {
                "doc_root": "docs/",
                "error_document": [
                    "400",
                    "401",
                    "403",
                    "404",
                    "405",
                    "503"
                ],
                "access_log": "acc_node",
                "enable_allow_header_on_405": false
            },
            "http_servers": [
                {
                    "name": "http1",
                    "vhosts": [
                        {
                            "name": "v_tmaxsoft",
                            "common_config": {
                                "doc_root": "docs/",
                                "error_document": [
                                    "400",
                                    "401",
                                    "403",
                                    "404",
                                    "405",
                                    "503"
                                ],
                                "access_log": "acc_tmaxsoft",
                                "enable_url_rewrite": true,
                                "url_rewrite_config": "config/rewrite.conf",
                                "index_name": "blank.html"
                            },
                            "host_name": [
                                "tmaxsoft.com",
                                "www.tmaxsoft.com"
                            ]
                        }
                    ]
                },
                {
                    "name": "http2",
                    "enable_ssl": true,
                    "ssl_name": [
                        "ssl_tmaxsoft"
                    ],
                    "bind_ipv6_only": true,
                    "vhosts": [
                        {
                            "name": "v_tmaxsoft_ssl",
                            "common_config": {
                                "doc_root": "docs/",
                                "error_document": [
                                    "400",
                                    "401",
                                    "403",
                                    "404",
                                    "405",
                                    "503"
                                ],
                                "access_log": "acc_tmaxsoft_ssl",
                                "index_name": "blank.html"
                            },
                            "host_name": [
                                "tmaxsoft.com",
                                "www.tmaxsoft.com"
                            ]
                        }
                    ]
                }
            ],
            "mime_type_file": "config/mime.types"
        },
        "wjp": {
            "port": 9900,
            "wjp_servers": [
                {
                    "name": "tmaxsoft"
                }
            ]
        }
    },
    "destination": {
        "jeus": [
            {
                "name": "tmaxsoft"
            }
        ],
        "reverse_proxy": {
            "reverse_proxy_group": [
                {
                    "name": "rp_rp_tmaxsoft",
                    "reverse_proxy_server": [
                        {
                            "name": "rp_rp_tmaxsoft",
                            "address": "localhost:8443",
                            "enable_proxy_ssl": true,
                            "proxy_ssl_name": [
                                "pssl_v0"
                            ],
                            "common_config": {
                                "server_health_check": {
                                    "enable_name_resolution_on_fail": false
                                }
                            }
                        }
                    ]
                }
            ]
        },
        "htmls": [
            {
                "name": "#default_htmls"
            }
        ]
    },
    "ssl": {
        "ssl_configs": [
            {
                "name": "ssl_tmaxsoft",
                "certificate_file": "ssl/cert.crt",
                "certificate_key_file": "ssl/privkey.key",
                "certificate_chain_file": "ssl/chain.pem",
                "ca_certificate_file": "ssl/rootca.pem",
                "ca_certificate_path": "ssl/",
                "common_config": {
                    "protocols": [
                        "TLSv1.2",
                        "TLSv1.3"
                    ],
                    "required_ciphers": "HIGH:!RSA:!SHA1"
                }
            }
        ],
        "proxy_ssl_configs": [
            {
                "name": "pssl_v0",
                "enable_insecure": true
            }
        ]
    },
    "service": {
        "uri": [
            {
                "name": "u_tmaxsoft_root",
                "target_http_servers": [
                    "http1.v_tmaxsoft",
                    "http2.v_tmaxsoft_ssl"
                ],
                "match": {
                    "target": "/",
                    "goto_ext": true
                },
                "destination": {
                    "type": "JEUS",
                    "target": "tmaxsoft"
                }
            },
            {
                "name": "rp_rp_tmaxsoft",
                "target_http_servers": [
                    "http1.v_tmaxsoft",
                    "http2.v_tmaxsoft_ssl"
                ],
                "match": {
                    "rewrite": "/ws/",
                    "target": "/ws/"
                },
                "destination": {
                    "type": "REVERSE_PROXY",
                    "target": "rp_rp_tmaxsoft"
                }
            },
            {
                "name": "u_tmaxsoft_error",
                "target_http_servers": [
                    "http1.v_tmaxsoft",
                    "http2.v_tmaxsoft_ssl"
                ],
                "match": {
                    "target": "/error"
                },
                "destination": {
                    "type": "HTMLS",
                    "target": "#default_htmls"
                }
            }
        ],
        "ext": [
            {
                "name": "jsp",
                "match": {
                    "target": "jsp"
                },
                "destination": {
                    "type": "JEUS",
                    "target": "tmaxsoft"
                }
            }
        ]
    },
    "logging": {
        "system_log": [
            {
                "name": "webtob",
                "handlers": {
                    "file_handler": {
                        "file_name": "log/system/system_%Y%%M%%D%.log",
                        "enable_sync": true
                    }
                }
            }
        ],
        "access_log": [
            {
                "name": "acc_node",
                "format": "%h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\"",
                "handlers": {
                    "file_handler": {
                        "file_name": "log/node/access_%Y%%M%%D%.log",
                        "enable_sync": true
                    }
                }
            },
            {
                "name": "acc_tmaxsoft",
                "format": "%h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\"",
                "handlers": {
                    "file_handler": {
                        "file_name": "log/tmaxsoft/access_%Y%%M%%D%.log",
                        "enable_sync": true
                    }
                }
            },
            {
                "name": "acc_tmaxsoft_ssl",
                "format": "%h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-Agent}i\"",
                "handlers": {
                    "file_handler": {
                        "file_name": "log/tmaxsoft_ssl/access_%Y%%M%%D%.log",
                        "enable_sync": true
                    }
                }
            }
        ],
        "error_log": {
            "format": "%r",
            "handlers": {
                "file_handler": {
                    "file_name": "log/node/error_%Y%%M%%D%.log",
                    "enable_sync": true
                }
            }
        }
    },
    "error_document": {
        "error_document_list": [
            {
                "name": "400",
                "status": 400,
                "url": "/error/error.html"
            },
            {
                "name": "401",
                "status": 401,
                "url": "/error/error.html"
            },
            {
                "name": "403",
                "status": 403,
                "url": "/error/error.html"
            },
            {
                "name": "404",
                "status": 404,
                "url": "/error/error.html"
            },
            {
                "name": "405",
                "status": 405,
                "url": "/error/error.html"
            },
            {
                "name": "503",
                "status": 503,
                "url": "/error/error.html"
            }
        ]
    },
    "headers": {
        "headers_list": [
            {
                "name": "hsts",
                "action": "AddResponse",
                "field_name": "Strict-Transport-Security",
                "field_value": "max-age=2592000; includeSubDomains"
            },
            {
                "name": "xcontent",
                "action": "AddResponse",
                "field_name": "X-Content-Type-Options",
                "field_value": "nosniff"
            },
            {
                "name": "xframe",
                "action": "AddResponse",
                "field_name": "X-Frame-Options",
                "field_value": "SAMEORIGIN"
            },
            {
                "name": "xxss",
                "action": "AddResponse",
                "field_name": "X-XSS-Protection",
                "field_value": "1; mode=block"
            },
            {
                "name": "cachectrl",
                "action": "AddResponse",
                "field_name": "Cache-Control",
                "field_value": "no-cache"
            }
        ]
    }
}