{"id":576,"date":"2022-10-19T10:09:44","date_gmt":"2022-10-19T01:09:44","guid":{"rendered":"https:\/\/centos.ihavenomoney.co.kr\/?page_id=576"},"modified":"2024-04-05T15:08:13","modified_gmt":"2024-04-05T06:08:13","slug":"nginx%ec%97%94%ec%a7%84%ec%97%91%ec%8a%a4","status":"publish","type":"page","link":"https:\/\/centos.ihavenomoney.co.kr\/?page_id=576","title":{"rendered":"Nginx(\uc5d4\uc9c4\uc5d1\uc2a4)"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Remark : apache \ub300\uc2e0 Nginx \ub97c \uc124\uce58\ud574 \ubcf8\ub2e4.<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\ub7ec\uc2dc\uc544\uc758 \ud504\ub85c\uadf8\ub7a8 \uac1c\ubc1c\uc790\uc778 \uc774\uace0\ub974 \uc2dc\uc1fc\ube0c(Igor Sysoev)\uac00 \uac1c\ubc1c\ud558\uc5ec 2004\ub144 \ubc1c\ud45c\ud55c \ubaa8\ub4c8\ud654 \ubc0f \ud6a8\uc728\uc801\uc73c\ub85c \uc801\uc740 \uba54\ubaa8\ub9ac \uc0ac\uc6a9\uc73c\ub85c \uc544\ud30c\uce58(Apache) \ubcf4\ub2e4 \uc18d\ub3c4\uac00 \ube60\ub974\ub2e4.<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">1. sudo yum update \uc5c5\ub370\uc774\ud2b8<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \">sudo yum update<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">2. sudo yum install nginx \uc124\uce58<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \">sudo yum install -y nginx <\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">3.  nginx   \ub370\ubaac \uc2dc\uc791<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \">sudo systemctl start nginx\nsudo systemctl enable nginx<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">4.  nginx  \uc0c1\ud0dc \ud655\uc778<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \"># systemctl status nginx\n\u25cf nginx.service - The nginx HTTP and reverse proxy server\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/nginx.service; enabled; vendor preset: disabled)\n   Active: active (running) since Wed 2022-10-19 09:49:53 KST; 15min ago\n Main PID: 17249 (nginx)\n   CGroup: \/system.slice\/nginx.service\n           \u251c\u250017249 nginx: master process \/usr\/sbin\/nginx\n           \u251c\u250017250 nginx: worker process\n           \u251c\u250017251 nginx: worker process\n           \u251c\u250017252 nginx: worker process\n           \u251c\u250017253 nginx: worker process\n           \u251c\u250017254 nginx: worker process\n           \u251c\u250017255 nginx: worker process\n           \u251c\u250017256 nginx: worker process\n           \u2514\u250017257 nginx: worker process\n\nOct 19 09:49:53 h24.com systemd[1]: Starting The nginx HTTP and r....\nOct 19 09:49:53 h24.com nginx[17243]: nginx: the configuration fi...k\nOct 19 09:49:53 h24.com nginx[17243]: nginx: configuration file \/...l\nOct 19 09:49:53 h24.com systemd[1]: Started The nginx HTTP and re....\nHint: Some lines were ellipsized, use -l to show in full.\n\n<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">5. nginx default site config<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \"># cd \/etc\/nginx\/\n# vi nginx.conf\n\n\n# For more information on configuration, see:\n#   * Official English Documentation: http:\/\/nginx.org\/en\/docs\/\n#   * Official Russian Documentation: http:\/\/nginx.org\/ru\/docs\/\n\nuser nginx;\nworker_processes auto;\nerror_log \/var\/log\/nginx\/error.log;\npid \/run\/nginx.pid;\n\n# Load dynamic modules. See \/usr\/share\/doc\/nginx\/README.dynamic.\ninclude \/usr\/share\/nginx\/modules\/*.conf;\n\nevents {\n    worker_connections 1024;\n}\n\nhttp {\n    log_format  main  '$remote_addr - $remote_user [$time_local] \"$request\" '\n                      '$status $body_bytes_sent \"$http_referer\" '\n                      '\"$http_user_agent\" \"$http_x_forwarded_for\"';\n\n    access_log  \/var\/log\/nginx\/access.log  main;\n\n    sendfile            on;\n    tcp_nopush          on;\n    tcp_nodelay         on;\n    keepalive_timeout   65;\n    types_hash_max_size 4096;\n\n    include             \/etc\/nginx\/mime.types;\n    default_type        application\/octet-stream;\n\n    # Load modular configuration files from the \/etc\/nginx\/conf.d directory.\n    # See http:\/\/nginx.org\/en\/docs\/ngx_core_module.html#include\n    # for more information.\n    include \/etc\/nginx\/conf.d\/*.conf;\n\n    server {\n        listen       80;\n        listen       [::]:80;\n        server_name  _;\n        root         \/usr\/share\/nginx\/html;\n\n        # Load configuration files for the default server block.\n        include \/etc\/nginx\/default.d\/*.conf;\n\n        error_page 404 \/404.html;\n        location = \/404.html {\n        }\n\n        error_page 500 502 503 504 \/50x.html;\n        location = \/50x.html {\n        }\n    }\n\n# Settings for a TLS enabled server.\n#\n#    server {\n#        listen       443 ssl http2;\n#        listen       [::]:443 ssl http2;\n#        server_name  _;\n#        root         \/usr\/share\/nginx\/html;\n#\n#        ssl_certificate \"\/etc\/pki\/nginx\/server.crt\";\n#        ssl_certificate_key \"\/etc\/pki\/nginx\/private\/server.key\";\n#        ssl_session_cache shared:SSL:1m;\n#        ssl_session_timeout  10m;\n#        ssl_ciphers HIGH:!aNULL:!MD5;\n#        ssl_prefer_server_ciphers on;\n#\n#        # Load configuration files for the default server block.\n#        include \/etc\/nginx\/default.d\/*.conf;\n#\n#        error_page 404 \/404.html;\n#            location = \/40x.html {\n#        }\n#\n#        error_page 500 502 503 504 \/50x.html;\n#            location = \/50x.html {\n#        }\n#    }\n\n}\n<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">6.  \uc0ac\uc774\ud2b8 \ud655\uc778<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"879\" height=\"459\" src=\"https:\/\/centos.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/image.png\" alt=\"\" class=\"wp-image-577\" srcset=\"https:\/\/centos.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/image.png 879w, https:\/\/centos.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/image-300x157.png 300w, https:\/\/centos.ihavenomoney.co.kr\/wp-content\/uploads\/2022\/10\/image-768x401.png 768w\" sizes=\"auto, (max-width: 879px) 100vw, 879px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">7. \uacbd\ub85c \uc218\uc815<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \"># yum install php-fpm -y\n<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">8. PHP-FPM \uc124\uce58<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" >vi \/etc\/nginx\/conf.d\/default.conf\n\nyum-config-manager --enable remi-php73\n\nyum install php php-mysqlnd php-fpm\n\nphp --version<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">9. PHP-FPM \uc138\ud305<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" ># vi \/etc\/php-fpm.d\/www.conf\n\nuser = nginx\ngroup = nginx\n\nlisten = \/var\/run\/php-fpm\/php-fpm.sock;\n\nlisten.owner = nginx\nlisten.group = nginx\nlisten.mode = 0660<\/pre><\/div>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" >sudo systemctl start php-fpm<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">9. new site \uc138\ud305<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" ># vi \/etc\/nginx\/conf.d\/default.conf\n\nserver {\n    listen       80;\n    server_name  server_domain_or_IP;\n\n    root   \/var\/www\/html;\n    index index.php index.html index.htm;\n\n    location \/ {\n        try_files $uri $uri\/ =404;\n    }\n    error_page 404 \/404.html;\n    error_page 500 502 503 504 \/50x.html;\n    \n    location = \/50x.html {\n        root \/usr\/share\/nginx\/html;\n    }\n\n    location ~ \\.php$ {\n        try_files $uri =404;\n        fastcgi_pass unix:\/var\/run\/php-fpm\/php-fpm.sock;\n        fastcgi_index index.php;\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n        include fastcgi_params;\n    }\n}<\/pre><\/div>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" >sudo systemctl restart nginx<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">10. test<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:vim decode:true \" ># vi \/var\/www\/html\/ info.php\n\n&lt;?php\n\nphpinfo();<\/pre><\/div>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"939\" height=\"595\" src=\"https:\/\/centos.ihavenomoney.co.kr\/wp-content\/uploads\/2024\/04\/image.png\" alt=\"\" class=\"wp-image-604\" srcset=\"https:\/\/centos.ihavenomoney.co.kr\/wp-content\/uploads\/2024\/04\/image.png 939w, https:\/\/centos.ihavenomoney.co.kr\/wp-content\/uploads\/2024\/04\/image-300x190.png 300w, https:\/\/centos.ihavenomoney.co.kr\/wp-content\/uploads\/2024\/04\/image-768x487.png 768w\" sizes=\"auto, (max-width: 939px) 100vw, 939px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Remark : apache \ub300\uc2e0 Nginx \ub97c \uc124\uce58\ud574 \ubcf8\ub2e4. \ub7ec\uc2dc\uc544\uc758 \ud504\ub85c\uadf8\ub7a8 \uac1c\ubc1c\uc790\uc778 \uc774\uace0\ub974 \uc2dc\uc1fc\ube0c(Igor Sysoev)\uac00 \uac1c\ubc1c\ud558\uc5ec 2004\ub144 \ubc1c\ud45c\ud55c \ubaa8\ub4c8\ud654 \ubc0f \ud6a8\uc728\uc801\uc73c\ub85c \uc801\uc740 \uba54\ubaa8\ub9ac \uc0ac\uc6a9\uc73c\ub85c \uc544\ud30c\uce58(Apache) \ubcf4\ub2e4 \uc18d\ub3c4\uac00 \ube60\ub974\ub2e4. 1. sudo yum update \uc5c5\ub370\uc774\ud2b8 2. sudo yum install nginx \uc124\uce58 3. nginx \ub370\ubaac \uc2dc\uc791 4. nginx \uc0c1\ud0dc \ud655\uc778 5. nginx default site config 6. \uc0ac\uc774\ud2b8 \ud655\uc778 7. &hellip;<br \/><a href=\"https:\/\/centos.ihavenomoney.co.kr\/?page_id=576\" class=\"more-link pen_button pen_element_default pen_icon_arrow_double\"><span class=\"screen-reader-text\">Nginx(\uc5d4\uc9c4\uc5d1\uc2a4)<\/span> \ub354\ubcf4\uae30<\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-576","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/centos.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/centos.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/centos.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/centos.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/centos.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=576"}],"version-history":[{"count":7,"href":"https:\/\/centos.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/576\/revisions"}],"predecessor-version":[{"id":605,"href":"https:\/\/centos.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/pages\/576\/revisions\/605"}],"wp:attachment":[{"href":"https:\/\/centos.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}