ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • nginx php-fpm mariadb 설치
    ubuntu 2024. 2. 4. 14:32

    첫 번째 단계는 Andre 저장소를 서버에 추가하고 apt를 사용하여 nginx를 설치하는 것입니다.

    먼저 Andre 저장소를 서버에 추가해야 합니다.

     

    sudo apt update;
    sudo apt upgrade;

     

    sudo add-apt-repository ppa:ondrej/nginx-mainline;

     

    nginx 및  두개의 패키지를 설치할 것입니다.

    sudo apt install nginx libnginx-mod-http-cache-purge libnginx-mod-http-headers-more-filter;

     

    두 패키지인 libnginx-mod-http-cache-purge와 libnginx-mod-http-headers-more-filter는 nginx웹 서버에 대한 모듈 확장 기능입니다.

    1. libnginx-mod-http-cache-purge:
      • 기능: 이 모듈은 FastCGI 캐시에서 선택적으로 데이터를 삭제하는 기능을 제공합니다.
      • 용도: FastCGI 캐시는 nginx 에서 동적 컨텐츠를 가속화하기 위해 사용되는 기능 중 하나입니다. 이 모듈은 특정 URL 또는 경로의 캐시를 지울 수 있도록 해주어, 필요한 경우 캐시를 강제로 재생성할 수 있습니다.
    2. libnginx-mod-http-headers-more-filter:
      • 기능: 이 모듈은 HTTP 응답 헤더를 더 유연하게 조작할 수 있도록 하는 기능을 제공합니다.
      • 용도: nginx 가 클라이언트에게 응답할 때 헤더에 추가 정보를 삽입하거나, 특정 헤더를 변경하거나 삭제할 수 있습니다. 이를 통해 웹 서버의 동작을 더욱 세밀하게 제어할 수 있습니다.

     

    상태를 확인할 수 있습니다.

    sudo systemctl status nginx;

     

    systemd[1]: Starting A high performance web server and a reverse proxy server...
    systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
    systemd[1]: Started A high performance web server and a reverse proxy server.

     

    20.04에서 사라졌다가 22.04에서 다시 나타난 것 같습니다.
    이는 단순히 nginx와 systemd가 리소스를 놓고 경쟁하는 경우입니다.

     

     vi /usr/lib/systemd/system/nginx.service

    ........

    [Service] 

    .........

    ExecStartPost=/bin/sleep 1 <= 추가

     

    [Install]

    WantedBy=multi-user.target

     

    sudo systemctl daemon-reload;

    sudo systemctl restart nginx;

    sudo  systemctl enable nginx;

     

     

    Maria DB 설치

    curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | bash;

    sudo apt update;

    sudo apt install mariadb-server mariadb-client;

     

    php-fpm 설치

    sudo add-apt-repository ppa:ondrej/php;

    sudo apt install php8.x-{fpm,gd,mbstring,mysql,xml,xmlrpc,opcache,cli,zip,intl,bcmath,curl,imagick} php-ssh2;

    sudo systemctl status php8.x-fpm;

     

    composer 설치

    > sudo apt install zip

    > php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
    > php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
    > php composer-setup.php
    > php -r "unlink('composer-setup.php');"

    > sudo mv composer.phar /usr/local/bin/composer

     

    laravel 설치

    > composer create-project laravel/laravel example-app

    'ubuntu' 카테고리의 다른 글

    [Ubuntu] Npm, node 업그레이드 하는 법  (0) 2024.05.20
    ubuntu wordpress timezone 설정  (1) 2024.04.29
    PATH_TRANSLATED, SCRIPT_FILENAME, PATH_INFO 및 PHP CGI 경로 수정  (0) 2024.02.23
    iftop  (1) 2024.02.04

    댓글

Designed by Tistory.