{"id":2434,"date":"2024-10-31T18:27:04","date_gmt":"2024-10-31T09:27:04","guid":{"rendered":"http:\/\/blog.moramcnt.com\/?p=2434"},"modified":"2024-10-31T18:27:04","modified_gmt":"2024-10-31T09:27:04","slug":"%ec%9a%b0%eb%b6%84%ed%88%ac%ec%97%90%ec%84%9c-asp-net-core-apache-%ec%97%b0%eb%8f%99-2","status":"publish","type":"post","link":"http:\/\/blog.moramcnt.com\/?p=2434","title":{"rendered":"\uc6b0\ubd84\ud22c\uc5d0\uc11c .ASP NET core Apache \uc5f0\ub3d9"},"content":{"rendered":"<p><strong>I. \ubaa9\ud45c<\/strong><\/p>\n<p>\uadf8\ub3d9\uc548 \ud50c\ub7ab\ud3fc\uc5d0 \uad6c\uc560\ub97c \ubc1b\uc9c0\uc54a\ub294 Java \uae30\ubc18\uc744 \ub9ce\uc774 \ud65c\uc6a9\ud558\uc600\ub294\ub370, net core\ub3c4 \ub9ac\ub205\uc2a4, \ub9e5\uc5d0\uc11c\ub3c4 \uad6c\ub3d9\uac00\ub2a5\ud558\uc5ec \uc6b0\ubd84\ud22c \ud658\uacbd\uc5d0\uc11c MSA \uae30\ubc18\uc758 \uc778\uc99d\uc11c\ubc84\ub97c \uad6c\ud604\ud558\ub294\uac83\uc744 \ubaa9\ud45c\ub85c \ud55c\ub2e4.<\/p>\n<p><strong>II. \uc5f0\uad6c\ubc0f \uac1c\ubc1c\ub0b4\uc6a9<\/strong><\/p>\n<p><b>1. \ud658\uacbd<\/b><\/p>\n<p style=\"padding-left: 40px;\">-NET Core \uc6b0\ubd84\ud22c \uc124\uce58\ub294 \uc778\ud130\ub137\uc5d0 \ub9ce\uc774 \ub098\uc640\uc788\uc73c\ubbc0\ub85c \uc0dd\ub7b5\ud568<\/p>\n<p style=\"padding-left: 40px;\">-Apache\ub294 \uac1c\ubc1c\uc11c\ubc84\uc5d0 \uc124\uce58\ub418\uc5b4 \uc788\ub294 \uac83\uc744 \ud65c\uc6a9\ud558\ubbc0\ub85c \uc124\uce58 \uacfc\uc815 \ubb38\uc11c\ub294 \uc0dd\ub7b5\ud568<\/p>\n<p><b>2. \ubc30\ud3ec<\/b><\/p>\n<p style=\"padding-left: 40px;\">\u2013 \ube44\uc96c\uc5bc \uc2a4\ud29c\ub514\uc624 \uac8c\uc2dc\ub97c \ud1b5\ud574 \uac8c\uc2dc\ub41c \ud3f4\ub354\ub97c \uc54c\uc9d1\uc73c\ub85c \uc555\ucd95\ud558\uc5ec \uc6b0\ubd84\ud22c\uc5d0 FTP\ub85c \uc5c5\ub85c\ub4dc.<\/p>\n<p style=\"padding-left: 40px;\">\u2013 \/home\/idr\/Service\/Identity\/Identity.WebApi \ud3f4\ub354\uc5d0 \uc555\ucd95\uc744 \ud480\uc5b4 \ubc30\ud3ec<\/p>\n<p style=\"padding-left: 40px;\">\u2013 unzip Identity.WebApi.zip -d Identity.WebApi<\/p>\n<p style=\"padding-left: 40px;\">\n<p><b>3. \ud504\ub85d\uc2dc \uc11c\ubc84\uad6c\uc131<\/b><\/p>\n<p style=\"padding-left: 40px;\">\u2013 \uc0ac\uc6a9\uc790\uac00 Apache\ub97c \ud1b5\ud574 \uc694\uccad\uc744 \ud558\uba74 .net core\uc758 Kestrel \uc11c\ubc84\ub85c \uc804\ub2ec\ud574\uc8fc\uae30 \uc704\ud574\uc11c\ub294 \uc5ed\ubc29\ud5a5 \ud504\ub85d\uc2dc \uc11c\ubc84\ub97c \uad6c\uc131\ud574\uc57c \ud568.<\/p>\n<p style=\"padding-left: 40px;\">\u2013 \uc815\ubc61\ud5a5 \ub610\ub294 \uc5ed\ubc29\ud5a5\ud504\ub85d\uc2dc\uc5d0 \ub300\ud55c \uae30\uc220\ubb38\uc11c\ub294 \uad6c\uae00\uac80\uc0c9\uc744 \ucc38\uace0.<\/p>\n<p style=\"padding-left: 40px;\">\u2013 \ud504\ub85c\uadf8\ub7a8\uc0c1 Startup.cs \ud30c\uc77c\uc5d0 \uc544\ub798\uc640 \uac19\uc774 \ucd94\uac00\ud574 \uc900\ub2e4.<\/p>\n<p style=\"padding-left: 40px;\">* \ud14c\uc2a4\ud2b8\ud574\ubcf4\ub2c8 \uc544\ub798\ucc98\ub7fc \uc548\ud574\ub3c4 \ub3d9\uc791\uc740 \ud55c\ub2e4.<\/p>\n<table style=\"width: 100%; margin-left: 40px; border-collapse: collapse; border-style: solid; border-color: #eeeeee; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>public void Configure(IApplicationBuilder app, IWebHostEnvironment env)<br \/>\n{<br \/>\n&#8230;<\/p>\n<p>app.UseRouting();<\/p>\n<p>\/\/ Apache \ub610\ub294 IIS \uc5ed\ubc29\ud5a5 \ud504\ub85d\uc2dc<br \/>\n\/\/ using Microsoft.AspNetCore.HttpOverrides;\uc744 \ud574\uc57c\ud568<br \/>\napp.UseForwardedHeaders(new ForwardedHeadersOptions {<br \/>\nForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto<br \/>\n});<br \/>\n}<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p><b>4. Apache \uad6c\uc131<\/b><\/p>\n<p style=\"padding-left: 40px;\"><b>1) \ud658\uacbd\uc124\uc815<\/b><\/p>\n<table style=\"width: 100%; margin-left: 40px; border-collapse: collapse; border-style: solid; border-color: #eeeeee; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>cd \/etc\/apache2\/sites-available<br \/>\nvi identity.mbizok.com.conf<\/p>\n<p>RequestHeader set &#8220;X-Forwarded-Proto&#8221; expr=%{REQUEST_SCHEME}<\/p>\n<p>ProxyPreserveHost On<br \/>\nProxyPass \/ <a href=\"http:\/\/127.0.0.1:6002\/\">http:\/\/127.0.0.1:6002\/<\/a><br \/>\nProxyPassReverse \/ <a href=\"http:\/\/127.0.0.1:6002\/\">http:\/\/127.0.0.1:6002\/<\/a><br \/>\nServerName identity.mbizok.com<br \/>\nServerAlias identity.mbizok.com<br \/>\nErrorLog \/var\/log\/apache2\/error-identity.mbizok.com.log<br \/>\nCustomLog \/var\/log\/apache2\/access-identity.mbizok.com.log common<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p style=\"padding-left: 40px;\"><b>2) \uc0ac\uc774\ud2b8\ud65c\uc131\ud654<\/b><\/p>\n<table style=\"width: 100%; margin-left: 40px; border-collapse: collapse; border-style: solid; border-color: #eeeeee; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>a2ensite identity.mbizok.com.conf<br \/>\nservice apache2 restart<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p style=\"padding-left: 40px;\"><b>3) \ub85c\uadf8 \ud655\uc778<\/b><\/p>\n<p style=\"padding-left: 80px;\">\u2013 \uc5d0\ub7ec\uac00 \ubc1c\uc0dd\ud558\uc5ec \ub85c\uadf8 \ud655\uc778<\/p>\n<table style=\"width: 100%; margin-left: 40px; border-collapse: collapse; border-style: solid; border-color: #eeeeee; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>systemctl status apache2.service<\/p>\n<p>3m&lt;94&gt; 19 16:36:06 moramlinux apache2[19883]: AH00526: Syntax error on line 2 of \/etc\/apache2\/sites-enabled\/identity.mbizok.com.conf:<br \/>\n3m&lt;94&gt; 19 16:36:06 moramlinux apache2[19883]: Invalid command &#8216;RequestHeader&#8217;, perhaps misspelled or defined by a module not included in the server configuration<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p style=\"padding-left: 80px;\">\u2013 \uc544\ud30c\uce58 \ubaa8\ub4c8 \uc124\uce58 \ubc0f \uc544\ud30c\uce58 \uc7ac\uc2dc\uc791<\/p>\n<table style=\"width: 100%; margin-left: 40px; border-collapse: collapse; border-style: solid; border-color: #eeeeee; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>a2enmod headers<br \/>\nservice apache2 restart<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>5. Kestrel \uc11c\ube44\uc2a4<\/b><\/p>\n<p style=\"padding-left: 40px;\">6002 \ud3ec\ud2b8\ub85c \ub3c4\ub294 API \uc11c\ubc84\ub97c \uc2e4\ud589\ud558\uae30 \uc704\ud574 kestrel \uc11c\ube44\uc2a4\ub97c \ub9cc\ub4e4\uc5b4\uc57c \ud568.<\/p>\n<p style=\"padding-left: 40px;\"><b>1) \uc124\uc815\ud654\uc77c<\/b><\/p>\n<table style=\"width: 100%; margin-left: 40px; border-collapse: collapse; border-style: solid; border-color: #eeeeee; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>vi \/etc\/systemd\/system\/kestrel-identity.mbizok.com.service<\/p>\n[Unit]\nDescription= Identity Web Api<\/p>\n[Service]\nWorkingDirectory=\/home\/idr\/Service\/Identity\/Identity.WebApi<br \/>\nExecStart=\/usr\/bin\/dotnet \/home\/idr\/Service\/Identity\/Identity.WebApi\/Identity.WebApi.dll &#8211;urls=&#8221;http:\/\/127.0.0.1:6002&#8243;<br \/>\nRestart=always<br \/>\n# Restart service after 10 seconds if the dotnet service crashes:<br \/>\nRestartSec=10<br \/>\nKillSignal=SIGINT<br \/>\nSyslogIdentifier=dotnet-example<br \/>\nUser=idr<br \/>\nEnvironment=ASPNETCORE_ENVIRONMENT=Production<\/p>\n[Install]\nWantedBy=multi-user.target<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p style=\"padding-left: 40px;\"><b>2) \uc11c\ube44\uc2a4 \ud65c\uc131\ud654<\/b><\/p>\n<table style=\"width: 100%; margin-left: 40px; border-collapse: collapse; border-style: solid; border-color: #eeeeee; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>systemctl enable kestrel-identity.mbizok.com.service<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p style=\"padding-left: 40px;\"><b>3) \uc11c\ube44\uc2a4 \uc2dc\uc791<\/b><\/p>\n<table style=\"width: 100%; margin-left: 40px; border-collapse: collapse; border-style: solid; border-color: #eeeeee; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>systemctl start kestrel-identity.mbizok.com.service<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p style=\"padding-left: 40px;\"><b>4) \uc11c\ube44\uc2a4 \uc0c1\ud0dc\ud655\uc778<\/b><\/p>\n<table style=\"width: 100%; margin-left: 40px; border-collapse: collapse; border-style: solid; border-color: #eeeeee; background-color: #ebebeb;\">\n<tbody>\n<tr>\n<td>systemctl status kestrel-identity.mbizok.com.service<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>III. \uacb0\ub860<\/strong><\/p>\n<p>\ub9ac\ub205\uc2a4 \ud658\uacbd\uc5d0\uc11c\ub3c4 \uc774\uc81c\ub294 Asp.Net\uc744 \uc774\uc6a9\ud560\uc218 \uc788\uac8c \ub418\uc5c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I. \ubaa9\ud45c \uadf8\ub3d9\uc548 \ud50c\ub7ab\ud3fc\uc5d0 \uad6c\uc560\ub97c \ubc1b\uc9c0\uc54a\ub294 Java \uae30\ubc18\uc744 \ub9ce\uc774 \ud65c\uc6a9\ud558\uc600\ub294\ub370, net core\ub3c4 \ub9ac\ub205\uc2a4, \ub9e5\uc5d0\uc11c\ub3c4 \uad6c\ub3d9\uac00\ub2a5\ud558\uc5ec \uc6b0\ubd84\ud22c \ud658\uacbd\uc5d0\uc11c MSA \uae30\ubc18\uc758 \uc778\uc99d\uc11c\ubc84\ub97c \uad6c\ud604\ud558\ub294\uac83\uc744 \ubaa9\ud45c\ub85c \ud55c\ub2e4. II. \uc5f0\uad6c\ubc0f \uac1c\ubc1c\ub0b4\uc6a9 1. \ud658\uacbd -NET Core \uc6b0\ubd84\ud22c \uc124\uce58\ub294 \uc778\ud130\ub137\uc5d0 \ub9ce\uc774 \ub098\uc640\uc788\uc73c\ubbc0\ub85c \uc0dd\ub7b5\ud568 -Apache\ub294 \uac1c\ubc1c\uc11c\ubc84\uc5d0 \uc124\uce58\ub418\uc5b4 \uc788\ub294 \uac83\uc744 \ud65c\uc6a9\ud558\ubbc0\ub85c \uc124\uce58 \uacfc\uc815 \ubb38\uc11c\ub294 \uc0dd\ub7b5\ud568 2. \ubc30\ud3ec \u2013 \ube44\uc96c\uc5bc \uc2a4\ud29c\ub514\uc624 \uac8c\uc2dc\ub97c \ud1b5\ud574 \uac8c\uc2dc\ub41c \ud3f4\ub354\ub97c [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[310,2],"tags":[311,312,191],"class_list":["post-2434","post","type-post","status-publish","format-standard","hentry","category-aspnet","category-2","tag-asp-net-core","tag-apache-","tag-191"],"_links":{"self":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts\/2434","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2434"}],"version-history":[{"count":1,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts\/2434\/revisions"}],"predecessor-version":[{"id":2435,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=\/wp\/v2\/posts\/2434\/revisions\/2435"}],"wp:attachment":[{"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2434"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.moramcnt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}