마이그레이션을 만들 때 생성된 마이그레이션 계획 파일을 검토해야 합니다. 마이그레이션을 실행하기 전에 파일을 맞춤설정합니다.
마이그레이션 계획의 세부정보는 소스에서 워크로드 컨테이너 아티팩트를 추출하는 데 사용됩니다.
이 문서에서는 마이그레이션을 실행하고 배포 아티팩트를 생성하기 전에 고려할 수 있는 마이그레이션 콘텐츠 및 맞춤설정의 종류를 설명합니다.
시작하기 전에
이 문서에서는 개발자가 이미 마이그레이션을 만들었고 마이그레이션 계획 파일이 있다고 가정합니다.
마이그레이션 계획 수정
파일 시스템을 복사하고 분석한 후 지정된 출력 경로 ANALYSIS_OUTPUT_PATH/config.yaml에 생성된 새 디렉터리에서 마이그레이션 계획을 찾을 수 있습니다.
필요에 따라 마이그레이션 계획을 수정하고 변경사항을 저장합니다.
마이그레이션 계획 구조
Apache2 워크로드의 마이그레이션 계획 구조를 다음 섹션의 설명대로 맞춤설정할 수 있습니다.
apacheServer:# Apache configuration for directories on the system# Content is the configuration as understood by apachedirectories:-Content:|-OptionsFollowSymLinksAllowOverrideNoneRequirealldeniedPath:/-Content:|-AllowOverrideNoneRequireallgrantedPath:/usr/share-Content:|-OptionsIndexesFollowSymLinksAllowOverrideNoneRequireallgrantedPath:/var/www/-Content:"#\tOptions Indexes FollowSymLinks\n#\tAllowOverride None\n#\tRequireallgranted"Path:/srv/-Content:|-# AllowOverride None# Require all deniedPath:/# Environment variables used by apacheenvVars:-Value:www-dataVar:APACHE_RUN_USER-Value:www-dataVar:APACHE_RUN_GROUP-Value:/var/run/apache2$SUFFIX/apache2.pidVar:APACHE_PID_FILE-Value:/var/run/apache2$SUFFIXVar:APACHE_RUN_DIR-Value:/var/lock/apache2$SUFFIXVar:APACHE_LOCK_DIR-Value:/var/log/apache2$SUFFIXVar:APACHE_LOG_DIR-Value:CVar:LANG# The port the service will listen onlisten:-"80"-"443"# Apache modules to be loaded and installedloadModules:-Module:access_compat_module-Module:alias_module-Module:auth_basic_module-Module:authn_core_module-Module:authn_file_module-Module:authz_core_module-Module:authz_host_module-Module:authz_user_module-Module:autoindex_module-Module:deflate_module-Module:dir_module-Module:env_module-Module:filter_module-Module:mime_module-Module:mpm_prefork_module-Module:negotiation_module-Module:php7_module-Module:proxy_module-Module:proxy_fcgi_module-Module:reqtimeout_module-Module:rewrite_module-Module:setenvif_module-Module:socache_shmcb_module-Module:ssl_module-Module:status_module# The sites to be extractedvirtualHosts:-address:'*:80'documentRoot:/var/www/html# should the site be enabled in extracted VMincludeInContainerImage:trueoriginalConfig:|-# The ServerName directive sets the request scheme, hostname and port that# the server uses to identify itself. This is used when creating# redirection URLs. In the context of virtual hosts, the ServerName# specifies what hostname must appear in the request's Host: header to# match this virtual host. For the default virtual host (this file) this# value is not decisive as it is used as a last resort host regardless.# However, you must set it for any further virtual host explicitly.#ServerName www.example.comServerAdminwebmaster@localhostDocumentRoot/var/www/html# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,# error, crit, alert, emerg.# It is also possible to configure the loglevel for particular# modules, e.g.#LogLevel info ssl:warnErrorLog${APACHE_LOG_DIR}/error.logCustomLog${APACHE_LOG_DIR}/access.logcombined# For most configuration files from conf-available/, which are# enabled or disabled at a global level, it is possible to# include a line for only one particular virtual host. For example the# following line enables the CGI configuration for this host only# after it has been globally disabled with "a2disconf".#Include conf-available/serve-cgi-bin.confserverName:server-0-address:'*:443'# The location of the site content (will be copied to the same location the extracted container)documentRoot:/var/www/htmlincludeInContainerImage:falseoriginalConfig:|-ServerAdminadmin@example.comDocumentRoot/var/www/htmlSSLEngineonSSLCertificateFile/etc/ssl/certs/c2d-temporary-self-signed-cert.pemSSLCertificateKeyFile/etc/ssl/private/c2d-temporary-self-signed-cert.key<Directory/var/www/html>
Options-IndexesAllowOverrideFileInfo</Directory>
serverName:server-1php:# list of php modules to be installed in the extracted container (add/remove entries to change what will be installed)modules:-calendar-ctype-curl-exif-ffi-fileinfo-filter-gd-gettext-iconv-json-mysqli-pcntl-pdo-pdo_mysql-posix-shmop-sockets-sysvmsg-sysvsem-sysvshm-tokenizer-xsl
디렉터리에 보안 정책 구성
directories 섹션에서는 특정 구성을 적용하여 특정 디렉터리에 보안 정책을 적용할 수 있습니다.
계획의 이 섹션을 작성하고 수정하려면 Directory 지시문 구문을 사용하세요.
모듈 로드 및 설치
loadModules 섹션에서 로드하고 설치할 모듈을 지정할 수 있습니다.
Migrate to Containers는 LoadModule 지시문의 원래 구성을 스캔하여 필요한 모듈을 자동으로 감지합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["# Customize migration plan for Apache servers\n===========================================\n\nYou should review the migration plan file that resulted from creating a\nmigration. Customize the file before executing the migration.\nThe details of your migration plan are used to extract the workload\ncontainer artifacts from the source.\n\nThis document describes the contents of the migration and the kinds of\ncustomizations that you might consider before you execute the migration\nand generate deployment artifacts.\n\nBefore you begin\n----------------\n\nThis document assumes that you've already [created a migration](/migrate/containers/docs/m2c-cli/create-a-migration-plan) and have the migration plan file.\n\nEdit the migration plan\n-----------------------\n\nAfter you have copied the file system and analyzed it, you can find the\nmigration plan in the new directory that is created in the specified output\npath: \u003cvar translate=\"no\"\u003eANALYSIS_OUTPUT_PATH\u003c/var\u003e/`config.yaml`.\n\nEdit the migration plan as necessary and save the changes.\n\nMigration plan structure\n------------------------\n\nThe migration plan for Apache2 workloads has the following structure which\nyou can customize, as described in the following sections. \n\n apacheServer:\n # Apache configuration for directories on the system\n # Content is the configuration as understood by apache\n directories:\n - Content: |-\n Options FollowSymLinks\n AllowOverride None\n Require all denied\n Path: /\n - Content: |-\n AllowOverride None\n Require all granted\n Path: /usr/share\n - Content: |-\n Options Indexes FollowSymLinks\n AllowOverride None\n Require all granted\n Path: /var/www/\n - Content: \"#\\tOptions Indexes FollowSymLinks\\n#\\tAllowOverride None\\n#\\tRequire\n all granted\"\n Path: /srv/\n - Content: |-\n # AllowOverride None\n # Require all denied\n Path: /\n # Environment variables used by apache\n envVars:\n - Value: www-data\n Var: APACHE_RUN_USER\n - Value: www-data\n Var: APACHE_RUN_GROUP\n - Value: /var/run/apache2$SUFFIX/apache2.pid\n Var: APACHE_PID_FILE\n - Value: /var/run/apache2$SUFFIX\n Var: APACHE_RUN_DIR\n - Value: /var/lock/apache2$SUFFIX\n Var: APACHE_LOCK_DIR\n - Value: /var/log/apache2$SUFFIX\n Var: APACHE_LOG_DIR\n - Value: C\n Var: LANG\n # The port the service will listen on\n listen:\n - \"80\"\n - \"443\"\n # Apache modules to be loaded and installed\n loadModules:\n - Module: access_compat_module\n - Module: alias_module\n - Module: auth_basic_module\n - Module: authn_core_module\n - Module: authn_file_module\n - Module: authz_core_module\n - Module: authz_host_module\n - Module: authz_user_module\n - Module: autoindex_module\n - Module: deflate_module\n - Module: dir_module\n - Module: env_module\n - Module: filter_module\n - Module: mime_module\n - Module: mpm_prefork_module\n - Module: negotiation_module\n - Module: php7_module\n - Module: proxy_module\n - Module: proxy_fcgi_module\n - Module: reqtimeout_module\n - Module: rewrite_module\n - Module: setenvif_module\n - Module: socache_shmcb_module\n - Module: ssl_module\n - Module: status_module\n # The sites to be extracted\n virtualHosts:\n - address: '*:80'\n documentRoot: /var/www/html\n # should the site be enabled in extracted VM\n includeInContainerImage: true\n originalConfig: |-\n # The ServerName directive sets the request scheme, hostname and port that\n # the server uses to identify itself. This is used when creating\n # redirection URLs. In the context of virtual hosts, the ServerName\n # specifies what hostname must appear in the request's Host: header to\n # match this virtual host. For the default virtual host (this file) this\n # value is not decisive as it is used as a last resort host regardless.\n # However, you must set it for any further virtual host explicitly.\n #ServerName www.example.com\n\n ServerAdmin webmaster@localhost\n DocumentRoot /var/www/html\n\n # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,\n # error, crit, alert, emerg.\n # It is also possible to configure the loglevel for particular\n # modules, e.g.\n #LogLevel info ssl:warn\n\n ErrorLog ${APACHE_LOG_DIR}/error.log\n CustomLog ${APACHE_LOG_DIR}/access.log combined\n\n # For most configuration files from conf-available/, which are\n # enabled or disabled at a global level, it is possible to\n # include a line for only one particular virtual host. For example the\n # following line enables the CGI configuration for this host only\n # after it has been globally disabled with \"a2disconf\".\n #Include conf-available/serve-cgi-bin.conf\n serverName: server-0\n - address: '*:443'\n # The location of the site content (will be copied to the same location the extracted container)\n documentRoot: /var/www/html\n includeInContainerImage: false\n originalConfig: |-\n ServerAdmin admin@example.com\n DocumentRoot /var/www/html\n SSLEngine on\n SSLCertificateFile /etc/ssl/certs/c2d-temporary-self-signed-cert.pem\n SSLCertificateKeyFile /etc/ssl/private/c2d-temporary-self-signed-cert.key\n\n \u003cDirectory /var/www/html\u003e\n Options -Indexes\n AllowOverride FileInfo\n \u003c/Directory\u003e\n serverName: server-1\n php:\n # list of php modules to be installed in the extracted container (add/remove entries to change what will be installed)\n modules:\n - calendar\n - ctype\n - curl\n - exif\n - ffi\n - fileinfo\n - filter\n - gd\n - gettext\n - iconv\n - json\n - mysqli\n - pcntl\n - pdo\n - pdo_mysql\n - posix\n - shmop\n - sockets\n - sysvmsg\n - sysvsem\n - sysvshm\n - tokenizer\n - xsl\n\n### Configure security policies on directories\n\nIn the `directories` section, you can apply specific configurations to\nenforce security policies on certain directories.\nTo fill in and edit this section of the plan, use the syntax for the\n[`Directory` directive](https://httpd.apache.org/docs/2.4/mod/core.html#directory).\n\n### Load and install modules\n\nIn the `loadModules` section, you can specify the modules that you want\nto load and install.\nMigrate to Containers automatically detects the required modules by\nscanning the original configuration for the\n[`LoadModule` directive](https://httpd.apache.org/docs/2.4/mod/mod_so.html#loadmodule).\n\n#### Supported Modules\n\n access_compat_module\n alias_module\n auth_basic_module\n authn_core_module\n authn_file_module\n authz_core_module\n authz_host_module\n authz_user_module\n autoindex_module\n deflate_module\n dir_module\n env_module\n expires_module\n filter_module\n mime_module\n mpm_prefork_module\n negotiation_module\n php7_module\n proxy_fcgi_module\n proxy_module\n remoteip_module\n reqtimeout_module\n rewrite_module\n setenvif_module\n socache_shmcb_module\n ssl_module\n status_module\n\n| **Note:** Including unknown modules in your migration plan causes the migration to fail with an error message that specifies the unknown modules.\n\n### Specify and configure virtual hosts\n\nIn the `virtualHosts` section, Migrate to Containers copies all the\ndirectives enclosed in a\n[`\u003cVirtualHost\u003e` and `\u003c/VirtualHost\u003e` block](https://httpd.apache.org/docs/2.4/mod/core.html#virtualhost).\n\nIn the `address` field, the IP address of the site is replaced with `*`.\n\nUnder `originalConfig`, the `DocumentRoot` field specifies the path\nfrom which Apache serves the requested files.\nFor each path specified in `DocumentRoot`, Migrate to Containers does\nthe following:\n\n- It compresses each path a separate tar file.\n- It copies the tar file in the artifacts for extraction.\n- It changes the permissions for the user in the Docker image with the `ADD --chown` option in the Dockerfile.\n\n### Review the PHP extensions\n\nMigrate to Containers automatically detects the PHP modules installed\nin your VM and includes them under the `php` section of the migration plan.\nReview this section and add or remove modules as needed.\n\nWhat's next\n-----------\n\n- Learn how to [execute the migration](../execute-the-migration-plan)."]]